qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniil Tatianin" <d-tatianin@yandex-team.ru>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	yc-core@yandex-team.ru, qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [PATCH v1] chardev/wctable: don't free the instance in wctablet_chr_finalize
Date: Fri, 19 Nov 2021 10:24:58 +0100	[thread overview]
Message-ID: <84c160f2-476f-6d06-4313-24a16375659c@redhat.com> (raw)
In-Reply-To: <CAMxuvaxp0x805rOPA8YsQfGEPHBz=pTVvwiHot5UGVwdbEOKFw@mail.gmail.com>

On 11/17/21 15:51, Marc-André Lureau wrote:
> Hi
> 
> On Wed, Nov 17, 2021 at 6:25 PM Daniil Tatianin
> <d-tatianin@yandex-team.ru> wrote:
>>
>> Object is supposed to be freed by invoking obj->free, and not
>> obj->instance_finalize. This would lead to use-after-free followed by
>> double free in object_unref/object_finalize.
>>
>> Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
> 
> Fixes: 378af96155d62 ("Add wctablet device")
> 
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
>> ---
>>   chardev/wctablet.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/chardev/wctablet.c b/chardev/wctablet.c
>> index e9cb7ca710..fa3c9be04e 100644
>> --- a/chardev/wctablet.c
>> +++ b/chardev/wctablet.c
>> @@ -318,7 +318,6 @@ static void wctablet_chr_finalize(Object *obj)
>>       TabletChardev *tablet = WCTABLET_CHARDEV(obj);
>>
>>       qemu_input_handler_unregister(tablet->hs);
>> -    g_free(tablet);
>>   }
>>
>>   static void wctablet_chr_open(Chardev *chr,
>> --
>> 2.25.1
>>
> 
> 

Queued, thanks.

Paolo



      reply	other threads:[~2021-11-19  9:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 14:23 [PATCH v1] chardev/wctable: don't free the instance in wctablet_chr_finalize Daniil Tatianin
2021-11-17 14:51 ` Marc-André Lureau
2021-11-19  9:24   ` Paolo Bonzini [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=84c160f2-476f-6d06-4313-24a16375659c@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=d-tatianin@yandex-team.ru \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=yc-core@yandex-team.ru \
    /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).