From: Paolo Bonzini <pbonzini@redhat.com>
To: Li Qiang <liq3ea@gmail.com>
Cc: "marcandre lureau" <marcandre.lureau@redhat.com>,
"Qemu Developers" <qemu-devel@nongnu.org>,
"Li Qiang" <liqiang6-s@360.cn>,
"Marc-André Lureau" <mlureau@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] spice-char: fix segfault in char_spice_finalize
Date: Thu, 2 Mar 2017 11:25:08 +0100 [thread overview]
Message-ID: <0c88b0e9-2e27-a3cc-c746-02c67c07253f@redhat.com> (raw)
In-Reply-To: <CAKXe6S+Gw5q1Ohw8F3SQzYp7g_2sBUW7gEYd94yYt8m_3Naw2g@mail.gmail.com>
On 02/03/2017 11:20, Li Qiang wrote:
> Hello Paolo,
>
> Have you queued this patch?
No, I thought Gerd would. Queued now.
Paolo
> 2017-02-21 16:32 GMT+08:00 Marc-André Lureau <mlureau@redhat.com
> <mailto:mlureau@redhat.com>>:
>
> Hi
>
> ----- Original Message -----
> > In 'qemu_chr_open_spice_vmc' if the 'psubtype' is NULL, it will
> > call 'char_spice_finalize'. But as the SpiceChardev is not inserted
> > in the 'spice_chars' list, the 'QLIST_REMOVE' will cause a segfault.
> > Add a detect to avoid it.
> >
> > Signed-off-by: Li Qiang <liqiang6-s@360.cn <mailto:liqiang6-s@360.cn>>
>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com
> <mailto:marcandre.lureau@redhat.com>>
>
> > ---
> > spice-qemu-char.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/spice-qemu-char.c b/spice-qemu-char.c
> > index 6f46f46..4d1c76e 100644
> > --- a/spice-qemu-char.c
> > +++ b/spice-qemu-char.c
> > @@ -215,7 +215,10 @@ static void char_spice_finalize(Object *obj)
> > SpiceChardev *s = SPICE_CHARDEV(obj);
> >
> > vmc_unregister_interface(s);
> > - QLIST_REMOVE(s, next);
> > +
> > + if (s->next.le_prev) {
> > + QLIST_REMOVE(s, next);
> > + }
> >
> > g_free((char *)s->sin.subtype);
> > #if SPICE_SERVER_VERSION >= 0x000c02
> > --
> > 1.8.3.1
> >
> >
>
>
prev parent reply other threads:[~2017-03-02 10:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 8:18 [Qemu-devel] [PATCH v2] spice-char: fix segfault in char_spice_finalize Li Qiang
2017-02-21 8:32 ` Marc-André Lureau
2017-03-02 10:20 ` Li Qiang
2017-03-02 10:25 ` 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=0c88b0e9-2e27-a3cc-c746-02c67c07253f@redhat.com \
--to=pbonzini@redhat.com \
--cc=liq3ea@gmail.com \
--cc=liqiang6-s@360.cn \
--cc=marcandre.lureau@redhat.com \
--cc=mlureau@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).