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:	Fri, 1 Feb 2013 22:21:51 +0100
From:	Francois Romieu <romieu@...zoreil.com>
To:	Neil Horman <nhorman@...driver.com>
Cc:	netdev@...r.kernel.org, Ivan Vecera <ivecera@...hat.com>,
	"David S. Miller" <davem@...emloft.net>,
	Ben Hutchings <bhutchings@...arflare.com>,
	Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH v3] netpoll: protect napi_poll and poll_controller during dev_[open|close]

Neil Horman <nhorman@...driver.com> :
[...]
> diff --git a/net/core/dev.c b/net/core/dev.c
> index a87bc74..90b267a 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
[...]
> @@ -1266,6 +1268,19 @@ static int __dev_open(struct net_device *dev)
>  	if (!netif_device_present(dev))
>  		return -ENODEV;
>  
> +	/*
> +	 * Block netpoll from trying to do any rx path servicing
> +	 * If we don't do this there is a chance ndo_poll_controller
> +	 * or ndo_poll may be running while we open the device
> +	 */
> +	rcu_read_lock();
> +	ni = rcu_dereference(dev->npinfo);
> +	if (ni && test_and_set_bit(NETPOLL_RX_ACTIVE, &ni->flags)) {
> +		rcu_read_unlock();
> +		return -EBUSY;
> +	}
> +	rcu_read_unlock();
> +

struct net_device contains no npinfo member when CONFIG_NETPOLL is not set.

-- 
Ueimor
--
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