Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp610735lqh; Fri, 31 May 2024 10:40:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJoVm2pmt+t+axicKBZ4ojNU9pMvZpgTlXthg4EqSdOc1hIDd4KYne4sFuRnT662Cb5uBEIHMEvjD4/flSdWz8TT+uYIk8y71huoe1Bg== X-Google-Smtp-Source: AGHT+IEz5imG/vmdd+nhpXIBUXeMnRvyNoWk+yzeBJwVP5aWfLuvSou5A5++UjnrM52l06x1zMfn X-Received: by 2002:a05:6358:281a:b0:199:2930:282d with SMTP id e5c5f4694b2df-19b48c2367fmr325334855d.10.1717177208557; Fri, 31 May 2024 10:40:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717177208; cv=pass; d=google.com; s=arc-20160816; b=X/CIildCgk4vIVYkzHhD/f2VTeA9ada0BL2Ew+i8ynPmnesX6NjmWZAOS9x+Y7Awz9 WX7n4gJlUliSvE3s8Rnrawa3R03J1ERZ/FdXviJB4N77geF+Fwr0hAgfCvm4Gc3ODl25 lSaQ28gdjUEo36Yb4LAxAcOK4pLwoH9525pUsxpUTwFUD1yXmGc62/rSAl0QwyE45WPx j0tPbZoqSqdQNIP24VMpsBwn7hWHFXYy/Qyi8wpP+DRrg+1J43c4TRVIP0KGY7QrunEn GretO6/KEZRPawV5tSqyo9Y8qvEd85Lye9X0WAHSbr7sKtLJSwO6CmMeuw2WF5MBWmpp bohg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature; bh=4WbysrEqbtA8inzrLnnlOBbILXK+m2FniqilvyaF4a0=; fh=eUtub4aW+WnY0zIyeoyheCkSVn1SmaqZK10rDN1mXaE=; b=oNYzYogp0Wq8C0tJAZ3peCNy2AG0lPtYujL8XGmiPm745ZpeTfBkObZnop4ADpr2tC cfYh8CWs+eVLIqUdPxb67l8y83y7rg0YKd/RX3I1y3pKj3STQGnqQ8lCRLbIBdTtqeKl MmPfdew1iosnN+8VAHIT0rv004CCxZvoKjCam1OM4btbTWqgSqdX7RxDHEjeHfnAISfV G3grOxKC5WIIkpgcVYhZTrS9c6wqPAiwgJtrWkinO+BEPFAhG+gfCrVWb5YjEEiFvlNg R/2go6axLqZPivUzPJm0A1Slydf+NHAGzClcADRoEIR6TZ0PrNA1ngkfv9qZ6fvC9i/s WIbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ns3nX2Fh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197257-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197257-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c359e098f7si1943690a12.337.2024.05.31.10.40.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 10:40:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197257-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ns3nX2Fh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197257-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197257-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2CEE528A486 for ; Fri, 31 May 2024 17:40:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A27D717C7D3; Fri, 31 May 2024 17:39:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ns3nX2Fh" 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 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.