public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Is it possible for addrconf_init_net to kfree no-heap address?
@ 2010-08-19  4:15 ye janboe
  2010-08-23  7:42 ` Pavel Emelyanov
  0 siblings, 1 reply; 2+ messages in thread
From: ye janboe @ 2010-08-19  4:15 UTC (permalink / raw)
  To: davem, xemul; +Cc: linux-kernel

hi, Pavel and David

addrconf_init_net make me a little confused.

if all and dflt are not allocated by kmemdup and sysctl_register
failed, this function will try to kfree dftl which points to
ipv6_devconf_dfl which is not a heap address. AFAIK, kfree will panic
if the address does not belong to slab page.

Is there any special reason for these codes?

many thanks!

-- 
Janboe Ye

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Is it possible for addrconf_init_net to kfree no-heap address?
  2010-08-19  4:15 Is it possible for addrconf_init_net to kfree no-heap address? ye janboe
@ 2010-08-23  7:42 ` Pavel Emelyanov
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Emelyanov @ 2010-08-23  7:42 UTC (permalink / raw)
  To: ye janboe; +Cc: davem, linux-kernel

On 08/19/2010 08:15 AM, ye janboe wrote:
> hi, Pavel and David
> 
> addrconf_init_net make me a little confused.
> 
> if all and dflt are not allocated by kmemdup and sysctl_register
> failed, this function will try to kfree dftl which points to
> ipv6_devconf_dfl which is not a heap address. AFAIK, kfree will panic
> if the address does not belong to slab page.
> 
> Is there any special reason for these codes?

This situation can only occur for the init namespace, i.e. early at host
boot so the sysctl registration will not fail for sure.

On the other hand, since the ipv6 can be built as module this code can be
executed later run-time ...

Can you send a fixing patch?

> many thanks!
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-23  8:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-19  4:15 Is it possible for addrconf_init_net to kfree no-heap address? ye janboe
2010-08-23  7:42 ` Pavel Emelyanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox