Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932414AbbBFM2I (ORCPT ); Fri, 6 Feb 2015 07:28:08 -0500 Received: from 8bytes.org ([81.169.241.247]:45981 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932354AbbBFM2E (ORCPT ); Fri, 6 Feb 2015 07:28:04 -0500 Date: Fri, 6 Feb 2015 13:28:02 +0100 From: Joerg Roedel To: Jiang Liu Cc: Joerg Roedel , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Prarit Bhargava , Yinghai Lu , x86@kernel.org, linux-kernel@vger.kernel.org, alnovak@suse.com Subject: Re: [PATCH] x86: irq: Check for valid irq descriptor in check_irq_vectors_for_cpu_disable Message-ID: <20150206122802.GT3702@8bytes.org> References: <20150204132754.GA10078@suse.de> <54D304DE.90506@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54D304DE.90506@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 983 Lines: 30 Hi Jiang, On Thu, Feb 05, 2015 at 01:51:26PM +0800, Jiang Liu wrote: > Reviewed-by: Jiang Liu Thanks for your review. > Actually there's another racing pattern. > for (irq = 0; irq < nr_irqs; irq++) { > desc = irq_to_desc(irq); > access desc->xxx > } > > When sparsing IRQ is enabled, there's no mechanism to protect > desc returned by irq_to_desc(). Once I have considered a brute > solution of disabling freeing of irq_desc:( Hmm, how about wrapping the places that use irq_desc in rcu_read_lock() and do a synchronize_rcu() before we free it (at least in the SPARSE_IRQ case)? It wouldn't be a real RCU data structure, but we make at least sure that we don't free an irq_desc thats in use. Joerg -- 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/