From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796411937; b=pZbzUqNRk7AbJOU3n8zU2wRjUSfautYMwAGMYBBkE3v/zTAaYj2eF4laGFuOTvO3pow2 HfLytxDjyGdZM2H3mrN2kuQ6dgdZ3GZmKvHMU1nG/j58/0AUpO0ijvQinNAO9f3LBWjgN bC7n0gobmy0s44QHXVjPfFhixCqrZjfrPS/ncC+V+n1kzayqtGrMkL065+2hfuxBLG38n jsSgy0joauQQUxd4u+YE71owbNRKdQwAkRjVyuiBL8bgocm05l+lYUdF+FGd3T/WSObkz Jq9Ar43v4yReowa0Lx8AmvbEP646tOo18SAUVbtQS0HUbEIyRZMCmoBKX1+IS5ZGZvA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796411937; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=qKcrf4tULTAREsyggkb5V2HmeX1iXFpSHvRc70LHL5w=; b=PpNCwbfXzBL5t0/yY0bynrJcXE8KOjmsJZxtbMNiuk4EZp8U2xoQilMqpPuHy9Z3dR32 CXFMfp0X+OqpjEtBJ8IqcY6cNjxTc5bsFPo/RrwRdqfIJWAWlg74RHJJPMS3k2tcGCq67 m+2HGUImSvuHRVui95C4XZ9Q1qRlJa7W04FdpeE99oqi6Pcj8BGLIFE5HJMYCutsGvc/i B5BCQR5dv8kb+hTPPAxxM0tyEGE4F0kLZJ4A2RC35xAHmwRRVAhziN0ziKS9UNXTcTtSl 3gvOVuuxHiPbTWHSU8pwa1CZh1WVWvCjqC6+MXuKzKdRCizhHjgnfgeKwmNnR3tqXtg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=d4RPpXTN; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D034606A322 for ; Fri, 4 Dec 2026 19:18:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=d4RPpXTN Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0FC11F00A06; Fri, 4 Dec 2026 19:18:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796411936; bh=qKcrf4tULTAREsyggkb5V2HmeX1iXFpSHvRc70LHL5w=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=d4RPpXTNUKxdH1T/PkV1OXdJbDOV6da4wUAjWtDWMfann5aprONjgomKSfZgyxqlX 1uT6GLoJfMXvCPl7cPg45KPI5UQXDxQU8DlVwRMdkrNAOTiO9/AZVXvA+lbQ0tASR4 2NkEDL8ZOSrM1lgtmYGf49Ru/GFuEy0YgoWmPvrlxRqm3RP1hIgePqxIoxqO/rMFte fBlqs8Altcm3Mq+Y9gmXGIEuD1U1LkD1IRsDVHADHH7eyfsQllLMkfmFJblU1vtPrc 4yDQ7DajA2T+OoOcjWoV3/s0vG+eWRDEHPet96PCnt4pJBV+fpRCfbZiBykqRu359K ry47gF3Eb2tSw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 6.1.y 24/24] KVM: VMX: Ensure pCPU is valid before sending IPI to deliver posted IRQ Reply-To: sashiko-reviews@lists.linux.dev To: "Paolo Bonzini" , kvm@vger.kernel.org In-Reply-To: <20261204180423.2168641-25-pbonzini@redhat.com> References: <20261204180423.2168641-1-pbonzini@redhat.com> <20261204180423.2168641-25-pbonzini@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 19:18:56 +0000 X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] KVM: VMX: missing pCPU validity check in kvm_vcpu_trigger_posted_interrupt() -- commit 3b3c27514b94a3a527d60347b3acb2bdda3a5b8b Author: Sean Christopherson KVM: VMX: Ensure pCPU is valid before sending IPI to deliver posted IRQ This backport wraps the vcpu->cpu read in kvm_vcpu_trigger_posted_interrupt= () with READ_ONCE() and the vcpu->cpu write in kvm_arch_vcpu_load() with WRITE_ONCE(). Link: https://patch.msgid.link/20261119173451.67434-1-seanjc@google.com > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > index 28e0198c20246..516c4e083c50c 100644 > --- a/arch/x86/kvm/vmx/vmx.c > +++ b/arch/x86/kvm/vmx/vmx.c > @@ -4139,9 +4139,10 @@ static inline void kvm_vcpu_trigger_posted_interru= pt(struct kvm_vcpu *vcpu, > * not wait for any requested interrupts in PIR, and sending a > * notification event also results in a benign, spurious event. > */ > + int cpu =3D READ_ONCE(vcpu->cpu); > =20 > if (vcpu !=3D kvm_get_running_vcpu()) > - apic->send_IPI_mask(get_cpu_mask(vcpu->cpu), pi_vec); > + apic->send_IPI_mask(get_cpu_mask(cpu), pi_vec); > return; > } > #endif [Severity: High] Did this backport drop the target pCPU validity check on cpu? kvm_vcpu_trigger_posted_interrupt() snapshots vcpu->cpu with READ_ONCE(), but passes cpu straight to get_cpu_mask() without checking that it is valid (such as cpu >=3D 0 or cpu !=3D -1). When vcpu->cpu is -1 on trees with vCPU dissociation such as TDX, get_cpu_mask() converts -1 to an unsigned int and returns an out-of-bounds cpumask pointer, causing an out-of-bounds read and page fault in apic->send_IPI_mask(). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204180423.2168= 641-1-pbonzini@redhat.com?part=3D24