qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: fam@euphon.net, pbonzini@redhat.com, qemu-block@nongnu.org,
	qemu-stable@nongnu.org, kwolf@redhat.com
Subject: Re: [Qemu-devel] [PATCH] pr-manager: Fix invalid g_free() crash bug
Date: Thu, 22 Aug 2019 16:54:01 +0200	[thread overview]
Message-ID: <1fe0ee70-33f5-7fba-744d-070afe36b5e1@redhat.com> (raw)
In-Reply-To: <20190822133846.10923-1-armbru@redhat.com>

On 8/22/19 3:38 PM, Markus Armbruster wrote:
> pr_manager_worker() passes its @opaque argument to g_free().  Wrong;
> it points to pr_manager_worker()'s automatic @data.  Broken when
> commit 2f3a7ab39be converted @data from heap- to stack-allocated.  Fix
> by deleting the g_free().
> 
> Fixes: 2f3a7ab39bec4ba8022dc4d42ea641165b004e3e
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scsi/pr-manager.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/scsi/pr-manager.c b/scsi/pr-manager.c
> index ee43663576..0c866e8698 100644
> --- a/scsi/pr-manager.c
> +++ b/scsi/pr-manager.c
> @@ -39,7 +39,6 @@ static int pr_manager_worker(void *opaque)
>      int fd = data->fd;
>      int r;
>  
> -    g_free(data);
>      trace_pr_manager_run(fd, hdr->cmdp[0], hdr->cmdp[1]);
>  
>      /* The reference was taken in pr_manager_execute.  */
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


  reply	other threads:[~2019-08-22 14:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 13:38 [Qemu-devel] [PATCH] pr-manager: Fix invalid g_free() crash bug Markus Armbruster
2019-08-22 14:54 ` Philippe Mathieu-Daudé [this message]
2019-08-22 16:39 ` Paolo Bonzini
2019-09-02 14:10 ` Kevin Wolf

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=1fe0ee70-33f5-7fba-744d-070afe36b5e1@redhat.com \
    --to=philmd@redhat.com \
    --cc=armbru@redhat.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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 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).