Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp501040lqh; Fri, 31 May 2024 07:52:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWKlq/Fj5D6HIFz6mn02vFz9DIKSVEV4+29+v3DxeZBphOq/nqzjJTD9nory00enAs0Ln076v2N/qOjTH2PbOB+vxSxBPUC+tTXevYDTg== X-Google-Smtp-Source: AGHT+IGUDWXc/NRrpCZUHtp/L81GUDu28vfrAnxYrSvSSbdxENGD7tUbKVFrSmPcxhf2+yocmtzm X-Received: by 2002:a05:6214:3993:b0:6ab:891c:54e9 with SMTP id 6a1803df08f44-6aecd6b82c4mr24181166d6.35.1717167121198; Fri, 31 May 2024 07:52:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717167121; cv=pass; d=google.com; s=arc-20160816; b=spBJSAcBnpdz1bHNOw20d60YmMVLGy2Gz0aZpN4Y+SX+q/2UxhwFosNa8Zr5po9blO y6oKLPMxw8IIKhlH19JG/0haC5qDlyUlPPmxdMgRDL3i9D594Gqg/zDWUpS/aD9zaGUA KN7GTDy0NyEL6pDtSC0SkoX1sPQsOUozQadeXgg9oxR5Aktb4AKbg5pCnb/ffxwZCpJ4 p3zv+L302jgNhDM8szyQO821/u8sIstuRHEBMDSoZbB37Jb/P1q76cMy9RaCg5JxxJsj rr8tr0QY37RSbsbZKkGjtNb6+vqw7MYlZ1R/H0vPmiQZ6Gzg/I/Q698eHhs8SXIfB4LA 2s6Q== 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=Y8x73qIgdLci58WRr9f6FABqTKNJ8Z4NcjdGnePrSew=; fh=FvhpCs/nHCB0otwJzO9l5cg9boflTeXFrwMtnj4L3Ds=; b=lDr0Nuzs+hCt1o9L0rY6mnMr+RQrpvTcVAtxyWEYvYoNbE0tiwukga9GkpNgPAf6Yy EacXR6J9P43sgC0JGMKlVlJ5ZvTgbn5UwtKeOXQh/zawZWM1tI2cqS+bjHNG1E4+rjxA cfKDWIj6cjb/NKnEGba9I+z/aXS7voRdEVNwD29txCN7+EcnugMCwugssd3ZehLKbBlL /uaxljWkyVvH8XJgIkt2Tde7ImfBUl8ALCE4nsp+1mVjlYmavJvmaMXruWNYFKzKLUd9 yk0PKCDk0v5uIDa0vykeSG8g2HnrhMy3S9hny9mXJHL13/+q3MNcWT3OHEk3vjMk5mLN Q9YQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u3snAWLM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197009-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b4021a3si9184646d6.224.2024.05.31.07.52.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 07:52:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u3snAWLM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197009-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E55491C24F5C for ; Fri, 31 May 2024 14:52:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C877F6F2EB; Fri, 31 May 2024 14:51:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="u3snAWLM" 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 F2A6C626CB for ; Fri, 31 May 2024 14:51:08 +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=1717167069; cv=none; b=go0TrF9KTJTgrr5WdRwUG+lwToMYSsRG3VFVkHhbuzYPNoixlYT5yrjqOth9Cnjxl10KHkAUv3QaIughU3fY7LkQHsRcO7fGWQQw2O+z/CL3PjEvhoN/oKGro0W/B7lEvxdPfNU/prhrQV2RLVhmT462Wj8XXxf/1arqFf0X3f0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717167069; c=relaxed/simple; bh=XC0q3HDRsTlNoIOVTsv7KQOjdOjpX3wJ1Wj3Dpm8C60=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=BlttSxenc4ThhMqXu960tLO3ixL1baVBEYrYgv5AXQJ62c04RvcAmF3N1rqVTIstCMZxV8df9fO/UJWWEPDjzCTAgfRo2hrCWMMWrzBxnMwy0SepxP7YkD3IB3F5FQidfxfyralmEnvrJ4JhQ1JwJwFJut7JHdRs76hgMZCJh0U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=u3snAWLM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CACBC116B1; Fri, 31 May 2024 14:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717167068; bh=XC0q3HDRsTlNoIOVTsv7KQOjdOjpX3wJ1Wj3Dpm8C60=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=u3snAWLM/K3i6FMWIBGOa9/Za2TrX+LSkngvaqPXauIn0evKkD1t2DpMzdUT0Qotg GScW1yX0WVF9TYEsfdCprDaakPkxjCzvIO6Lw0gNqZwzdzXAs/jWa8RgjgVcN+SjOC 2VHlHsW/2sC3jRMsAY6BT/wPb/dheXJ2dtsGadnrvojwv6RqG0SMyr+LSTjs5rM8RJ C5plfF25M2SkBs2rZGT1SQ22WB7JsH/W/f8VOGlIXltNa/cwWG4ynpjVCp2fCLmLgB Psw654qOjPMPQmckO595qQczm+ib1He80q02gJcNSnYok70tsGyhmPCpNkY0dQEf01 Pb8KImAeKD+Tw== 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 1sD3b0-00HCvH-Ft; Fri, 31 May 2024 15:51:06 +0100 Date: Fri, 31 May 2024 15:51:06 +0100 Message-ID: <86r0dikpb9.wl-maz@kernel.org> From: Marc Zyngier To: Hagar Hemdan 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() In-Reply-To: <20240531140336.GA4911@amazon.com> References: <20240531074302.30563-1-hagarhem@amazon.com> <86ttiel4bb.wl-maz@kernel.org> <20240531095318.GA5556@amazon.com> <87mso62rz0.wl-maz@kernel.org> <20240531140336.GA4911@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, mheyne@amazon.de, nmanthey@amazon.de, tglx@linutronix.de, eric.auger@redhat.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, hagarhem@amazon.de 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 15:03:36 +0100, Hagar Hemdan wrote: > > On Fri, May 31, 2024 at 11:30:59AM +0100, Marc Zyngier wrote: > > On Fri, 31 May 2024 10:53:18 +0100, > > Hagar Hemdan wrote: > > > > > > 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! > > > > Sorry, but I'm not bound by this requirement. I'm happy to credit > > *you* for reporting a defect, but certainly not a tool that hasn't > > "resolved" anything, despite what the message says. > > Ok, I will drop the resolved part as the modified fix is suggested by > you. Is it ok? Yes, this seems fair to me. Thanks again, M. -- Without deviation from the norm, progress is not possible.