All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org, qemu-stable@nongnu.org
Cc: Ben Aitchison <ben@meh.net.nz>
Subject: Re: [Qemu-devel] [PATCH STABLE 2.6] io: remove mistaken call to object_ref on QTask
Date: Tue, 7 Jun 2016 16:23:39 +0100	[thread overview]
Message-ID: <20160607152339.GJ20196@redhat.com> (raw)
In-Reply-To: <1465309145-6224-1-git-send-email-berrange@redhat.com>

Adding qemu-stable for 2.6

On Tue, Jun 07, 2016 at 03:19:05PM +0100, Daniel P. Berrange wrote:
> The QTask struct is just a standalone struct, not a QOM Object,
> so calling object_ref() on it is not appropriate. This results
> in mangling the 'destroy' field in the QTask struct, causing
> the later call to qtask_free() to try to call the function
> at address 0x1, with predictably segfault happy results.
> 
> There is in fact no need for ref counting with QTask, as the
> call to qtask_abort() or qtask_complete() will automatically
> free associated memory.
> 
> This fixes the crash shown in
> 
>   https://bugs.launchpad.net/qemu/+bug/1589923
> 
> Reported-by: Ben Aitchison <ben@meh.net.nz>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  io/channel-websock.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/io/channel-websock.c b/io/channel-websock.c
> index 239c75a..533bd4b 100644
> --- a/io/channel-websock.c
> +++ b/io/channel-websock.c
> @@ -317,14 +317,13 @@ static gboolean qio_channel_websock_handshake_io(QIOChannel *ioc,
>          return TRUE;
>      }
>  
> -    object_ref(OBJECT(task));
>      trace_qio_channel_websock_handshake_reply(ioc);
>      qio_channel_add_watch(
>          wioc->master,
>          G_IO_OUT,
>          qio_channel_websock_handshake_send,
>          task,
> -        (GDestroyNotify)object_unref);
> +        NULL);
>      return FALSE;
>  }
>  
> -- 
> 2.5.5
> 

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

      parent reply	other threads:[~2016-06-07 15:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 14:19 [Qemu-devel] [PATCH] io: remove mistaken call to object_ref on QTask Daniel P. Berrange
2016-06-07 14:51 ` Eric Blake
2016-06-07 15:23 ` Daniel P. Berrange [this message]

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=20160607152339.GJ20196@redhat.com \
    --to=berrange@redhat.com \
    --cc=ben@meh.net.nz \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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 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.