vnc: fix unfinalized tlscreds for VncDisplay
PATCH 1/1 vnc: fix unfinalized tlscreds for VncDisplay
In vnc_display_open(), if tls-creds is enabled, do object_ref(object ref 1->2) for tls-creds. While in vnc_display_close(), object_unparent sets object ref to 1(2->1) and unparent the object for root. Problem:
1. the object can not be found from the objects_root, while the object is not finalized.
2. the qemu_opts of tls-creds(id: creds0) is not deleted, so new tls object with the same id(creds0) can not be delete & add.
--- ui/vnc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ui/vnc.c +1 -1
@@ -3234,7 +3234,7 @@ static void vnc_display_close(VncDisplay *vd) vd->auth =VNC_AUTH_INVALID ; vd->subauth =VNC_AUTH_INVALID ;if (vd->tlscreds) { -object_unparent (OBJECT (vd->tlscreds)); +object_unref (OBJECT (vd->tlscreds)); vd->tlscreds =NULL ; }if (vd->tlsauthz) {
Signature · 1 line
2.23.0
+Daniel
Quoted 28 lines · Zihao Chang
In
vnc_display_open(), if tls-creds is enabled, doobject_ref(object ref 1->2)for tls-creds. While invnc_display_close(),object_unparentsets object ref to 1(2->1) and unparent the object for root. Problem:
1. the object can not be found from theobjects_root, while the object is not finalized.
2. theqemu_optsof tls-creds(id: creds0) is not deleted, so new tls object with the same id(creds0) can not be delete & add.Signed-off-by Zihao Chang <[email protected]>--- ui/vnc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)ui/vnc.c +1
-1@@ -3234,7 +3234,7 @@ static void vnc_display_close(VncDisplay *vd) vd->auth =VNC_AUTH_INVALID ; vd->subauth =VNC_AUTH_INVALID ;if (vd->tlscreds) { -object_unparent (OBJECT (vd->tlscreds)); +object_unref (OBJECT (vd->tlscreds)); vd->tlscreds =NULL ; }if (vd->tlsauthz) {
Quoted 9 lines · Zihao Chang
In
vnc_display_open(), if tls-creds is enabled, doobject_ref(object ref 1->2)for tls-creds. While invnc_display_close(),object_unparentsets object ref to 1(2->1) and unparent the object for root. Problem:
1. the object can not be found from theobjects_root, while the object is not finalized.
2. theqemu_optsof tls-creds(id: creds0) is not deleted, so new tls object with the same id(creds0) can not be delete & add.
Quoted 4 lines
Signed-off-by Zihao Chang <[email protected]>--- ui/vnc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Quoted 10 lines · Zihao Chang
In
vnc_display_open(), if tls-creds is enabled, doobject_ref(object ref 1->2)for tls-creds. While invnc_display_close(),object_unparentsets object ref to 1(2->1) and unparent the object for root. Problem:
1. the object can not be found from theobjects_root, while the object is not finalized.
2. theqemu_optsof tls-creds(id: creds0) is not deleted, so new tls object with the same id(creds0) can not be delete & add.Signed-off-by Zihao Chang <[email protected]>
Added to UI patch queue.
thanks,
Gerd