From: David Gibson <david@gibson.dropbear.id.au>
To: "Marc-André Lureau" <mlureau@redhat.com>
Cc: marcandre lureau <marcandre.lureau@redhat.com>,
qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] tests/vhost-user-test: Fix potential use-after-free
Date: Fri, 4 Dec 2015 20:05:47 +1100 [thread overview]
Message-ID: <20151204090547.GI9559@voom.redhat.com> (raw)
In-Reply-To: <1005103785.22106475.1449052609787.JavaMail.zimbra@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1499 bytes --]
On Wed, Dec 02, 2015 at 05:36:49AM -0500, Marc-André Lureau wrote:
> Hi
>
> ----- Original Message -----
> > ae31fb5 "vhost-user-test: wrap server in TestServer struct" cleaned up
> > the handling of the test server in vhost-user-test. Unfortunately it
> > introduced a subtle use-after-free if a race goes the wrong way.
> >
> > When the server structure is freed inside test_server_free() the GThread
> > started earlier is still running inside g_main_loop_run(). That GMainLoop
> > still has handlers active which reference the server structure, so if those
> > trip before the program exits there's a use-after-free.
> >
> > I've had difficulty reproducing this locally, but for some reason it seems
> > to trip every time on Travis builds - this has been breaking all my test
> > builds there, which is why I notced it.
> >
> > This patch prevents the use after free. Unfortunately it looks like there
> > are additional problems still breaking my Travis builds, but one problem
> > at a time.
> >
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
>
> The fix is on the ML for a few days, see "vhost-user-test: fix chardriver race"
> The last series of fixes is "[PATCH for-2.5 v4 0/4] vhost-user-test
> fixes"
Drat, wish I'd spotted it. Oh well.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-12-04 9:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-02 2:46 [Qemu-devel] [PATCH] tests/vhost-user-test: Fix potential use-after-free David Gibson
2015-12-02 10:36 ` Marc-André Lureau
2015-12-04 9:05 ` David Gibson [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=20151204090547.GI9559@voom.redhat.com \
--to=david@gibson.dropbear.id.au \
--cc=marcandre.lureau@redhat.com \
--cc=mlureau@redhat.com \
--cc=mst@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).