hw/vfio/container: Fix SIGSEV on vfio_container_instance_finalize()
PATCH 1/1 hw/vfio/container: Fix SIGSEV on vfio_container_instance_finalize()
In vfio_connect_container's error path, the base container is removed twice form the VFIOAddressSpace QLIST: first on the listener_release_exit label and second, on free_container_exit label, through object_unref(container), which calls vfio_container_instance_finalize().
Let's remove the first instance.
--- hw/vfio/container.c | 1 - 1 file changed, 1 deletion(-)
hw/vfio/container.c +0 -1
@@ -657,7 +657,6 @@ static bool vfio_connect_container(VFIOGroup *group, AddressSpace *as,return true; listener_release_exit:QLIST_REMOVE (group, container_next); -QLIST_REMOVE (bcontainer, next);vfio_kvm_device_del_group (group);memory_listener_unregister (&bcontainer->listener);if (vioc->release) {
Signature · 1 line
2.41.0
Quoted 10 lines · Eric Auger
In vfio_connect_container's error path, the base container is removed twice form the VFIOAddressSpace QLIST: first on the
listener_release_exitlabel and second, onfree_container_exitlabel, throughobject_unref(container), which callsvfio_container_instance_finalize().Let's remove the first instance.
Fixes 938026053f4 ("vfio/container: Switch to QOM")Signed-off-by Eric Auger <[email protected]>
Oh. Nice catch !
Thanks,
C.
Quoted 16 lines
--- hw/vfio/container.c | 1 - 1 file changed, 1 deletion(-)hw/vfio/container.c +0
-1@@ -657,7 +657,6 @@ static bool vfio_connect_container(VFIOGroup *group, AddressSpace *as,return true; listener_release_exit:QLIST_REMOVE (group, container_next); -QLIST_REMOVE (bcontainer, next);vfio_kvm_device_del_group (group);memory_listener_unregister (&bcontainer->listener);if (vioc->release) {
Quoted 13 lines
-----Original Message-----
From: Eric Auger <[email protected]>
Subject: [PATCH] hw/vfio/container: Fix SIGSEV onvfio_container_instance_finalize()In vfio_connect_container's error path, the base container is removed twice form the VFIOAddressSpace QLIST: first on the
listener_release_exitlabel and second, onfree_container_exitlabel, throughobject_unref(container), which callsvfio_container_instance_finalize().
Quoted 4 lines
Let's remove the first instance.
Fixes 938026053f4 ("vfio/container: Switch to QOM")Signed-off-by Eric Auger <[email protected]>
Thanks
Zhenzhong
Quoted 19 lines
---
hw/vfio/container.c| 1 -1 file changed, 1 deletion(-)hw/vfio/container.c +0
-0@@ -657,7 +657,6 @@ static bool vfio_connect_container(VFIOGroup *group, AddressSpace *as, return true;
listener_release_exit:QLIST_REMOVE(group, container_next); - QLIST_REMOVE(bcontainer, next); vfio_kvm_device_del_group(group); memory_listener_unregister(&bcontainer->listener); if (vioc->release) {--
2.41.0
Cédric Le Goater
AppliedQuoted 19 lines · Eric Auger
In vfio_connect_container's error path, the base container is removed twice form the VFIOAddressSpace QLIST: first on the
listener_release_exitlabel and second, onfree_container_exitlabel, throughobject_unref(container), which callsvfio_container_instance_finalize().Let's remove the first instance.
Fixes 938026053f4 ("vfio/container: Switch to QOM")Signed-off-by Eric Auger <[email protected]>--- hw/vfio/container.c | 1 - 1 file changed, 1 deletion(-)hw/vfio/container.c +0
-0
hw/vfio/container.c static bool vfio_connect_container(VFIOGroup *group, AddressSpace *as, · line 662
Quoted 7 lines
hw/vfio/container.c +0
-1@@ -657,7 +657,6 @@ static bool vfio_connect_container(VFIOGroup *group, AddressSpace *as,return true; listener_release_exit:QLIST_REMOVE (group, container_next); -QLIST_REMOVE (bcontainer, next);vfio_kvm_device_del_group (group);memory_listener_unregister (&bcontainer->listener);if (vioc->release) {
Applied to vfio-next.
Thanks,
C.