From: Amit Shah <amit.shah@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qed: fix use-after-free during l2 cache commit
Date: Fri, 30 Sep 2011 21:19:30 +0530 [thread overview]
Message-ID: <20110930154930.GJ21901@amit-x200.redhat.com> (raw)
In-Reply-To: <CAJSP0QUyOdTejgEu8nFN3uQ_4VcSFVAyvetG9MjM1JxX0uds7g@mail.gmail.com>
On (Fri) 30 Sep 2011 [16:23:30], Stefan Hajnoczi wrote:
> On Fri, Sep 30, 2011 at 12:27 PM, Amit Shah <amit.shah@redhat.com> wrote:
> > On (Fri) 30 Sep 2011 [11:39:11], Stefan Hajnoczi wrote:
> >> QED's metadata caching strategy allows two parallel requests to race for
> >> metadata lookup. The first one to complete will populate the metadata
> >> cache and the second one will drop the data it just read in favor of the
> >> cached data.
> >>
> >> There is a use-after-free in qed_read_l2_table_cb() and
> >> qed_commit_l2_update() where l2_table->offset was used after the
> >> l2_table may have been freed due to a metadata lookup race. Fix this by
> >> keeping the l2_offset in a local variable and not reaching into the
> >> possibly freed l2_table.
> >>
> >> Reported-by: Amit Shah <amit.shah@redhat.com>
> >> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> >> ---
> >> Hi Amit,
> >> Thanks for reporting the assertion failure you saw at http://fpaste.org/CDuv/.
> >> Does this patch fix the problem?
> >
> > Yes, this fixes it.
>
> Were you able to reliably reproduce the assertion failure before?
Absolutely.
I even reverted the patch and tried the same image; same segfault
again.
> I wonder because this only happens when two metadata lookups race
> (which is rare enough on my setup that I've never seen this failure).
> It might be worth trying a few times.
Get the F16 beta-rc LXE live iso, install guest. It doesn't cleanly
reboot, you have to kill the VM. Next start of the VM produces this
segfault.
https://alt.fedoraproject.org/pub/alt/stage/16-Beta.RC2/Live/x86_64/Fedora-16-Beta-x86_64-Live-LXDE.iso
Amit
next prev parent reply other threads:[~2011-09-30 15:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-30 10:39 [Qemu-devel] [PATCH] qed: fix use-after-free during l2 cache commit Stefan Hajnoczi
2011-09-30 11:27 ` Amit Shah
2011-09-30 15:23 ` Stefan Hajnoczi
2011-09-30 15:49 ` Amit Shah [this message]
2011-10-11 14:22 ` Kevin Wolf
2011-10-12 7:53 ` Stefan Hajnoczi
2011-09-30 15:26 ` Stefan Hajnoczi
2011-10-03 19:53 ` Anthony Liguori
2011-10-05 16:17 ` Anthony Liguori
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=20110930154930.GJ21901@amit-x200.redhat.com \
--to=amit.shah@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@linux.vnet.ibm.com \
/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).