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 3D9052BB17 for ; Sun, 3 May 2026 12:15:46 +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=1777810547; cv=none; b=NNqR1EB6hTc0+zgVNISrAwA2dQfVT/jgvpNLtqS/t2L7b2h/FXyCbJUF9GL0LxD8Vp2Qcpy2L4jL2K6ISDu1+j6+2+FEDNNmz1fKlIs4pa8CncLIQsbJGkfEeSVlqyaZjTbo6DsyLJRWrnHVfuqQgqhJAXuWhgcIkKLSSs/IsMI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777810547; c=relaxed/simple; bh=lRmPm726OgOk1W+RIVQ5TzLmAYG8Sdb2OddZtoINiG4=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=hnEvCZ2/VxPHbuRZCyaioGJIVj1eFW81dzRl2vP4QOpR83dmUzErGqZ7Qm91WZiT/7ytoUNEkMQa/4Rs3V6mrb6c4a8WPA6Nf1xN8ARQP+s3ugmsvGr2tVDeHQs/0/ZP/7nBc9DUAzsQTc4f0j66FBVj0P8MGZDFKswML4AmUyU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bFJa0B9Z; 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="bFJa0B9Z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EB6DC2BCB4; Sun, 3 May 2026 12:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777810546; bh=lRmPm726OgOk1W+RIVQ5TzLmAYG8Sdb2OddZtoINiG4=; h=Subject:To:Cc:From:Date:From; b=bFJa0B9Z+I8TNU6q/gvI6KG730AAfhsdMNrXjrJlxI0UYzO/wsav0JGv39wLfcBUa lUIi4h4EnLaPJriJu1lU6VwegFitth6PsF+ZEvNLYSZZY9iKY2MLaKqiySTaH9VopN NO3LKjqV6aDtzTmeXHewZ1mhKOWhFgRwVkL5Dgro= Subject: FAILED: patch "[PATCH] KVM: nSVM: Always inject a #GP if mapping VMCB12 fails on" failed to apply to 5.10-stable tree To: yosry@kernel.org,seanjc@google.com Cc: From: Date: Sun, 03 May 2026 14:15:44 +0200 Message-ID: <2026050344-cabdriver-landmark-9233@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=ANSI_X3.4-1968 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 01ddcdc55e097ca38c28ae656711b8e6d1df71f8 # git commit -s git send-email --to '' --in-reply-to '2026050344-cabdriver-landmark-9233@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 01ddcdc55e097ca38c28ae656711b8e6d1df71f8 Mon Sep 17 00:00:00 2001 From: Yosry Ahmed Date: Tue, 3 Mar 2026 00:33:59 +0000 Subject: [PATCH] KVM: nSVM: Always inject a #GP if mapping VMCB12 fails on nested VMRUN nested_svm_vmrun() currently only injects a #GP if kvm_vcpu_map() fails with -EINVAL. But it could also fail with -EFAULT if creating a host mapping failed. Inject a #GP in all cases, no reason to treat failure modes differently. Fixes: 8c5fbf1a7231 ("KVM/nSVM: Use the new mapping API for mapping guest memory") CC: stable@vger.kernel.org Co-developed-by: Sean Christopherson Signed-off-by: Yosry Ahmed Link: https://patch.msgid.link/20260303003421.2185681-6-yosry@kernel.org Signed-off-by: Sean Christopherson diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index 2b1066ce23f5..7a472d7c6e98 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -1010,12 +1010,9 @@ int nested_svm_vmrun(struct kvm_vcpu *vcpu) } vmcb12_gpa = svm->vmcb->save.rax; - ret = kvm_vcpu_map(vcpu, gpa_to_gfn(vmcb12_gpa), &map); - if (ret == -EINVAL) { + if (kvm_vcpu_map(vcpu, gpa_to_gfn(vmcb12_gpa), &map)) { kvm_inject_gp(vcpu, 0); return 1; - } else if (ret) { - return kvm_skip_emulated_instruction(vcpu); } ret = kvm_skip_emulated_instruction(vcpu);