]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: SEV: Check PSC request indices against the actual size of the buffer
authorSean Christopherson <seanjc@google.com>
Fri, 1 May 2026 20:22:34 +0000 (13:22 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 29 May 2026 18:25:29 +0000 (20:25 +0200)
commit121d88de56bc5c0ba0ce2f6381af67f948a7e7c1
tree25ff94ee98035b3e1859307c7e24e8ff3ad18933
parentebe4b2dc9cfbfb2d8f665667c4d08f4c6c9bec05
KVM: SEV: Check PSC request indices against the actual size of the buffer

When processing Page State Change (PSC) requests, validate the PSC buffer
against the effective size of the scratch area, which could be less than
the maximum size if the guest provided a pointer that isn't exactly at the
start of the GHCB shared buffer.

Fixes: 9b54e248d264 ("KVM: SEV: Add support to handle Page State Change VMGEXIT")
Cc: stable@vger.kernel.org
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20260501202250.2115252-10-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c