From: Fam Zheng <famz@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, jsnow@redhat.com, ehabkost@redhat.com
Subject: Re: [Qemu-devel] [PATCH] qdev: Fix use after free in qdev_init_nofail error path
Date: Tue, 2 Aug 2016 16:42:41 +0800 [thread overview]
Message-ID: <20160802084241.GD2095@ad.usersys.redhat.com> (raw)
In-Reply-To: <20160802095507.6055409b@nial.brq.redhat.com>
On Tue, 08/02 09:55, Igor Mammedov wrote:
> qdev_init_nofail() { called with ref == 1
Yes it does.
> object_property_set_bool(true, "realized")
> if error:
> ref == 1
^
This is not the case for qdev, the object is actually released by
object_property_set_bool if fail.
The problem seems to be that qdev_create doesn't set OBJECT(dev)->parent,
because it eventually calls object_property_add_link instead of
object_property_add_child.
> else:
> ref == 2 (+1 for implicitly assigned parent)
> }
Fam
next prev parent reply other threads:[~2016-08-02 8:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-02 3:41 [Qemu-devel] [PATCH] qdev: Fix use after free in qdev_init_nofail error path Fam Zheng
2016-08-02 4:00 ` John Snow
2016-08-02 6:43 ` Paolo Bonzini
2016-08-02 8:14 ` Igor Mammedov
2016-08-02 8:17 ` Fam Zheng
2016-08-02 7:55 ` Igor Mammedov
2016-08-02 8:42 ` Fam Zheng [this message]
2016-08-02 13:05 ` Paolo Bonzini
2016-08-02 13:25 ` Igor Mammedov
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=20160802084241.GD2095@ad.usersys.redhat.com \
--to=famz@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=jsnow@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).