All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zihao Chang <changzihao1@huawei.com>
To: <qemu-devel@nongnu.org>
Cc: oscar.zhangbo@huawei.com, changzihao1@huawei.com,
	armbru@redhat.com, xiexiangyou@huawei.com, kraxel@redhat.com
Subject: [PATCH] vnc: fix unfinalized tlscreds for VncDisplay
Date: Mon, 11 Jan 2021 21:19:11 +0800	[thread overview]
Message-ID: <20210111131911.805-1-changzihao1@huawei.com> (raw)

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



             reply	other threads:[~2021-01-11 13:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 13:19 Zihao Chang [this message]
2021-01-11 15:50 ` [PATCH] vnc: fix unfinalized tlscreds for VncDisplay Philippe Mathieu-Daudé
2021-01-11 15:56 ` Daniel P. Berrangé
2021-01-14  9:27 ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210111131911.805-1-changzihao1@huawei.com \
    --to=changzihao1@huawei.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=oscar.zhangbo@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xiexiangyou@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.