From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02691C25B75 for ; Fri, 31 May 2024 09:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BsEXKCXXMlNelGtnOcFHJ1h+TZeAc3TkIgXXKx/QcMA=; b=yCgFTIbUUXvlU9 QQmbEcsBR6BK0iEUrEqdixEJD5fU/fdSCCzeBBVe2XB9C+3y9ycyG7FMfGPhOYoswxYdLSdZJyuLr tOOyaPP2uzte/coN+yYQVWjBXsuwcJ5SvTQ9j7R47AcxyyH269H3HcgbJMaXWooQr7FvEIjBL/IR3 oBFMtrdR5bSWZDP3vGMZh4OXlGwl3DHWnIGuQyemWIP30llPqTsb3jHrOnW4nE7G0vXYPpkeNF6dG rNxVsUWDwD1Syo8+auQ7ciZVGomqlj3GzJkIUiCAslLQ7SXd0l2RFqzxkfICBpxcpfc75KIejH/15 woJjX0dQigUJsTSVAHew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCywy-00000009rW4-3G7J; Fri, 31 May 2024 09:53:28 +0000 Received: from smtp-fw-52004.amazon.com ([52.119.213.154]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCywu-00000009rVX-3q0h for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 09:53:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1717149204; x=1748685204; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=SvV+wfdiyed0NjS6BbmnQhnYNOMz/ot76ixvTxO5D5Y=; b=tjnR60bWtQyJbyzjX6fGtgd6ISg2jCpt9TgpY5CaB47Sfz1qfgzzz8UR FuNgsO30UsA2fa8vx2zwIjEPEaWPObNLo3Gkne7Kz1nudfqa2m9PXLPxz Hl+RlU0j2bEAysVgBW05b6PI5WCI1pH22A1el+Q79zI8u0wGzEcHu1t68 w=; X-IronPort-AV: E=Sophos;i="6.08,203,1712620800"; d="scan'208";a="208745106" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev) ([10.43.8.2]) by smtp-border-fw-52004.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 09:53:20 +0000 Received: from EX19MTAEUB001.ant.amazon.com [10.0.43.254:64404] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.22.198:2525] with esmtp (Farcaster) id 7e16ca48-ed3d-44b8-8e25-f136d3b9f137; Fri, 31 May 2024 09:53:19 +0000 (UTC) X-Farcaster-Flow-ID: 7e16ca48-ed3d-44b8-8e25-f136d3b9f137 Received: from EX19D008EUA001.ant.amazon.com (10.252.50.34) by EX19MTAEUB001.ant.amazon.com (10.252.51.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Fri, 31 May 2024 09:53:19 +0000 Received: from EX19MTAUEC001.ant.amazon.com (10.252.135.222) by EX19D008EUA001.ant.amazon.com (10.252.50.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Fri, 31 May 2024 09:53:19 +0000 Received: from dev-dsk-hagarhem-1b-b868d8d5.eu-west-1.amazon.com (10.253.65.58) by mail-relay.amazon.com (10.252.135.200) with Microsoft SMTP Server id 15.2.1258.28 via Frontend Transport; Fri, 31 May 2024 09:53:19 +0000 Received: by dev-dsk-hagarhem-1b-b868d8d5.eu-west-1.amazon.com (Postfix, from userid 23002382) id B859620BED; Fri, 31 May 2024 09:53:18 +0000 (UTC) Date: Fri, 31 May 2024 09:53:18 +0000 From: Hagar Hemdan To: Marc Zyngier CC: Maximilian Heyne , Norbert Manthey , Thomas Gleixner , Eric Auger , , , Subject: Re: [PATCH v2] irqchip/gic-v3-its: Fix potential race condition in its_vlpi_prop_update() Message-ID: <20240531095318.GA5556@amazon.com> References: <20240531074302.30563-1-hagarhem@amazon.com> <86ttiel4bb.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <86ttiel4bb.wl-maz@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240531_025325_146696_2751DE04 X-CRM114-Status: GOOD ( 21.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 31, 2024 at 10:27:04AM +0100, Marc Zyngier wrote: > On Fri, 31 May 2024 08:43:02 +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 bug was discovered and resolved using Coverity Static Analysis > > Security Testing (SAST) by Synopsys, Inc. > > > > Fixes: 015ec0386ab6 ("irqchip/gic-v3-its: Add VLPI configuration handling") > > Signed-off-by: Hagar Hemdan > > Given that you have lifted both my proposed patch and part of my > reply as a commit message, you may at least credit me with a > Suggested-by: tag. Not to mention that the blatant advertising doesn't > really apply in this case. ok, I will add this tag in rev3 and we need to add that disclaimer as it is a commercial tool. thanks! > > > --- > > v2: moved the lock to its_irq_set_vcpu_affinity(). > > Only compile-tested, no access to HW. > > Was the initial patch tested at all? No, the initial one was only compile tested, forgot to add that hint in the first patch. > > M. > > -- > Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel