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]
Date:	Wed, 6 May 2015 11:53:53 +0800
From:	Sonic Zhang <sonic.adi@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	Giuseppe CAVALLARO <peppe.cavallaro@...com>,
	netdev <netdev@...r.kernel.org>,
	adi-buildroot-devel@...ts.sourceforge.net,
	"Zhang, Sonic" <sonic.zhang@...log.com>
Subject: Re: [PATCH] stmmac: call local_irq_save other than disable_irq in poll_controller

Hi David,

On Wed, May 6, 2015 at 7:36 AM, David Miller <davem@...emloft.net> wrote:
> From: Sonic Zhang <sonic.adi@...il.com>
> Date: Tue, 5 May 2015 15:55:53 +0800
>
>> From: Sonic Zhang <sonic.zhang@...log.com>
>>
>> It is possible that poll_controller is called from netpoll.c with irq
>> already disabled. Unexpected interrupt may be triggered if always
>> enable irq before returning from poll_controller.
>>
>> Signed-off-by: Sonic Zhang <sonic.zhang@...log.com>
>
> Nope, this is wrong.
>
> If you don't use disable_irq(), the interrupt handler can run in
> parallel on another cpu and you definitely do not want that.

How about change local_irq_save(flags) to
spin_lock_irqsave(&priv->lock, flags) ?

>
> There is nothing wrong with the interrupt triggering on the
> enable_irq() here.  If that causes some problem, there is a
> bug in this driver.

When I debug Linux kernel via KGDB over Ethernet, KGDB calls netpoll
API and stmmac_poll_controller to send UDP packets with all interrupts
disabled. KGDB assumes all interrupts keeps disabled when it is active
and doing UDP data transmission. Enabling interrupts in
stmmac_poll_controller causes KGDB re-enter exception and system halt.

Although KGDB over Ethernet is not part of the mainline tree, I feel
this patch is useful in case other kernel functions want to call
netpoll API with interrupts disabled.


Regards,

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