All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vnc: fix unfinalized tlscreds for VncDisplay
@ 2021-01-11 13:19 Zihao Chang
  2021-01-11 15:50 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zihao Chang @ 2021-01-11 13:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: oscar.zhangbo, changzihao1, armbru, xiexiangyou, kraxel

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.

Signed-off-by: Zihao Chang <changzihao1@huawei.com>
---
 ui/vnc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/vnc.c b/ui/vnc.c
index 7452ac7df2..69e92b1ef3 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -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) {
-- 
2.23.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] vnc: fix unfinalized tlscreds for VncDisplay
  2021-01-11 13:19 [PATCH] vnc: fix unfinalized tlscreds for VncDisplay Zihao Chang
@ 2021-01-11 15:50 ` Philippe Mathieu-Daudé
  2021-01-11 15:56 ` Daniel P. Berrangé
  2021-01-14  9:27 ` Gerd Hoffmann
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-11 15:50 UTC (permalink / raw)
  To: Zihao Chang, qemu-devel, Daniel P . Berrange
  Cc: oscar.zhangbo, armbru, xiexiangyou, kraxel

+Daniel

On 1/11/21 2:19 PM, Zihao Chang wrote:
> 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.
> 
> Signed-off-by: Zihao Chang <changzihao1@huawei.com>
> ---
>  ui/vnc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ui/vnc.c b/ui/vnc.c
> index 7452ac7df2..69e92b1ef3 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -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) {
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vnc: fix unfinalized tlscreds for VncDisplay
  2021-01-11 13:19 [PATCH] vnc: fix unfinalized tlscreds for VncDisplay Zihao Chang
  2021-01-11 15:50 ` Philippe Mathieu-Daudé
@ 2021-01-11 15:56 ` Daniel P. Berrangé
  2021-01-14  9:27 ` Gerd Hoffmann
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2021-01-11 15:56 UTC (permalink / raw)
  To: Zihao Chang; +Cc: oscar.zhangbo, kraxel, qemu-devel, xiexiangyou, armbru

On Mon, Jan 11, 2021 at 09:19:11PM +0800, Zihao Chang wrote:
> 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.
> 
> Signed-off-by: Zihao Chang <changzihao1@huawei.com>
> ---
>  ui/vnc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: 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 :|



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vnc: fix unfinalized tlscreds for VncDisplay
  2021-01-11 13:19 [PATCH] vnc: fix unfinalized tlscreds for VncDisplay Zihao Chang
  2021-01-11 15:50 ` Philippe Mathieu-Daudé
  2021-01-11 15:56 ` Daniel P. Berrangé
@ 2021-01-14  9:27 ` Gerd Hoffmann
  2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2021-01-14  9:27 UTC (permalink / raw)
  To: Zihao Chang; +Cc: oscar.zhangbo, qemu-devel, xiexiangyou, armbru

On Mon, Jan 11, 2021 at 09:19:11PM +0800, Zihao Chang wrote:
> 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.
> 
> Signed-off-by: Zihao Chang <changzihao1@huawei.com>

Added to UI patch queue.

thanks,
  Gerd



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-14  9:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-11 13:19 [PATCH] vnc: fix unfinalized tlscreds for VncDisplay Zihao Chang
2021-01-11 15:50 ` Philippe Mathieu-Daudé
2021-01-11 15:56 ` Daniel P. Berrangé
2021-01-14  9:27 ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.