From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C84D517C7A4 for ; Fri, 31 May 2024 17:39:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717177193; cv=none; b=YYAesiPZ9Pj5PV+nAA6ldgCseWRz4TRSJTIdyCHdotxyytbI71SWjzJhi7NJBxgKvP9xsyC+l17Lhykoidmds7X79b9QVceKe2y4FGhmWjPyj3UxjI6kAA+AkLLtkdmq3mlWsunWqpp2Z7mrfNXcRWknsJKNWnjP/qLq0UHXGTU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717177193; c=relaxed/simple; bh=cZJF8ii52Njx7s3iD7VgOhl5swlGZNT+OtQREUqdecw=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=oPsfqLeHG54aFXtqbNBYEuhUPi4FrZr4gakoDBINs6q8iiVKTytiQc2qPxr0tBNojawsqGZLOJhcmhruvZF9lTohh/i9WvHtpgylikHEHmptNFX2ZFJ1cBz388Jye2Yjj0zr6SaNAofktDQXr8lt/+TLyCOc06fs8U+awcIbV80= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ns3nX2Fh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ns3nX2Fh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37BE9C116B1; Fri, 31 May 2024 17:39:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717177193; bh=cZJF8ii52Njx7s3iD7VgOhl5swlGZNT+OtQREUqdecw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ns3nX2FheFu7lyt7/SCH6BKkxuyW2XfMZ/KsLHlg78phMLxnlJCQ+/1QsfYiLAHcu V8y6ZXLLF+8HfgzvusFjD8EAULW2jot+RNlCNNApj3yQvj8A0DGi6/Sm5E56RMj75e aXqYEKKg/cYx3oWBikfVDndHkbb2XbvjoEaiRaZCoXEDRKa/ZO3PvQsHrdouwIPJGG KU3WXNTcq1i/Kd+LxQcgHOqOUI2sN34okQRMIH093KLw+aGBLVsOIDxMncATJNGcVM FWQxFyGxYGq0OtipTvS8aHoWt1p0CJmjO8NC0FCyuNtwlxzYB1rJ9iTlOx6Er6+3x7 iLOd8Kbb8a+Hg== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sD6EJ-00HFcY-1E; Fri, 31 May 2024 18:39:51 +0100 Date: Fri, 31 May 2024 18:39:50 +0100 Message-ID: <86plt1lw2h.wl-maz@kernel.org> From: Marc Zyngier To: Hagar Hemdan , Thomas Gleixner Cc: Maximilian Heyne , Norbert Manthey , Eric Auger , , Subject: Re: [PATCH v4] irqchip/gic-v3-its: Fix potential race condition in its_vlpi_prop_update() In-Reply-To: <20240531162144.28650-1-hagarhem@amazon.com> References: <20240531162144.28650-1-hagarhem@amazon.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: hagarhem@amazon.com, tglx@linutronix.de, mheyne@amazon.de, nmanthey@amazon.de, eric.auger@redhat.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Fri, 31 May 2024 17:21:44 +0100, Hagar Hemdan wrote: > > its_vlpi_prop_update() calls lpi_write_config() which obtains the > mapping information for a VLPI without lock held. So it could race > with its_vlpi_unmap(). > Since all calls from its_irq_set_vcpu_affinity() require the same > lock to be held. So instead of peppering the locking all over the > place, we hoist the locking into its_irq_set_vcpu_affinity(). This looks odd. Maybe something along the lines of: "Since all calls from its_irq_set_vcpu_affinity() require the same lock to be held, hoist the locking there instead of peppering it over the place." > > This bug was discovered using Coverity Static Analysis > Security Testing (SAST) by Synopsys, Inc. > > Fixes: 015ec0386ab6 ("irqchip/gic-v3-its: Add VLPI configuration handling") > Suggested-by: Marc Zyngier > Signed-off-by: Hagar Hemdan With the above addressed, Reviewed-by: Marc Zyngier Cc: stable@vger.kernel.org Thomas, can you please queue it at your earliest convenience? Thanks, M. -- Without deviation from the norm, progress is not possible.