Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753296AbbL2NlI (ORCPT ); Tue, 29 Dec 2015 08:41:08 -0500 Received: from www.linutronix.de ([62.245.132.108]:42553 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752656AbbL2NlG (ORCPT ); Tue, 29 Dec 2015 08:41:06 -0500 Date: Tue, 29 Dec 2015 14:39:46 +0100 (CET) From: Thomas Gleixner To: Jiang Liu cc: Joe Lawrence , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Jeremiah Mahler , Borislav Petkov , andy.shevchenko@gmail.com, Guenter Roeck , linux-kernel@vger.kernel.org Subject: Re: [Bugfix v2 3/5] x86/irq: Fix a race window in x86_vector_free_irqs() In-Reply-To: <1450880014-11741-3-git-send-email-jiang.liu@linux.intel.com> Message-ID: References: <1450880014-11741-1-git-send-email-jiang.liu@linux.intel.com> <1450880014-11741-3-git-send-email-jiang.liu@linux.intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1159 Lines: 36 On Wed, 23 Dec 2015, Jiang Liu wrote: > void init_irq_alloc_info(struct irq_alloc_info *info, > @@ -279,18 +272,21 @@ static void x86_vector_free_irqs(struct irq_domain *domain, > unsigned int virq, unsigned int nr_irqs) > { > struct irq_data *irq_data; > + unsigned long flags; > int i; > > for (i = 0; i < nr_irqs; i++) { > irq_data = irq_domain_get_irq_data(x86_vector_domain, virq + i); > if (irq_data && irq_data->chip_data) { > + raw_spin_lock_irqsave(&vector_lock, flags); > clear_irq_vector(virq + i, irq_data->chip_data); > free_apic_chip_data(irq_data->chip_data); > + irq_domain_reset_irq_data(irq_data); > + raw_spin_unlock_irqrestore(&vector_lock, flags); We really do not need to free stuff under the vector lock. lock(); data = irq_data->chip_data; irq_domain_reset_irq_data(irq_data); unlock(); free_apic_chip_data(data); Hmm? Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/