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]
Message-ID: <4867A2DE.3070509@nokia.com>
Date:	Sun, 29 Jun 2008 17:57:34 +0300
From:	Stefan Becker <Stefan.Becker@...ia.com>
To:	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
CC:	ext David Brownell <david-b@...bell.net>,
	ext Alan Stern <stern@...land.harvard.edu>
Subject: PATCH: 2.6.26-rc8: Fix IRQF_DISABLED for shared interrupts

Hi David,

[I'm not subscribed to the list. So please CC: me in your reply]

ext David Brownell wrote:
> On Saturday 28 June 2008, Becker Stefan (Nokia-D/Salo) wrote:
>>  11:         36    XT-PIC-XT        yenta, ehci_hcd:usb1, uhci_hcd:usb3
> 
> Do things improve if you "rmmod yenta" or, better yet, never
> load that module?

I was starting to wonder about that too after I had sent the message and 
it led me straight to the root cause. This also explains why I was 
unable to reproduce the problem with defconfig: yenta_socket is not 
included in the default configuration.


The problem is caused by this code in handle_IRQ_event():

	if (!(action->flags & IRQF_DISABLED))
		local_irq_enable_in_hardirq();

	do {
		ret = action->handler(irq, action->dev_id);
         ...
		action = action->next;
	} while (action);

For shared interrupts IRQF_DISABLED will only take effect if the first 
registered handler sets it.


The attached changes fix the problem for me. Feel free to update them if 
they are not up to usual Linux kernel quality standards. I also attached 
the new config I used for testing: defconfig + the minimum additional 
stuff to enable the problem.

There are of course two other options to fix the problem:

  - add IRQF_DISBALED to yenta_socket. But this will fix it only for 
this case...

  - enable/disable interrupts depending on actions IRQF_DISABLED in the 
loop in handle_IRQ_event(). But that would mean more CPU cycles are 
spent in that function...

Regards,

	Stefan

---
Stefan Becker
E-Mail: Stefan.Becker@...ia.com


View attachment "shared-irqf-disabled-fix.patch" of type "text/plain" (1953 bytes)

View attachment ".config" of type "text/plain" (44409 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ