Re: [PATCH] KVM: x86: Allocate/free user_return_msrs at kvm.ko (un)loading time
From: Sean Christopherson
Date: Fri Nov 21 2025 - 13:56:07 EST
On Fri, 07 Nov 2025 17:36:01 -0800, Sean Christopherson wrote:
> Move user_return_msrs allocation/free from vendor modules (kvm-intel.ko and
> kvm-amd.ko) (un)loading time to kvm.ko's to make it less risky to access
> user_return_msrs in kvm.ko. Tying the lifetime of user_return_msrs to
> vendor modules makes every access to user_return_msrs prone to
> use-after-free issues as vendor modules may be unloaded at any time.
>
> Opportunistically turn the per-CPU variable into full structs, as there's
> no practical difference between statically allocating the memory and
> allocating it unconditionally during module_init().
>
> [...]
Applied to kvm-x86 misc, thanks!
[1/1] KVM: x86: Allocate/free user_return_msrs at kvm.ko (un)loading time
https://github.com/kvm-x86/linux/commit/11d984633f7f
--
https://github.com/kvm-x86/linux/tree/next