* [Qemu-devel] [PATCH v7] virtio-blk: fix reference a pointer which might be freed
@ 2014-08-18 7:42 zhanghailiang
2014-08-18 8:08 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: zhanghailiang @ 2014-08-18 7:42 UTC (permalink / raw)
To: qemu-devel
Cc: kwolf, zhanghailiang, mst, luonengjun, peter.huangpeng, stefanha
In function virtio_blk_handle_request, it may freed memory pointed by req,
So do not access member of req after calling this function.
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
---
hw/block/virtio-blk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index c241c50..0e3925b 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -469,8 +469,9 @@ static void virtio_blk_dma_restart_bh(void *opaque)
s->rq = NULL;
while (req) {
+ VirtIOBlockReq *next = req->next;
virtio_blk_handle_request(req, &mrb);
- req = req->next;
+ req = next;
}
virtio_submit_multiwrite(s->bs, &mrb);
--
1.7.12.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v7] virtio-blk: fix reference a pointer which might be freed
2014-08-18 7:42 [Qemu-devel] [PATCH v7] virtio-blk: fix reference a pointer which might be freed zhanghailiang
@ 2014-08-18 8:08 ` Paolo Bonzini
2014-08-20 9:58 ` Kevin Wolf
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2014-08-18 8:08 UTC (permalink / raw)
To: zhanghailiang, qemu-devel
Cc: kwolf, mst, luonengjun, qemu-stable, peter.huangpeng, stefanha
Il 18/08/2014 09:42, zhanghailiang ha scritto:
> In function virtio_blk_handle_request, it may freed memory pointed by req,
> So do not access member of req after calling this function.
>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> ---
> hw/block/virtio-blk.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> index c241c50..0e3925b 100644
> --- a/hw/block/virtio-blk.c
> +++ b/hw/block/virtio-blk.c
> @@ -469,8 +469,9 @@ static void virtio_blk_dma_restart_bh(void *opaque)
> s->rq = NULL;
>
> while (req) {
> + VirtIOBlockReq *next = req->next;
> virtio_blk_handle_request(req, &mrb);
> - req = req->next;
> + req = next;
> }
>
> virtio_submit_multiwrite(s->bs, &mrb);
>
Cc: qemu-stable@nongnu.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v7] virtio-blk: fix reference a pointer which might be freed
2014-08-18 8:08 ` Paolo Bonzini
@ 2014-08-20 9:58 ` Kevin Wolf
0 siblings, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2014-08-20 9:58 UTC (permalink / raw)
To: Paolo Bonzini
Cc: zhanghailiang, mst, qemu-stable, luonengjun, peter.huangpeng,
qemu-devel, stefanha
Am 18.08.2014 um 10:08 hat Paolo Bonzini geschrieben:
> Il 18/08/2014 09:42, zhanghailiang ha scritto:
> > In function virtio_blk_handle_request, it may freed memory pointed by req,
> > So do not access member of req after calling this function.
> >
> > Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
>
> Cc: qemu-stable@nongnu.org
Thanks, added the Cc: line and applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-20 9:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-18 7:42 [Qemu-devel] [PATCH v7] virtio-blk: fix reference a pointer which might be freed zhanghailiang
2014-08-18 8:08 ` Paolo Bonzini
2014-08-20 9:58 ` Kevin Wolf
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).