Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 8386D3FE658 for ; Thu, 4 Jun 2026 08:43:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780562582; cv=none; b=M67TgdLjHoLwfWYlD/hOPr+agN0t36hKUhT2+zchNaCrVmaoz8b7vFw/+nxrmYi50D4jTCBOQPwgU3IsQtDRr/Cjm2iyMCzGMTtlVCnWCEdrfHZ3pOhn2KJHzMvQm3CdkXngJrCctjpqPMkufWcSCfWuprk/t52KifgJRzJSVg8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780562582; c=relaxed/simple; bh=wT3AHZWvdkYiOT23sfV93tvIASmriBfBOaFMFfxcSgA=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=qqeX5ucqMln+IzOBsz6m6BWupyvua9kjvWXN9TjneG30kPQx8aekRLivtQNnOrlcN0Dv7P2Vc53uPQGr0BFoBzfy8T6XZWEvsF+XQy0SiFv24Vs/MOc/XimOgYNEg2ZRLvSQmzO0AYa1hiU3CaeGyPPP5ObcWcUxbFWrvzLwWgw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Fkzj8HEj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Fkzj8HEj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EF251F00898; Thu, 4 Jun 2026 08:43:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780562581; bh=LBk3jSj78zltJ/NW/Uaw8BznJHMNGYpYDUYEVqh62Uw=; h=Subject:To:Cc:From:Date; b=Fkzj8HEjQM1vkumr8I9VfCqU3Lhd6UXuARo830VdiXpWD8O16zIHgEpE7Kx98QMAj wIXt7k5xz5gj9JS9jZfidyHh8uUJgE3gFeFqUmtnFJzttPyMPqFLnMBaLTAxMROp7q ZwOGSvs7+znZET3K14Myw7dZQDT6V5BEdAbhaTbM= Subject: FAILED: patch "[PATCH] KVM: SEV: Reject MMIO requests larger than 8 bytes with GHCB" failed to apply to 6.18-stable tree To: seanjc@google.com,pbonzini@redhat.com,thomas.lendacky@amd.com Cc: From: Date: Thu, 04 Jun 2026 10:41:58 +0200 Message-ID: <2026060458-canister-unclamped-cff8@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 6.18-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-6.18.y git checkout FETCH_HEAD git cherry-pick -x dcf1b2d4b0564a27e4ca7c654871aab4f9620046 # git commit -s git send-email --to '' --in-reply-to '2026060458-canister-unclamped-cff8@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From dcf1b2d4b0564a27e4ca7c654871aab4f9620046 Mon Sep 17 00:00:00 2001 From: Sean Christopherson Date: Fri, 1 May 2026 13:22:28 -0700 Subject: [PATCH] KVM: SEV: Reject MMIO requests larger than 8 bytes with GHCB v2+ When using GHCB v2+, reject MMIO requests that are larger than 8 bytes. Per the GHCB spec: SW_EXITINFO2 must be less than or equal to 0x7fffffff for version 1 and less than or equal to 0x8 for all other versions. Fixes: 4af663c2f64a ("KVM: SEV: Allow per-guest configuration of GHCB protocol version") Cc: stable@vger.kernel.org Reviewed-by: Tom Lendacky Signed-off-by: Sean Christopherson Message-ID: <20260501202250.2115252-4-seanjc@google.com> Signed-off-by: Paolo Bonzini diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index fb2174b6d1ba..e6579ca9f364 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -4502,6 +4502,11 @@ int sev_handle_vmgexit(struct kvm_vcpu *vcpu) if (!len) return 1; + if (to_kvm_sev_info(vcpu->kvm)->ghcb_version >= 2 && len > 8) { + svm_vmgexit_bad_input(svm, GHCB_ERR_INVALID_INPUT); + return 1; + } + ret = setup_vmgexit_scratch(svm, !is_write, len); if (ret) break;