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] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 11 Nov 2012 00:53:15 +0000
From:	"Liu, Chuansheng" <chuansheng.liu@...el.com>
To:	Martin Steigerwald <Martin@...htvoll.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: RE: [REGRESSION] 3.7-rc3+git hard lockup on CPU after
 inserting/removing USB stick

> The first bad commit is:
> 
> commit 73d4066055e0e2830533041f4b91df8e6e5976ff
> Author: Chuansheng Liu <chuansheng.liu@...el.com>
> Date:   Tue Sep 11 16:00:30 2012 +0800
> 
>     USB/host: Cleanup unneccessary irq disable code
> 
>     Because the IRQF_DISABLED as the flag is now a NOOP and has been
>     deprecated and in hardirq context the interrupt is disabled.
> 
>     so in usb/host code:
>     Removing the usage of flag IRQF_DISABLED;
>     Removing the calling local_irq save/restore actions in irq
>     handler usb_hcd_irq();
> 
>     Signed-off-by: liu chuansheng <chuansheng.liu@...el.com>
>     Acked-by: Alan Stern <stern@...land.harvard.edu>
>     Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> 
> 
> But:
> 
> This ony happens with threadirqs option!
> 
> When I remove threadirqs from kernel command line and reboot with this
> last bisect kernel USB sticks work.
> 
> That may explain why nobody else has seen this.
> 
> So I will try a 3.7-rc4 now, but without threadirqs enabled.
> 
Thanks your pointing out, the USB HCD irq handler is designed to execute in irq handler with irq disabled.
When threadirqs is in commandline, it will be executed in thread context with local irq enabling, which causes
this hardlockup.

I prepared one patch, could you have time to test it? Thanks. Sorry for missing threadirqs case.

From: liu chuansheng <chuansheng.liu@...el.com>
Subject: [PATCH] USB/host: Mark USB HCD irq as non-threaded

Mark USB HCD irq as non-threaded. This prevent one crash/hard lockup
when "threadirqs" is on the kernel commandline.
And this interrupt handle is handling critial events which should not
be in thread context.

Signed-off-by: liu chuansheng <chuansheng.liu@...el.com>
---
 drivers/usb/core/hcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 1e741bc..b1cd46e 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2349,7 +2349,7 @@ static int usb_hcd_request_irqs(struct usb_hcd *hcd,
        if (hcd->driver->irq) {
                snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d",
                                hcd->driver->description, hcd->self.busnum);
-               retval = request_irq(irqnum, &usb_hcd_irq, irqflags,
+               retval = request_irq(irqnum, &usb_hcd_irq, irqflags|IRQF_NO_THREAD,
                                hcd->irq_descr, hcd);
                if (retval != 0) {
                        dev_err(hcd->self.controller,
-- 
1.7.0.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ