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] [day] [month] [year] [list]
Message-ID: <20090917164552.GH8789@waste.org>
Date:	Thu, 17 Sep 2009 11:45:52 -0500
From:	Matt Mackall <mpm@...enic.com>
To:	DDD <Dongdong.deng@...driver.com>
Cc:	davem@...emloft.net, romieu@...zoreil.com, netdev@...r.kernel.org
Subject: Re: [PATCH] d44: the poll handler b44_poll must not enable IRQ unconditionally

On Thu, Sep 17, 2009 at 10:10:47AM +0800, DDD wrote:
> net/core/netpoll.c::netpoll_send_skb() calls the poll handler when
> it is available. As netconsole can be used from almost any context,
> IRQ must not be enabled blindly in the NAPI handler of the driver
> which supports netpoll.
> 
> Call trace:
> netpoll_send_skb()
> {
> local_irq_save(flags)
>   -> netpoll_poll()
>     -> poll_napi()
>       -> poll_one_napi()
>         -> napi->poll()
>             -> b44_poll()
> local_irq_restore(flags)
> }
> 
> Signed-off-by: Dongdong Deng <dongdong.deng@...driver.com>

Acked-by: Matt Mackall <mpm@...enic.com>

> ---
>  drivers/net/b44.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/b44.c b/drivers/net/b44.c
> index 0189dcd..e046943 100644
> --- a/drivers/net/b44.c
> +++ b/drivers/net/b44.c
> @@ -847,23 +847,22 @@ static int b44_poll(struct napi_struct *napi, int budget)
>  {
>  	struct b44 *bp = container_of(napi, struct b44, napi);
>  	int work_done;
> +	unsigned long flags;
>  
> -	spin_lock_irq(&bp->lock);
> +	spin_lock_irqsave(&bp->lock, flags);
>  
>  	if (bp->istat & (ISTAT_TX | ISTAT_TO)) {
>  		/* spin_lock(&bp->tx_lock); */
>  		b44_tx(bp);
>  		/* spin_unlock(&bp->tx_lock); */
>  	}
> -	spin_unlock_irq(&bp->lock);
> +	spin_unlock_irqrestore(&bp->lock, flags);
>  
>  	work_done = 0;
>  	if (bp->istat & ISTAT_RX)
>  		work_done += b44_rx(bp, budget);
>  
>  	if (bp->istat & ISTAT_ERRORS) {
> -		unsigned long flags;
> -
>  		spin_lock_irqsave(&bp->lock, flags);
>  		b44_halt(bp);
>  		b44_init_rings(bp);
> -- 
> 1.6.0.4
> 

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ