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-next>] [day] [month] [year] [list]
Message-ID: <600D5CB4DFD93545BF61FF01473D11AC124E5D34@limkexm2.ad.analog.com>
Date:	Fri, 15 Feb 2008 14:10:18 -0000
From:	"Hennerich, Michael" <Michael.Hennerich@...log.com>
To:	<linux-kernel@...r.kernel.org>
Subject: linux/kernel/irq/chip.c IRQ disable, shutdown bug

free_irq() does not disable/mask the irq, in case disable or shutdown in struct irq_chip is left uninitilazied.

/**
 * struct irq_chip - hardware interrupt chip descriptor
 *
 * @name:		name for /proc/interrupts
 * @startup:		start up the interrupt (defaults to ->enable if NULL)
 * @shutdown:		shut down the interrupt (defaults to ->disable if NULL)
 * @enable:		enable the interrupt (defaults to chip->unmask if NULL)
 * @disable:		disable the interrupt (defaults to chip->mask if NULL)


According to linux/irq.h struct irq_chip information,
chip->disable should default to chip->mask if NULL.
However irq_chip_set_defaults(struct irq_chip *chip) will set it to default_disable a empty function.


Looking through various architectures, it's pretty common that disable and shutdown is NULL.
So this bug affects many architectures.

This patch fixes the issue.

Best regards,
Michael

Index: irq/chip.c
===================================================================
--- irq/chip.c  (revision 4276)
+++ irq/chip.c  (working copy)
@@ -233,6 +233,10 @@
  */
 static void default_disable(unsigned int irq)
 {
+       struct irq_desc *desc = irq_desc + irq;
+
+       desc->chip->mask(irq);
+       desc->status |= IRQ_MASKED;
 }

 /*


------------------------------------------------------------------
********* Analog Devices GmbH         michael.hennerich@...log.com
**  *****                                      Systems Engineering
**     ** Wilhelm-Wagenfeld-Strasse 6       
**  ***** D-80807 Munich                      
********* Germany                          
Registergericht München HRB 40368,  Geschäftsführer:  Thomas Wessel,  Vincent Roche,  Joseph E. McDonough
--
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