KVM: Destroy I/O bus devices on unregister failure _after_ sync'ing SRCU
mainline inclusion from mainline-v5.13-rc1 commit 2ee37574 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I94VO4 CVE: CVE-2021-47061 -------------------------------- 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: f6588660 ("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> Conflicts: virt/kvm/kvm_main.c Signed-off-by:
Liu Shixin <liushixin2@huawei.com>
Loading
Please sign in to comment