]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Fix buggy-but-benign check in test_v3_new_redist_regions()
authorSean Christopherson <seanjc@google.com>
Wed, 23 Feb 2022 22:52:12 +0000 (14:52 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 11 Jun 2022 14:14:35 +0000 (10:14 -0400)
commit377fe0373ed90c00bf576c6edd84b4716a064e7d
tree812980f51253202c83398a325b3041868c8558c6
parent5b833642476ddb1d71ef43d272aeacc58bf38bb1
KVM: selftests: Fix buggy-but-benign check in test_v3_new_redist_regions()

Update 'ret' with the return value of _kvm_device_access() prior to
asserting that ret is non-zero.  In the current code base, the flaw is
benign as 'ret' is guaranteed to be -EBUSY from the previous run_vcpu(),
which also means that errno==EBUSY prior to _kvm_device_access(), thus
the "errno == EFAULT" part of the assert means that a false negative is
impossible (unless the kernel is being truly mean and spuriously setting
errno=EFAULT while returning success).

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/aarch64/vgic_init.c