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 9CF7526CE11 for ; Sun, 3 May 2026 12:19:30 +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=1777810770; cv=none; b=eo9XRFmJeEG9gMftDA+jD59fbV0r+t4PI5vLv6SQ9XFn6wILps9SGFkP+5dxxhq3+YwB+wmkB3JDJvSeiJaC7a/KH9hGJFhUb6mVzvCk5KieEfoCzJVVyhF9DNRfLsGO6jI0eDWubDQey8n3EEwGbgw8eVO/dSBVhoZpiR0Yc8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777810770; c=relaxed/simple; bh=B2ksSriFN12NlY3IWmYMiHd7ubYM100mj39d/HbJpOk=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=qjmv7yaVnWs7bd9dNvMZz6YG759Wz6YLE72mMqHhJMGzx+QeD3eUVDC4rZgxi3dSdPCkP02VjCmFaqTrBgR9jv6UffVl4qiX3ROy/AnEInJBXAd4evyx7m5n52Uwnf2qSm1A1IL2GyavcHck2MkegArZeMwdcCq/swiIMAuwZwI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=a8NZwU1a; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="a8NZwU1a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35BFDC2BCB4; Sun, 3 May 2026 12:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777810770; bh=B2ksSriFN12NlY3IWmYMiHd7ubYM100mj39d/HbJpOk=; h=Subject:To:Cc:From:Date:From; b=a8NZwU1aFT2ApIxI7tqCm2EMtPxjqyTvqzllp/8y2YMjW9Di35dpWjNzhz2uCIg3e zzIM9gQhY0w1AkZMagQBu06RYYJttSBoQ3OuuSRK7FQvTv5Od9skCzYC09HXVyB1oY kyERdQVDJRirfi5/oONCVXM0/UEH06j60e/CmDqA= Subject: FAILED: patch "[PATCH] KVM: nSVM: Add missing consistency check for nCR3 validity" failed to apply to 5.10-stable tree To: yosry@kernel.org,seanjc@google.com Cc: From: Date: Sun, 03 May 2026 14:19:28 +0200 Message-ID: <2026050328-conduit-posing-1921@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x b71138fcc362c67ebe66747bb22cb4e6b4d6a651 # git commit -s git send-email --to '' --in-reply-to '2026050328-conduit-posing-1921@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From b71138fcc362c67ebe66747bb22cb4e6b4d6a651 Mon Sep 17 00:00:00 2001 From: Yosry Ahmed Date: Tue, 3 Mar 2026 00:34:09 +0000 Subject: [PATCH] KVM: nSVM: Add missing consistency check for nCR3 validity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit >From the APM Volume #2, 15.25.4 (24593—Rev. 3.42—March 2024): When VMRUN is executed with nested paging enabled (NP_ENABLE = 1), the following conditions are considered illegal state combinations, in addition to those mentioned in “Canonicalization and Consistency Checks”: • Any MBZ bit of nCR3 is set. • Any G_PAT.PA field has an unsupported type encoding or any reserved field in G_PAT has a nonzero value. Add the consistency check for nCR3 being a legal GPA with no MBZ bits set. Note, the G_PAT.PA check is being handled separately[*]. Link: https://lore.kernel.org/kvm/20260205214326.1029278-3-jmattson@google.com [*] Fixes: 4b16184c1cca ("KVM: SVM: Initialize Nested Nested MMU context on VMRUN") Cc: stable@vger.kernel.org Signed-off-by: Yosry Ahmed Link: https://patch.msgid.link/20260303003421.2185681-16-yosry@kernel.org [sean: capture everything in CC(), massage changelog formatting] Signed-off-by: Sean Christopherson diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index 2ed6530e7bd1..a59b976c16db 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -348,6 +348,10 @@ static bool nested_vmcb_check_controls(struct kvm_vcpu *vcpu, if (CC(control->asid == 0)) return false; + if (CC((control->nested_ctl & SVM_NESTED_CTL_NP_ENABLE) && + !kvm_vcpu_is_legal_gpa(vcpu, control->nested_cr3))) + return false; + if (CC(!nested_svm_check_bitmap_pa(vcpu, control->msrpm_base_pa, MSRPM_SIZE))) return false;