Repository navigation
Commit 2ee3757
KVM: Destroy I/O bus devices on unregister failure _after_ sync'ing SRCU
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>1 parent 24e7475 commit 2ee3757
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4646 | 4646 | | |
4647 | 4647 | | |
4648 | 4648 | | |
4649 | | - | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
| 4655 | + | |
4650 | 4656 | | |
4651 | 4657 | | |
4652 | 4658 | | |
| |||
4655 | 4661 | | |
4656 | 4662 | | |
4657 | 4663 | | |
4658 | | - | |
4659 | | - | |
4660 | 4664 | | |
4661 | 4665 | | |
4662 | 4666 | | |
| |||
0 commit comments