* [Qemu-devel] [PATCH] virtio-blk: Fix use after release in virtio_blk_handle_rw_error
@ 2010-04-07 11:47 Jan Kiszka
2010-04-07 11:57 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2010-04-07 11:47 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel, Luiz Capitulino
virtio_blk_req_complete releases the request we dereference again for
bdrv_mon_event. Reorder both calls to fix this.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/virtio-blk.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 9915840..d5e8c79 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -76,8 +76,8 @@ static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error,
bdrv_mon_event(req->dev->bs, BDRV_ACTION_STOP, is_read);
vm_stop(0);
} else {
- virtio_blk_req_complete(req, VIRTIO_BLK_S_IOERR);
bdrv_mon_event(req->dev->bs, BDRV_ACTION_REPORT, is_read);
+ virtio_blk_req_complete(req, VIRTIO_BLK_S_IOERR);
}
return 1;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-blk: Fix use after release in virtio_blk_handle_rw_error
2010-04-07 11:47 [Qemu-devel] [PATCH] virtio-blk: Fix use after release in virtio_blk_handle_rw_error Jan Kiszka
@ 2010-04-07 11:57 ` Christoph Hellwig
2010-04-07 12:18 ` Kevin Wolf
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2010-04-07 11:57 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Anthony Liguori, qemu-devel, Luiz Capitulino
On Wed, Apr 07, 2010 at 01:47:47PM +0200, Jan Kiszka wrote:
> virtio_blk_req_complete releases the request we dereference again for
> bdrv_mon_event. Reorder both calls to fix this.
I think Kevin alreday sent a patch to use the local state variable
which is still around. Either way looks fine to me.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-blk: Fix use after release in virtio_blk_handle_rw_error
2010-04-07 11:57 ` Christoph Hellwig
@ 2010-04-07 12:18 ` Kevin Wolf
2010-04-07 12:32 ` Luiz Capitulino
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Wolf @ 2010-04-07 12:18 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jan Kiszka, Anthony Liguori, qemu-devel, Luiz Capitulino
Am 07.04.2010 13:57, schrieb Christoph Hellwig:
> On Wed, Apr 07, 2010 at 01:47:47PM +0200, Jan Kiszka wrote:
>> virtio_blk_req_complete releases the request we dereference again for
>> bdrv_mon_event. Reorder both calls to fix this.
>
> I think Kevin alreday sent a patch to use the local state variable
> which is still around. Either way looks fine to me.
Yes, it's the same thing, so I won't pick this up for my block branch
even though Jan's fix looks fine, too.
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-blk: Fix use after release in virtio_blk_handle_rw_error
2010-04-07 12:18 ` Kevin Wolf
@ 2010-04-07 12:32 ` Luiz Capitulino
2010-04-07 12:33 ` Luiz Capitulino
0 siblings, 1 reply; 5+ messages in thread
From: Luiz Capitulino @ 2010-04-07 12:32 UTC (permalink / raw)
To: Kevin Wolf; +Cc: Jan Kiszka, Anthony Liguori, Christoph Hellwig, qemu-devel
On Wed, 07 Apr 2010 14:18:26 +0200
Kevin Wolf <kwolf@redhat.com> wrote:
> Am 07.04.2010 13:57, schrieb Christoph Hellwig:
> > On Wed, Apr 07, 2010 at 01:47:47PM +0200, Jan Kiszka wrote:
> >> virtio_blk_req_complete releases the request we dereference again for
> >> bdrv_mon_event. Reorder both calls to fix this.
> >
> > I think Kevin alreday sent a patch to use the local state variable
> > which is still around. Either way looks fine to me.
>
> Yes, it's the same thing, so I won't pick this up for my block branch
> even though Jan's fix looks fine, too.
I also resend Kevin's fix two days ago as part of a git pull, but
looks like Anthony is away..
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-blk: Fix use after release in virtio_blk_handle_rw_error
2010-04-07 12:32 ` Luiz Capitulino
@ 2010-04-07 12:33 ` Luiz Capitulino
0 siblings, 0 replies; 5+ messages in thread
From: Luiz Capitulino @ 2010-04-07 12:33 UTC (permalink / raw)
To: Kevin Wolf; +Cc: Jan Kiszka, Anthony Liguori, Christoph Hellwig, qemu-devel
On Wed, 7 Apr 2010 09:32:35 -0300
Luiz Capitulino <lcapitulino@redhat.com> wrote:
> On Wed, 07 Apr 2010 14:18:26 +0200
> Kevin Wolf <kwolf@redhat.com> wrote:
>
> > Am 07.04.2010 13:57, schrieb Christoph Hellwig:
> > > On Wed, Apr 07, 2010 at 01:47:47PM +0200, Jan Kiszka wrote:
> > >> virtio_blk_req_complete releases the request we dereference again for
> > >> bdrv_mon_event. Reorder both calls to fix this.
> > >
> > > I think Kevin alreday sent a patch to use the local state variable
> > > which is still around. Either way looks fine to me.
> >
> > Yes, it's the same thing, so I won't pick this up for my block branch
> > even though Jan's fix looks fine, too.
>
> I also resend Kevin's fix two days ago as part of a git pull, but
> looks like Anthony is away..
A pull request, I mean.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-04-07 12:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-07 11:47 [Qemu-devel] [PATCH] virtio-blk: Fix use after release in virtio_blk_handle_rw_error Jan Kiszka
2010-04-07 11:57 ` Christoph Hellwig
2010-04-07 12:18 ` Kevin Wolf
2010-04-07 12:32 ` Luiz Capitulino
2010-04-07 12:33 ` Luiz Capitulino
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).