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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1250264019.3807.1301.camel@calx>
Date:	Fri, 14 Aug 2009 10:33:39 -0500
From:	Matt Mackall <mpm@...enic.com>
To:	DDD <Dongdong.deng@...driver.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	"Ashfield, Bruce" <Bruce.Ashfield@...driver.com>,
	jason.wessel@...driver.com
Subject: Re: [PATCH] drivers/net: fixed drivers that support netpoll use
 ndo_start_xmit()

On Fri, 2009-08-14 at 13:12 +0800, DDD wrote:
> The NETPOLL API requires that interrupts remain disabled in
> netpoll_send_skb(). The use of spin_lock_irq() and spin_unlock_irq()
> in the NETPOLL API callbacks causes the interrupts to get enabled and
> can lead to kernel instability.
> 
> The solution is to use spin_lock_irqsave() and spin_unlock_restore()
> to prevent the irqs from getting enabled while in netpoll_send_skb().
> 
> Call trace:
> netpoll_send_skb()
> {
>    -> local_irq_save(flags)
>      ---> dev->ndo_start_xmit(skb, dev)
>          ---> spin_lock_irq()
>          ---> spin_unlock_irq() *******here would enable the interrupt.
>               ...
>    -> local_irq_restore(flags)
> }
> 
> Signed-off-by: Dongdong Deng <dongdong.deng@...driver.com>
> Signed-off-by: Jason Wessel <jason.wessel@...driver.com>
> Acked-by: Bruce Ashfield <bruce.ashfield@...driver.com>

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

Perhaps we should also have a WARN_ONCE if start_xmit returns with
interrupts enabled?

-- 
http://selenic.com : development and support for Mercurial and Linux


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ