From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752865AbcAPVSL (ORCPT ); Sat, 16 Jan 2016 16:18:11 -0500 Received: from terminus.zytor.com ([198.137.202.10]:56546 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752808AbcAPVRk (ORCPT ); Sat, 16 Jan 2016 16:17:40 -0500 Date: Sat, 16 Jan 2016 13:16:35 -0800 From: tip-bot for Thomas Gleixner Message-ID: Cc: jmmahler@gmail.com, joe.lawrence@stratus.com, tglx@linutronix.de, jiang.liu@linux.intel.com, linux-kernel@vger.kernel.org, linux@roeck-us.net, bp@alien8.de, mingo@kernel.org, hpa@zytor.com Reply-To: hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, bp@alien8.de, linux@roeck-us.net, jiang.liu@linux.intel.com, tglx@linutronix.de, jmmahler@gmail.com, joe.lawrence@stratus.com In-Reply-To: <20151231160106.236423282@linutronix.de> References: <20151231160106.236423282@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/irq: Validate that irq descriptor is still active Git-Commit-ID: 36f34c8c63da3e272fd66f91089228c22d2b6e8b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 36f34c8c63da3e272fd66f91089228c22d2b6e8b Gitweb: http://git.kernel.org/tip/36f34c8c63da3e272fd66f91089228c22d2b6e8b Author: Thomas Gleixner AuthorDate: Thu, 31 Dec 2015 16:30:45 +0000 Committer: Thomas Gleixner 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 Cc: Jiang Liu Cc: Joe Lawrence Cc: Jeremiah Mahler Cc: Borislav Petkov Cc: andy.shevchenko@gmail.com Cc: Guenter Roeck Cc: stable@vger.kernel.org #4.3+ Link: http://lkml.kernel.org/r/20151231160106.236423282@linutronix.de Signed-off-by: Thomas Gleixner --- 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);