lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 14 Nov 2007 16:47:24 +0300
From:	Pavel Emelyanov <xemul@...nvz.org>
To:	Herbert Xu <herbert@...dor.apana.org.au>
CC:	David Miller <davem@...emloft.net>,
	Linux Netdev List <netdev@...r.kernel.org>, devel@...nvz.org
Subject: Re: [PATCH] Remove notifier block from chain when register_netdevice_notifier
 fails

Herbert Xu wrote:
> On Wed, Nov 14, 2007 at 03:08:03PM +0300, Pavel Emelyanov wrote:
>> Commit fcc5a03ac42564e9e255c1134dda47442289e466 makes the
>> register_netdevice_notifier() handle the error from the
>> NETDEV_REGISTER event, sent to the registering block. 
>>
>> The bad news is that in this case the notifier block is 
>> not removed from the list, but the error is returned to the 
>> caller. In case the caller is in module init function and 
>> handles this error this can abort the module loading. The
>> notifier block will be then removed from the kernel, but 
>> will be left in the list. Oops :(
>>
>> I think that the notifier block should be removed from the
>> chain in case of error, regardless whether this error is 
>> handled by the caller or not. In the worst case (the error 
>> is _not_ handled) module will not receive the events any 
>> longer.
>>
>> Signed-off-by: Pavel Emelyanov <xemul@...nvz.org>
> 
> Good catch.  Thanks Pavel!
> 
> Acked-by: Herbert Xu <herbert@...dor.apana.org.au>

Thanks :)

BTW, I have one more question I can't find the answer to by 
myself. Why the unregister_netdevice_notifier doesn't produce 
the GOING_DOWN-DOWN-UNREGISTER event sequence for the notifier
block which is being unregistered? Was this made deliberately?

Pavel
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ