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: <20090213033803.GA13631@cmpxchg.org>
Date:	Fri, 13 Feb 2009 04:38:04 +0100
From:	Johannes Weiner <hannes@...xchg.org>
To:	Jeremy Fitzhardinge <jeremy@...p.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Yinghai Lu <yinghai@...nel.org>, Ingo Molnar <mingo@...e.hu>,
	the arch/x86 maintainers <x86@...nel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Can request_irq be called under spinlock?

On Thu, Feb 12, 2009 at 03:35:25PM -0800, Jeremy Fitzhardinge wrote:
> Thomas Gleixner wrote:
> >I dont think that proc_mkdir conventions have changed
> >recently. According to git blame fs/proc/generic.c:
> >
> >^1da177e (Linus Torvalds     2005-04-16 15:20:36 -0700 580)     ent = 
> >kmalloc(sizeof(struct proc_dir_entry) + len + 1, GFP_KERNEL);
> >
> >  
> 
> I think its new that request_irq ends up calling proc_mkdir though.  But 
> its moot now anyway; I cleaned up that code, and don't call request_irq 
> under spinlock any more.

Still, the attached could be of use, no?

	Hannes

---
From: Johannes Weiner <hannes@...xchg.org>
Subject: irq: use GFP_KERNEL for action allocation in request_irq()

request_irq() calls into proc code via __setup_irq() which is not safe
in an atomic context, so request_irq() can itself use the more
reliable GFP_KERNEL allocation for the action descriptor.

Signed-off-by: Johannes Weiner <hannes@...xchg.org>
---

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 291f036..0f2b3b6 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -709,7 +709,7 @@ int request_irq(unsigned int irq, irq_handler_t handler,
 	if (!handler)
 		return -EINVAL;
 
-	action = kmalloc(sizeof(struct irqaction), GFP_ATOMIC);
+	action = kmalloc(sizeof(struct irqaction), GFP_KERNEL);
 	if (!action)
 		return -ENOMEM;
 
--
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