Skip to content

Commit

Permalink
KVM: x86: Zero the IOAPIC scan request dest vCPUs bitmap
Browse files Browse the repository at this point in the history
Not zeroing the bitmap used for identifying the destination vCPUs for an
IOAPIC scan request in fixed delivery mode could lead to waking up unwanted
vCPUs. This patch zeroes the vCPU bitmap before passing it to
kvm_bitmap_or_dest_vcpus(), which is responsible for setting the bitmap
with the bits corresponding to the destination vCPUs.

Fixes: 7ee30bc("KVM: x86: deliver KVM IOAPIC scan request to target vCPUs")
Signed-off-by: Nitesh Narayan Lal <nitesh@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Nitesh Narayan Lal authored and Paolo Bonzini committed Nov 20, 2019
1 parent fe289eb commit 9a2ae9f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kvm/ioapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
irq.delivery_mode = e->fields.delivery_mode << 8;
irq.dest_id = e->fields.dest_id;
irq.dest_mode = e->fields.dest_mode;
bitmap_zero(&vcpu_bitmap, 16);
kvm_bitmap_or_dest_vcpus(ioapic->kvm, &irq,
&vcpu_bitmap);
if (old_dest_mode != e->fields.dest_mode ||
Expand Down

0 comments on commit 9a2ae9f

Please sign in to comment.