[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <175261351809.1924612.2322752513285300165.b4-ty@google.com>
Date: Tue, 15 Jul 2025 16:24:21 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Sean Christopherson <seanjc@...gle.com>, Paolo Bonzini <pbonzini@...hat.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Rick Edgecombe <rick.p.edgecombe@...el.com>, Xiaoyao Li <xiaoyao.li@...el.com>
Subject: Re: [PATCH] KVM: VMX: Ensure unused kvm_tdx_capabilities fields are
zeroed out
On Mon, 14 Jul 2025 15:19:28 -0700, Sean Christopherson wrote:
> Zero-allocate the kernel's kvm_tdx_capabilities structure and copy only
> the number of CPUID entries from the userspace structure. As is, KVM
> doesn't ensure kernel_tdvmcallinfo_1_{r11,r12} and user_tdvmcallinfo_1_r12
> are zeroed, i.e. KVM will reflect whatever happens to be in the userspace
> structure back at usersepace, and thus may report garbage to userspace.
>
> Zeroing the entire kernel structure also provides better semantics for the
> reserved field. E.g. if KVM extends kvm_tdx_capabilities to enumerate new
> information by repurposing bytes from the reserved field, userspace would
> be required to zero the new field in order to get useful information back
> (because older KVMs without support for the repurposed field would report
> garbage, a la the aforementioned tdvmcallinfo bugs).
>
> [...]
Applied to kvm-x86 fixes, (with the typo fixed), thanks!
[1/1] KVM: VMX: Ensure unused kvm_tdx_capabilities fields are zeroed out
https://github.com/kvm-x86/linux/commit/b8be70ec2b47
--
https://github.com/kvm-x86/linux/tree/next
Powered by blists - more mailing lists