Skip to content

Commit 398cf08

Browse files
avikivityrtg-canonical
authored andcommitted
KVM: Fix buffer overflow in kvm_set_irq()
CVE-2012-2137 BugLink: http://bugs.launchpad.net/bugs/1016298 kvm_set_irq() has an internal buffer of three irq routing entries, allowing connecting a GSI to three IRQ chips or on MSI. However setup_routing_entry() does not properly enforce this, allowing three irqchip routes followed by an MSI route to overflow the buffer. Fix by ensuring that an MSI entry is added to an empty list. Signed-off-by: Avi Kivity <[email protected]> (cherry picked from commit f2ebd422f71cda9c791f76f85d2ca102ae34a1ed) Signed-off-by: Tim Gardner <[email protected]> Acked-by: Stefan Bader <[email protected]>
1 parent c4e5d5a commit 398cf08

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

virt/kvm/irq_comm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ static int setup_routing_entry(struct kvm_irq_routing_table *rt,
300300
*/
301301
hlist_for_each_entry(ei, n, &rt->map[ue->gsi], link)
302302
if (ei->type == KVM_IRQ_ROUTING_MSI ||
303+
ue->type == KVM_IRQ_ROUTING_MSI ||
303304
ue->u.irqchip.irqchip == ei->irqchip.irqchip)
304305
return r;
305306

0 commit comments

Comments
 (0)