]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: selftests: Test max vCPU IDs corner cases
authorMathias Krause <minipli@grsecurity.net>
Fri, 14 Jun 2024 20:28:58 +0000 (22:28 +0200)
committerSean Christopherson <seanjc@google.com>
Tue, 18 Jun 2024 16:03:52 +0000 (09:03 -0700)
commit4b451a57809cacec00978c36c97b1c9b53cde664
tree1213f81f9cbd09c6446f60c5011d175746089118
parentd29bf2ca140410705447ac26100a149b51094c00
KVM: selftests: Test max vCPU IDs corner cases

The KVM_CREATE_VCPU ioctl ABI had an implicit integer truncation bug,
allowing 2^32 aliases for a vCPU ID by setting the upper 32 bits of a 64
bit ioctl() argument.

It also allowed excluding a once set boot CPU ID.

Verify this no longer works and gets rejected with an error.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Link: https://lore.kernel.org/r/20240614202859.3597745-5-minipli@grsecurity.net
[sean: tweak assert message+comment for 63:32!=0 testcase]
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86_64/max_vcpuid_cap_test.c