Subject: Re: [PATCH][NETNS]: Fix arbitrary net_device-s corruptions on net_ns stop.

From: Daniel Lezcano <[email-masked]>
Date: Wed, 07 May 2008 18:12:35 +0200

Pavel Emelyanov wrote:
>>> +		sprintf(fb_name, "dev%d", dev->ifindex);
>> The computed interface name can not exceed IFNAMSIZ, 3 ('dev') + 10 (max 
>> int) + 1 ('\0'). In this case there is no risk to corrupt the stack but 
>> may be it is more secure to change that to snprintf(fb_name, IFNAMSIZ, 
>> "dev%d", dev->ifindex), just in case, no ?
> 
> But you have just noticed, that "there is no risk to corrupt the stack"!
> What else can be "more secure" then :) ?

Just in case, for example, someone changes 'dev' by 'virtdev' or 
something else.