Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753988AbbK0I0W (ORCPT ); Fri, 27 Nov 2015 03:26:22 -0500 Received: from www.linutronix.de ([62.245.132.108]:41736 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753932AbbK0I0U (ORCPT ); Fri, 27 Nov 2015 03:26:20 -0500 Date: Fri, 27 Nov 2015 09:25:31 +0100 (CET) From: Thomas Gleixner To: Jiang Liu cc: Joe Lawrence , LKML , x86@kernel.org Subject: Re: irq_desc use-after-free in smp_irq_move_cleanup_interrupt In-Reply-To: <56580F12.8070607@linux.intel.com> Message-ID: References: <5653B688.4050809@stratus.com> <56580F12.8070607@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: 1448 Lines: 41 On Fri, 27 Nov 2015, Jiang Liu wrote: Please trim your replies. > On 2015/11/26 5:12, Thomas Gleixner wrote: > > Looks a bit overkill with the extra cpumask. I tried a simple counter > > but that does not work versus cpu unplug as we do not know whether the > > outgoing cpu is involved in the cleanup or not. And if the cpu is > > involved we starve assign_irq_vector() .... > > > > The upside of this is that we get rid of that atomic allocation in > > __send_cleanup_vector(). > > Maybe more headache for you now:) > It seems there are still rooms for improvements. First it > seems we could just reuse old_domain instead of adding cleanup_mask. I really like to get rid of that atomic allocation in __send_cleanup_vector() > Second I found another race window among x86_vector_free_irqs(), > __send_cleanup_vector() and smp_irq_move_cleanup_interrupt(). What's the race there? > I'm trying to refine your patch based following rules: > 1) move_in_progress controls whether we need to send IPIs > 2) old_domain controls which CPUs we should do clean up > 3) assign_irq_vector checks both move_in_progress and old_domain. > Will send out the patch soon for comments:) Sure. 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/