diff options
| author | Thorsten Blum <thorsten.blum@linux.dev> | 2025-10-17 23:39:14 +0200 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2025-11-13 08:29:59 -0800 |
| commit | 11b79f8318aefc7ddfd12668fd1d80bde1c9f7bc (patch) | |
| tree | f4d625b59d372206fb30d78a2dbbdaee4867e038 /virt/kvm/kvm_main.c | |
| parent | 27376465e945c11ad13c1e1d877ed318be010062 (diff) | |
KVM: TDX: Check size of user's kvm_tdx_capabilities array before allocating
When userspace is getting TDX capabilities, retrieve and check the number
of user entries before allocating kernel scratch space to avoid having to
unwind the allocation if get_user() fails or if 'user_caps' is too small
to fit 'caps'.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Tested-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Link: https://patch.msgid.link/20251017213914.167301-1-thorsten.blum@linux.dev
[sean: split to separate patch]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
0 files changed, 0 insertions, 0 deletions