]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Initializing all kvm_lapic_irq fields in ioapic_write_indirect
authorNitesh Narayan Lal <nitesh@redhat.com>
Fri, 13 Mar 2020 13:16:24 +0000 (09:16 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 14 Mar 2020 09:46:01 +0000 (10:46 +0100)
commit9d5b06151d0c8e6455f48a3ccc9eb8da90fb4af7
tree7a75e7ca42aebf30f85a19b33355daec2301c2a6
parentbe0db52e6edfc4db9c4bb5bd3252c9aea09c1d1d
KVM: x86: Initializing all kvm_lapic_irq fields in ioapic_write_indirect

Previously all fields of structure kvm_lapic_irq were not initialized
before it was passed to kvm_bitmap_or_dest_vcpus(). Which will cause
an issue when any of those fields are used for processing a request.
For example not initializing the msi_redir_hint field before passing
to the kvm_bitmap_or_dest_vcpus(), may lead to a misbehavior of
kvm_apic_map_get_dest_lapic(). This will specifically happen when the
kvm_lowest_prio_delivery() returns TRUE due to a non-zero garbage
value of msi_redir_hint, which should not happen as the request belongs
to APIC fixed delivery mode and we do not want to deliver the
interrupt only to the lowest priority candidate.

This patch initializes all the fields of kvm_lapic_irq based on the
values of ioapic redirect_entry object before passing it on to
kvm_bitmap_or_dest_vcpus().

Fixes: 8b921683d239 ("KVM: x86: deliver KVM IOAPIC scan request to target vCPUs")
Signed-off-by: Nitesh Narayan Lal <nitesh@redhat.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
[Set level to false since the value doesn't really matter. Suggested
 by Vitaly Kuznetsov. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/ioapic.c