Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1311029

[tip:x86/urgent] x86/irq: Validate that irq descriptor is still active

From tip-bot for Thomas Gleixner <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:x86/urgent] x86/irq: Validate that irq descriptor is still active
Date 2016-01-16 22:20 +0100
Message-ID <qRGql-1tO-1@gated-at.bofh.it> (permalink)
References <qLOqD-6NB-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Commit-ID:  36f34c8c63da3e272fd66f91089228c22d2b6e8b
Gitweb:     http://git.kernel.org/tip/36f34c8c63da3e272fd66f91089228c22d2b6e8b
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Thu, 31 Dec 2015 16:30:45 +0000
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 15 Jan 2016 13:43:59 +0100

x86/irq: Validate that irq descriptor is still active

In fixup_irqs() we unconditionally dereference the irq chip of an irq
descriptor. The descriptor might still be valid, but already cleaned up,
i.e. the chip removed. Add a check for this condition.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Joe Lawrence <joe.lawrence@stratus.com>
Cc: Jeremiah Mahler <jmmahler@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: andy.shevchenko@gmail.com
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org #4.3+
Link: http://lkml.kernel.org/r/20151231160106.236423282@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/irq.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index f8062aa..c0b58dd 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -470,6 +470,15 @@ void fixup_irqs(void)
 		}
 
 		chip = irq_data_get_irq_chip(data);
+		/*
+		 * The interrupt descriptor might have been cleaned up
+		 * already, but it is not yet removed from the radix tree
+		 */
+		if (!chip) {
+			raw_spin_unlock(&desc->lock);
+			continue;
+		}
+
 		if (!irqd_can_move_in_process_context(data) && chip->irq_mask)
 			chip->irq_mask(data);
 

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[tip:x86/urgent] x86/irq:   Validate that irq descriptor is still active tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-01-16 22:20 +0100

csiph-web