Re: [PATCH] KVM: selftests: Fix ndata size check in test_mmio_during_vectoring

From: Sean Christopherson

Date: Fri Nov 13 2026 - 14:42:01 EST


On Fri, 09 Oct 2026 11:30:17 +0000, Priyanka Mani wrote:
> test_mmio_during_vectoring() verifies that KVM reports the faulting GPA in
> run->internal.data[3] when an emulated MMIO access occurs during event
> vectoring. kvm_prepare_event_vectoring_exit() always fills five entries
> (info2, reason, info1, gpa, last_vmentry_cpu), i.e. internal.ndata is 5.
>
> The test, however, checks "ndata != 4" before dereferencing data[3]. That
> predicate does not actually validate the array size: it passes for ndata ==
> 3, where data[3] is out of bounds yet is read just below, and it spuriously
> fails if ndata were ever exactly 4. It only happens to work today because
> KVM returns 5.
>
> [...]

Applied to kvm-x86 selftests, thanks!

[1/1] KVM: selftests: Fix ndata size check in test_mmio_during_vectoring
https://github.com/kvm-x86/linux/commit/509f344f9480

--
https://github.com/kvm-x86/linux/tree/next