Repository navigation
Commit 03c6ccc
KVM: Destroy I/O bus devices on unregister failure _after_ sync'ing SRCU
commit 2ee3757 upstream.
If allocating a new instance of an I/O bus fails when unregistering a
device, wait to destroy the device until after all readers are guaranteed
to see the new null bus. Destroying devices before the bus is nullified
could lead to use-after-free since readers expect the devices on their
reference of the bus to remain valid.
Fixes: f658866 ("KVM: fix memory leak in kvm_io_bus_unregister_dev()")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210412222050.876100-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent ae99682 commit 03c6ccc
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4367 | 4367 | | |
4368 | 4368 | | |
4369 | 4369 | | |
4370 | | - | |
| 4370 | + | |
| 4371 | + | |
| 4372 | + | |
| 4373 | + | |
| 4374 | + | |
| 4375 | + | |
| 4376 | + | |
4371 | 4377 | | |
4372 | 4378 | | |
4373 | 4379 | | |
| |||
4376 | 4382 | | |
4377 | 4383 | | |
4378 | 4384 | | |
4379 | | - | |
4380 | | - | |
4381 | 4385 | | |
4382 | 4386 | | |
4383 | 4387 | | |
| |||
0 commit comments