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  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 30 Oct 2007 00:08:39 -0500
From:	Matt Mackall <mpm@...enic.com>
To:	David Miller <davem@...emloft.net>
Cc:	tina.yang@...cle.com, netdev@...r.kernel.org
Subject: Re: [patch] net: avoid race between netpoll and network fast path

On Mon, Oct 29, 2007 at 09:26:11PM -0700, David Miller wrote:
> From: Tina Yang <tina.yang@...cle.com>
> Date: Tue, 16 Oct 2007 22:46:30 -0700
> 
> > 	The precise race is
> > 	1) net_rx_action get the dev from poll_list
> > 	2) at the same time, netpoll poll_napi() get a hold of the poll lock
> > 	   and calls ->poll(), remove dev from the poll list
> > 	3) after it finishes, net_rx_action get the poll lock, and calls
> > 	   ->poll() the second time, and panic when trying to remove (again)
> > 	   the dev from the poll list.
> 
> This is trivial to fix.
> 
> I'll check the following into 2.6.14 and backport it to
> the -stable trees.
> 
> [NET]: Fix race between poll_napi() and net_rx_action()
> 
> netpoll_poll_lock() synchronizes the ->poll() invocation
> code paths, but once we have the lock we have to make
> sure that NAPI_STATE_SCHED is still set.  Otherwise we
> get:
> 
> 	cpu 0			cpu 1
> 
> 	net_rx_action()		poll_napi()
> 	netpoll_poll_lock()	... spin on ->poll_lock
> 	->poll()
> 	  netif_rx_complete
> 	netpoll_poll_unlock()	acquire ->poll_lock()
> 				->poll()
> 				 netif_rx_complete()
> 				 CRASH
> 
> Based upon a bug report from Tina Yang.
> 
> Signed-off-by: David S. Miller <davem@...emloft.net>

Thanks, Dave.

-- 
Mathematics is the supreme nostalgia of our time.
-
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