On Mon, Oct 29, 2007 at 09:26:11PM -0700, David Miller wrote:
> From: Tina Yang <[EMAIL PROTECTED]>
> 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 <[EMAIL PROTECTED]>

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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to