From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751485AbdGRPp0 (ORCPT ); Tue, 18 Jul 2017 11:45:26 -0400 Received: from terminus.zytor.com ([65.50.211.136]:53183 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbdGRPpY (ORCPT ); Tue, 18 Jul 2017 11:45:24 -0400 Date: Tue, 18 Jul 2017 08:43:17 -0700 From: tip-bot for Seunghun Han Message-ID: Cc: mingo@kernel.org, kkamagui@gmail.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com Reply-To: mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, kkamagui@gmail.com In-Reply-To: <1500369644-45767-1-git-send-email-kkamagui@gmail.com> References: <1500369644-45767-1-git-send-email-kkamagui@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/ioapic: Pass the correct data to unmask_ioapic_irq() Git-Commit-ID: afabde6986911394c95c596f96d2ac833eef04cc 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: afabde6986911394c95c596f96d2ac833eef04cc Gitweb: http://git.kernel.org/tip/afabde6986911394c95c596f96d2ac833eef04cc Author: Seunghun Han AuthorDate: Tue, 18 Jul 2017 18:20:44 +0900 Committer: Thomas Gleixner CommitDate: Tue, 18 Jul 2017 17:39:54 +0200 x86/ioapic: Pass the correct data to unmask_ioapic_irq() One of the rarely executed code pathes in check_timer() calls unmask_ioapic_irq() passing irq_get_chip_data(0) as argument. That's wrong as unmask_ioapic_irq() expects a pointer to the irq data of interrupt 0. irq_get_chip_data(0) returns NULL, so the following dereference in unmask_ioapic_irq() causes a kernel panic. The issue went unnoticed in the first place because irq_get_chip_data() returns a void pointer so the compiler cannot do a type check on the argument. The code path was added for machines with broken configuration, but it seems that those machines are either not running current kernels or simply do not longer exist. Hand in irq_get_irq_data(0) as argument which provides the correct data. [ tglx: Rewrote changelog ] Fixes: 4467715a44cc ("x86/irq: Move irq_cfg.irq_2_pin into io_apic.c") Signed-off-by: Seunghun Han Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/1500369644-45767-1-git-send-email-kkamagui@gmail.com --- arch/x86/kernel/apic/io_apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index b4f5f73..237e9c2 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -2093,7 +2093,7 @@ static inline void __init check_timer(void) int idx; idx = find_irq_entry(apic1, pin1, mp_INT); if (idx != -1 && irq_trigger(idx)) - unmask_ioapic_irq(irq_get_chip_data(0)); + unmask_ioapic_irq(irq_get_irq_data(0)); } irq_domain_deactivate_irq(irq_data); irq_domain_activate_irq(irq_data);