public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] KVM: Reject vCPU IDs above 2^32
@ 2024-06-12 21:54 Mathias Krause
  2024-06-12 21:54 ` [PATCH v2 1/4] KVM: Reject overly excessive IDs in KVM_CREATE_VCPU Mathias Krause
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Mathias Krause @ 2024-06-12 21:54 UTC (permalink / raw)
  To: Paolo Bonzini, Sean Christopherson; +Cc: kvm, Mathias Krause

vCPU IDs above 2^32 are currently not rejected as invalid for
KVM_CREATE_VCPU and KVM_SET_BOOT_CPU_ID.

Below patches fix this and add selftests for it.

Please apply!

Thanks,
Mathias

v1: https://lore.kernel.org/kvm/20240605220504.2941958-1-minipli@grsecurity.net/

changes v1->v2:
- add comment and build bug to make truncation check more obvious (Sean)
- handle KVM_SET_BOOT_CPU_ID similar

Mathias Krause (4):
  KVM: Reject overly excessive IDs in KVM_CREATE_VCPU
  KVM: selftests: Test vCPU IDs above 2^32
  KVM: Limit check IDs for KVM_SET_BOOT_CPU_ID
  KVM: selftests: Test vCPU boot IDs above 2^32

 arch/x86/kvm/x86.c                                   | 12 +++++++++---
 .../selftests/kvm/x86_64/max_vcpuid_cap_test.c       | 11 ++++++++++-
 tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c | 11 +++++++++++
 virt/kvm/kvm_main.c                                  | 10 +++++++++-
 4 files changed, 39 insertions(+), 5 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-06-17  7:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-12 21:54 [PATCH v2 0/4] KVM: Reject vCPU IDs above 2^32 Mathias Krause
2024-06-12 21:54 ` [PATCH v2 1/4] KVM: Reject overly excessive IDs in KVM_CREATE_VCPU Mathias Krause
2024-06-12 21:54 ` [PATCH v2 2/4] KVM: selftests: Test vCPU IDs above 2^32 Mathias Krause
2024-06-12 21:54 ` [PATCH v2 3/4] KVM: Limit check IDs for KVM_SET_BOOT_CPU_ID Mathias Krause
2024-06-14 16:35   ` Sean Christopherson
2024-06-14 18:53     ` Mathias Krause
2024-06-14 20:36       ` Sean Christopherson
2024-06-17  7:16         ` Mathias Krause
2024-06-12 21:54 ` [PATCH v2 4/4] KVM: selftests: Test vCPU boot IDs above 2^32 Mathias Krause

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox