Skip to content

Commit 9a2ae9f

Browse files
Nitesh Narayan Lalbonzini
authored andcommitted
KVM: x86: Zero the IOAPIC scan request dest vCPUs bitmap
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 <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent fe289eb commit 9a2ae9f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/x86/kvm/ioapic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
332332
irq.delivery_mode = e->fields.delivery_mode << 8;
333333
irq.dest_id = e->fields.dest_id;
334334
irq.dest_mode = e->fields.dest_mode;
335+
bitmap_zero(&vcpu_bitmap, 16);
335336
kvm_bitmap_or_dest_vcpus(ioapic->kvm, &irq,
336337
&vcpu_bitmap);
337338
if (old_dest_mode != e->fields.dest_mode ||

0 commit comments

Comments
 (0)