diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-03-18 16:23:47 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-03-20 20:38:52 +0100 |
commit | 3ec5ad40081b14af28496198b4d08dbe13386790 (patch) | |
tree | 316f10a515bdc38709a65fd0b0a08e182abb718c /hw/intc | |
parent | e2fb7d8aa218256793df99571d16f92074258447 (diff) |
target/i386: kvm: do not access uninitialized variable on older kernels
KVM support for AMX includes a new system attribute, KVM_X86_XCOMP_GUEST_SUPP.
Commit 19db68ca68 ("x86: Grant AMX permission for guest", 2022-03-15) however
did not fully consider the behavior on older kernels. First, it warns
too aggressively. Second, it invokes the KVM_GET_DEVICE_ATTR ioctl
unconditionally and then uses the "bitmask" variable, which remains
uninitialized if the ioctl fails. Third, kvm_ioctl returns -errno rather
than -1 on errors.
While at it, explain why the ioctl is needed and KVM_GET_SUPPORTED_CPUID
is not enough.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/intc')
0 files changed, 0 insertions, 0 deletions