Repository navigation
Commit 4e899ca
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 e5c8eea commit 4e899ca
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4487 | 4487 | | |
4488 | 4488 | | |
4489 | 4489 | | |
4490 | | - | |
| 4490 | + | |
| 4491 | + | |
| 4492 | + | |
| 4493 | + | |
| 4494 | + | |
| 4495 | + | |
| 4496 | + | |
4491 | 4497 | | |
4492 | 4498 | | |
4493 | 4499 | | |
| |||
4496 | 4502 | | |
4497 | 4503 | | |
4498 | 4504 | | |
4499 | | - | |
4500 | | - | |
4501 | 4505 | | |
4502 | 4506 | | |
4503 | 4507 | | |
| |||
0 commit comments