History

KVM: Fix buffer overflow in kvm_set_irq()

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.

Avi Kivity committed 14 years ago

Commit f2ebd421 parent 99becf11 file · +1 −0Browse files

Unified · Split

virt/kvm/irq_comm.c+1−0
@@ -332,6 +332,7 @@ static int setup_routing_entry(struct kvm_irq_routing_table *rt, · 331 unmodified lines
332 */332 */
333 hlist_for_each_entry(ei, n, &rt->map[ue->gsi], link)333 hlist_for_each_entry(ei, n, &rt->map[ue->gsi], link)
334 if (ei->type == KVM_IRQ_ROUTING_MSI ||334 if (ei->type == KVM_IRQ_ROUTING_MSI ||
335 ue->type == KVM_IRQ_ROUTING_MSI ||
335 ue->u.irqchip.irqchip == ei->irqchip.irqchip)336 ue->u.irqchip.irqchip == ei->irqchip.irqchip)
336 return r;337 return r;
337 338

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t