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-next>] [day] [month] [year] [list]
Date:	Fri, 13 Jun 2014 09:36:43 -0700
From:	Florian Fainelli <f.fainelli@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	tglx@...utronix.de, jason@...edaemon.net,
	computersforpeace@...il.com,
	Florian Fainelli <f.fainelli@...il.com>
Subject: [PATCH] genirq: warn on inconstent flags and flow handler

It is currently possible for a generic irq chip driver to set IRQ_LEVEL
and have its irq flow handler be handle_edge_irq. Setting IRQ_LEVEL in
such a case does not make sense, and will actually prevent e.g: the
software resend logic from kicking, and potential other problems too.

Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
---
Thomas,

This is the change I mentioned to you on the #mipslinux IRC channel,
let me know if you feel like this should be somewhere else, AFAICT
this should not slow things down.

Thanks!

 kernel/irq/chip.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index a2b28a2fd7b1..939ae1283ec9 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -749,8 +749,13 @@ void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set)
 		irqd_set(&desc->irq_data, IRQD_PER_CPU);
 	if (irq_settings_can_move_pcntxt(desc))
 		irqd_set(&desc->irq_data, IRQD_MOVE_PCNTXT);
-	if (irq_settings_is_level(desc))
+	if (irq_settings_is_level(desc)) {
+		/* Setting IRQD_LEVEL does not make sense on non-level
+		 * sensitive interrupts
+		 */
+		WARN_ON(desc->handle_irq != handle_level_irq);
 		irqd_set(&desc->irq_data, IRQD_LEVEL);
+	}
 
 	irqd_set(&desc->irq_data, irq_settings_get_trigger_mask(desc));
 
-- 
1.9.1

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