linux-yocto/tools/testing/selftests/kvm/x86_64
Sean Christopherson 773cca1834 KVM: selftests: Fix out-of-bounds reads in CPUID test's array lookups
When looking for a "mangled", i.e. dynamic, CPUID entry, terminate the
walk based on the number of array _entries_, not the size in bytes of
the array.  Iterating based on the total size of the array can result in
false passes, e.g. if the random data beyond the array happens to match
a CPUID entry's function and index.

Fixes: fb18d053b7 ("selftest: kvm: x86: test KVM_GET_CPUID2 and guest visible CPUIDs against KVM_GET_SUPPORTED_CPUID")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-ID: <20241003234337.273364-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-10-20 12:10:44 -04:00
..
amx_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
apic_bus_clock_test.c KVM: selftests: Add test for configure of x86 APIC bus frequency 2024-06-28 15:21:43 -07:00
cpuid_test.c KVM: selftests: Fix out-of-bounds reads in CPUID test's array lookups 2024-10-20 12:10:44 -04:00
cr4_cpuid_sync_test.c KVM: selftests: Make vCPU exit reason test assertion common 2023-03-14 10:20:09 -04:00
debug_regs.c KVM: selftests: Verify single-stepping a fastpath VM-Exit exits to userspace 2024-09-09 20:12:12 -07:00
dirty_log_page_splitting_test.c Revert "kvm: selftests: move base kvm_util.h declarations to kvm_util_base.h" 2024-04-29 12:54:13 -07:00
exit_on_emulation_failure_test.c Revert "kvm: selftests: move base kvm_util.h declarations to kvm_util_base.h" 2024-04-29 12:54:13 -07:00
fix_hypercall_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
flds_emulation.h KVM: selftests: x86_64: Remove redundant newlines 2024-01-30 12:31:56 -08:00
get_msr_index_features.c KVM: selftests: Add TEST_REQUIRE macros to reduce skipping copy+paste 2022-06-11 11:47:29 -04:00
hwcr_msr_test.c KVM: selftests: Define _GNU_SOURCE for all selftests code 2024-04-29 12:49:10 -07:00
hyperv_clock.c KVM: selftests: Make hyperv_clock require TSC based system clocksource 2024-02-01 08:58:15 -08:00
hyperv_cpuid.c KVM: selftests: Define _GNU_SOURCE for all selftests code 2024-04-29 12:49:10 -07:00
hyperv_evmcs.c KVM: selftests: Re-enable hyperv_evmcs/hyperv_svm_test on bare metal 2024-08-22 12:14:42 -07:00
hyperv_extended_hypercalls.c KVM: selftests: Make Hyper-V tests explicitly require KVM Hyper-V support 2023-12-07 09:34:36 -08:00
hyperv_features.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
hyperv_ipi.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
hyperv_svm_test.c KVM: selftests: Re-enable hyperv_evmcs/hyperv_svm_test on bare metal 2024-08-22 12:14:42 -07:00
hyperv_tlb_flush.c KVM: selftests: Define _GNU_SOURCE for all selftests code 2024-04-29 12:49:10 -07:00
kvm_clock_test.c KVM: selftests: Run clocksource dependent tests with hyperv_clocksource_tsc_page too 2024-02-01 08:58:14 -08:00
kvm_pv_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
max_vcpuid_cap_test.c KVM: selftests: Test max vCPU IDs corner cases 2024-06-18 09:03:52 -07:00
monitor_mwait_test.c KVM selftests treewide updates for 6.10: 2024-05-12 03:18:11 -04:00
nested_exceptions_test.c KVM: selftests: Define _GNU_SOURCE for all selftests code 2024-04-29 12:49:10 -07:00
nx_huge_pages_test.c KVM: selftests: Define _GNU_SOURCE for all selftests code 2024-04-29 12:49:10 -07:00
nx_huge_pages_test.sh KVM: selftests: Avoid assuming "sudo" exists in NX hugepage test 2024-04-29 12:22:08 -07:00
platform_info_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
pmu_counters_test.c KVM: selftests: Increase robustness of LLC cache misses in PMU counters test 2024-06-28 08:44:03 -07:00
pmu_event_filter_test.c KVM: selftests: Treat AMD Family 17h+ as supporting branch insns retired 2024-06-10 09:57:21 -07:00
private_mem_conversions_test.c KVM: selftests: Define _GNU_SOURCE for all selftests code 2024-04-29 12:49:10 -07:00
private_mem_kvm_exits_test.c KVM: selftests: Test KVM exit behavior for private memory/access 2023-11-14 08:01:09 -05:00
recalc_apic_map_test.c KVM: selftests: Rename the ASSERT_EQ macro 2023-08-02 14:34:01 -07:00
set_boot_cpu_id.c KVM: selftests: Test vCPU boot IDs above 2^32 and MAX_VCPU_ID 2024-06-18 09:12:08 -07:00
set_sregs_test.c KVM: selftests: Define _GNU_SOURCE for all selftests code 2024-04-29 12:49:10 -07:00
sev_init2_tests.c KVM: selftests: Fix shift of 32 bit unsigned int more than 32 bits 2024-06-05 06:16:09 -07:00
sev_migrate_tests.c KVM selftests changes for 6.9: 2024-03-11 10:20:35 -04:00
sev_smoke_test.c KVM: selftests: Add SEV-ES shutdown test 2024-08-29 19:37:11 -07:00
smaller_maxphyaddr_emulation_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
smm_test.c KVM: selftests: Define _GNU_SOURCE for all selftests code 2024-04-29 12:49:10 -07:00
state_test.c KVM: selftests: Define _GNU_SOURCE for all selftests code 2024-04-29 12:49:10 -07:00
svm_int_ctl_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
svm_nested_shutdown_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
svm_nested_soft_inject_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
svm_vmcall_test.c KVM: selftests: Make vCPU exit reason test assertion common 2023-03-14 10:20:09 -04:00
sync_regs_test.c KVM: selftests: Define _GNU_SOURCE for all selftests code 2024-04-29 12:49:10 -07:00
triple_fault_event_test.c KVM: selftests: Make vCPU exit reason test assertion common 2023-03-14 10:20:09 -04:00
tsc_msrs_test.c KVM: selftests: Rip out old, param-based guest assert macros 2023-08-02 14:43:16 -07:00
tsc_scaling_sync.c KVM: selftests: Remove obsolete and incorrect test case metadata 2023-10-04 12:53:05 -07:00
ucna_injection_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
userspace_io_test.c KVM: selftests: x86_64: Remove redundant newlines 2024-01-30 12:31:56 -08:00
userspace_msr_exit_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
vmx_apic_access_test.c KVM: selftests: x86_64: Remove redundant newlines 2024-01-30 12:31:56 -08:00
vmx_close_while_nested_test.c KVM: selftests: Make vCPU exit reason test assertion common 2023-03-14 10:20:09 -04:00
vmx_dirty_log_test.c KVM selftests treewide updates for 6.10: 2024-05-12 03:18:11 -04:00
vmx_exception_with_invalid_guest_state.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
vmx_invalid_nested_guest_state.c KVM: selftests: Make vCPU exit reason test assertion common 2023-03-14 10:20:09 -04:00
vmx_msrs_test.c KVM: selftests: Verify userspace can stuff IA32_FEATURE_CONTROL at will 2022-11-30 16:29:54 -08:00
vmx_nested_tsc_scaling_test.c KVM: selftests: Run clocksource dependent tests with hyperv_clocksource_tsc_page too 2024-02-01 08:58:14 -08:00
vmx_pmu_caps_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
vmx_preemption_timer_test.c KVM: selftests: Define _GNU_SOURCE for all selftests code 2024-04-29 12:49:10 -07:00
vmx_set_nested_state_test.c KVM: selftests: Fix vmxon_pa == vmcs12_pa == -1ull nVMX testcase for !eVMCS 2023-12-07 09:34:40 -08:00
vmx_tsc_adjust_test.c KVM: selftests: Make vCPU exit reason test assertion common 2023-03-14 10:20:09 -04:00
xapic_ipi_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
xapic_state_test.c KVM: selftests: Play nice with AMD's AVIC errata 2024-08-29 16:25:06 -07:00
xcr0_cpuid_test.c KVM: selftests: Init IDT and exception handlers for all VMs/vCPUs on x86 2024-04-29 12:55:15 -07:00
xen_shinfo_test.c KVM selftests treewide updates for 6.10: 2024-05-12 03:18:11 -04:00
xen_vmcall_test.c KVM: selftests: Move Hyper-V specific functions out of processor.c 2024-08-22 12:14:42 -07:00
xss_msr_test.c KVM: selftests: Define _GNU_SOURCE for all selftests code 2024-04-29 12:49:10 -07:00