Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933798AbdIXUp2 (ORCPT ); Sun, 24 Sep 2017 16:45:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33084 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933753AbdIXUop (ORCPT ); Sun, 24 Sep 2017 16:44:45 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , Boris Ostrovsky , Juergen Gross , Tony Luck , Chen Yu , Marc Zyngier , Alok Kataria , Joerg Roedel , "Rafael J. Wysocki" , Steven Rostedt , Christoph Hellwig , Peter Zijlstra , Borislav Petkov , Paolo Bonzini , Rui Zhang , "K. Y. Srinivasan" , Arjan van de Ven , Dan Williams , Len Brown Subject: [PATCH 4.13 109/109] genirq: Fix cpumask check in __irq_startup_managed() Date: Sun, 24 Sep 2017 22:34:10 +0200 Message-Id: <20170924203357.473839564@linuxfoundation.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170924203353.104695385@linuxfoundation.org> References: <20170924203353.104695385@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1784 Lines: 50 4.13-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Gleixner commit 9cb067ef8a10bb13112e4d1c0ea996ec96527422 upstream. The result of cpumask_any_and() is invalid when result greater or equal nr_cpu_ids. The current check is checking for greater only. Fix it. Fixes: 761ea388e8c4 ("genirq: Handle managed irqs gracefully in irq_startup()") Signed-off-by: Thomas Gleixner Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Tony Luck Cc: Chen Yu Cc: Marc Zyngier Cc: Alok Kataria Cc: Joerg Roedel Cc: "Rafael J. Wysocki" Cc: Steven Rostedt Cc: Christoph Hellwig Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Paolo Bonzini Cc: Rui Zhang Cc: "K. Y. Srinivasan" Cc: Arjan van de Ven Cc: Dan Williams Cc: Len Brown Link: http://lkml.kernel.org/r/20170913213152.272283444@linutronix.de Signed-off-by: Greg Kroah-Hartman --- kernel/irq/chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -202,7 +202,7 @@ __irq_startup_managed(struct irq_desc *d irqd_clr_managed_shutdown(d); - if (cpumask_any_and(aff, cpu_online_mask) > nr_cpu_ids) { + if (cpumask_any_and(aff, cpu_online_mask) >= nr_cpu_ids) { /* * Catch code which fiddles with enable_irq() on a managed * and potentially shutdown IRQ. Chained interrupt