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:	Tue, 09 Oct 2007 07:33:14 -0400
From:	Jeff Garzik <jeff@...zik.org>
To:	Pavel Emelyanov <xemul@...nvz.org>
CC:	David Miller <davem@...emloft.net>,
	Linux Netdev List <netdev@...r.kernel.org>, devel@...nvz.org
Subject: Re: [PATCH][NET-2.6.24] Remove double dev->flags checking when calling
 dev_close()

Pavel Emelyanov wrote:
> The unregister_netdevice() and dev_change_net_namespace() 
> both check for dev->flags to be IFF_UP before calling the 
> dev_close(), but the dev_close() checks for IFF_UP itself, 
> so remove those unneeded checks.
> 
> Signed-off-by: Pavel Emelyanov <xemul@...nvz.org>
> 
> ---
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index e7e728a..1e169a5 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3893,8 +3893,7 @@ void unregister_netdevice(struct net_dev
>  	BUG_ON(dev->reg_state != NETREG_REGISTERED);
>  
>  	/* If device is running, close it first. */
> -	if (dev->flags & IFF_UP)
> -		dev_close(dev);
> +	dev_close(dev);
>  
>  	/* And unlink it from device chain. */
>  	unlist_netdevice(dev);
> @@ -4018,8 +4017,7 @@ int dev_change_net_namespace(struct net_
>  	 */
>  
>  	/* If device is running close it first. */
> -	if (dev->flags & IFF_UP)
> -		dev_close(dev);
> +	dev_close(dev);
>  
>  	/* And unlink it from device chain */
>  	err = -ENODEV;

One side effect of this patch:  might_sleep() is now called unconditionally.

If that is irrelevant... ACK.


-
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