]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: fix irqfd assign/deassign race
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 19 Sep 2010 17:02:31 +0000 (19:02 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Thu, 23 Sep 2010 14:31:51 +0000 (11:31 -0300)
commit2f205f94f38976c7bbeb8826b4cf886ee2a1fffc
treeb0196884ead501481a3ae3a27d45b41b43ec117d
parentd12182655fb7ffa56b27611bcae9b9c7f64656c6
KVM: fix irqfd assign/deassign race

I think I see the following (theoretical) race:

During irqfd assign, we drop irqfds lock before we
schedule inject work. Therefore, deassign running
on another CPU could cause shutdown and flush to run
before inject, causing user after free in inject.

A simple fix it to schedule inject under the lock.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Gregory Haskins <ghaskins@novell.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
virt/kvm/eventfd.c