qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: Anthony Liguori <aliguori@us.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1.1] scsi: Add assertion for use-after-free errors
Date: Fri, 04 May 2012 08:52:36 +0200	[thread overview]
Message-ID: <4FA37CB4.6070407@redhat.com> (raw)
In-Reply-To: <4FA2F18E.4020001@weilnetz.de>

Il 03/05/2012 22:58, Stefan Weil ha scritto:
> Am 03.05.2012 19:36, schrieb Stefan Weil:
>> The QEMU emulation which is currently used with Raspberry PI images
>> (qemu-system-arm -M versatilepb ...) accesses memory which was freed.
>>
>> Valgrind output (extract):
>>
>> ==17857== Invalid write of size 4
>> ==17857== at 0x24EB06: scsi_req_unref (scsi-bus.c:1273)
>> ==17857== by 0x24FFAE: scsi_read_complete (scsi-disk.c:277)
>> ==17857== by 0x152ACC: bdrv_co_em_bh (block.c:3363)
>> ==17857== by 0x13D49C: qemu_bh_poll (async.c:71)
>> ==17857== by 0x211A8C: main_loop_wait (main-loop.c:503)
>> ==17857== by 0x207954: main_loop (vl.c:1555)
>> ==17857== by 0x20E9C9: main (vl.c:3653)
>> ==17857== Address 0x1c54383c is 12 bytes inside a block of size 260
>> free'd
>> ==17857== at 0x4824B3A: free (vg_replace_malloc.c:366)
>> ==17857== by 0x20ADFA: free_and_trace (vl.c:2250)
>> ==17857== by 0x4899FC5: g_free (in /lib/libglib-2.0.so.0.2400.1)
>> ==17857== by 0x24EB3B: scsi_req_unref (scsi-bus.c:1277)
>> ==17857== by 0x24F003: scsi_req_complete (scsi-bus.c:1383)
>> ==17857== by 0x25022A: scsi_read_data (scsi-disk.c:334)
>> ==17857== by 0x24EB9F: scsi_req_continue (scsi-bus.c:1289)
>> ==17857== by 0x1C7787: lsi_do_dma (lsi53c895a.c:575)
>> ==17857== by 0x1C8CDA: lsi_execute_script (lsi53c895a.c:1147)
>> ==17857== by 0x1C74EA: lsi_resume_script (lsi53c895a.c:510)
>> ==17857== by 0x1C7ECD: lsi_transfer_data (lsi53c895a.c:746)
>> ==17857== by 0x24EC90: scsi_req_data (scsi-bus.c:1307)

Yes, this was reported by David Gibson too.  Interesting that
virtio-scsi doesn't show it, probably it's the sglist support that hides
it.  I queued the fix and I'm sending the pull request in a matter of
minutes.  The patch is a good addition so I queued it too, thanks.

Paolo

      reply	other threads:[~2012-05-04  6:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03 17:36 [Qemu-devel] [PATCH 1.1] scsi: Add assertion for use-after-free errors Stefan Weil
2012-05-03 20:58 ` Stefan Weil
2012-05-04  6:52   ` 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=4FA37CB4.6070407@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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).