qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: peter.maydell@linaro.org, "Stefan Hajnoczi" <stefanha@gmail.com>,
	bsd@redhat.com, qemu-devel <qemu-devel@nongnu.org>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] Use-after-free during unrealize in system_reset
Date: Sun, 8 Jun 2014 13:46:26 +0300	[thread overview]
Message-ID: <20140608104626.GA26245@redhat.com> (raw)
In-Reply-To: <53918F6E.1020406@redhat.com>

On Fri, Jun 06, 2014 at 11:52:46AM +0200, Paolo Bonzini wrote:
> Il 06/06/2014 11:03, Stefan Hajnoczi ha scritto:
> >commit 5c21ce77d7e5643089ceec556c0408445d017f32
> >Author: Bandan Das <bsd@redhat.com>
> >Date:   Wed Mar 12 21:02:12 2014 +0100
> >
> >    qdev: Realize buses on device realization
> >
> >    Integrate (un)realization of child buses with realization/unrealization
> >    of the device hosting them. Code in device_unparent() is reordered for
> >    unrealization of buses to work as part of device unrealization.
> >
> >    That way no changes need to be made to bus instantiation.
> >
> >    Signed-off-by: Bandan Das <bsd@redhat.com>
> >    Signed-off-by: Andreas Färber <afaerber@suse.de>
> 
> This hunk seems wrong.  Bandan, what was the reason for it?
> 
> 
> @@ -841,13 +858,13 @@ static void device_unparent(Object *obj)
>      QObject *event_data;
>      bool have_realized = dev->realized;
> 
> +    if (dev->realized) {
> +        object_property_set_bool(obj, false, "realized", NULL);
> +    }
>      while (dev->num_child_bus) {
>          bus = QLIST_FIRST(&dev->child_bus);
>          object_unparent(OBJECT(bus));
>      }
> -    if (dev->realized) {
> -        object_property_set_bool(obj, false, "realized", NULL);
> -    }
>      if (dev->parent_bus) {
>          bus_remove_child(dev->parent_bus, dev);
>          object_unref(OBJECT(dev->parent_bus));
> 

Tested-by: Michael S. Tsirkin <mst@redhat.com>



> 
> Paolo

  reply	other threads:[~2014-06-08 10:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 15:31 [Qemu-devel] Use-after-free during unrealize in system_reset Stefan Hajnoczi
2014-06-05 16:18 ` Michael S. Tsirkin
2014-06-06  9:03   ` Stefan Hajnoczi
2014-06-06  9:52     ` Paolo Bonzini
2014-06-08 10:46       ` Michael S. Tsirkin [this message]
2014-06-08 14:40         ` Paolo Bonzini
2014-06-08 14:52           ` Michael S. Tsirkin
2014-06-08 14:52           ` Michael S. Tsirkin
2014-06-09  7:51             ` Paolo Bonzini
2014-06-09  8:15               ` Michael S. Tsirkin
2014-06-09 17:02           ` Bandan Das
2014-06-11 12:03             ` Andreas Färber
2014-06-11 12:24               ` Paolo Bonzini
2014-06-11 15:51               ` Bandan Das

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=20140608104626.GA26245@redhat.com \
    --to=mst@redhat.com \
    --cc=afaerber@suse.de \
    --cc=bsd@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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 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).