[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [PATCH v3] virtio-blk: Fix double completion for werro
From: |
Fam Zheng |
Subject: |
Re: [Qemu-stable] [PATCH v3] virtio-blk: Fix double completion for werror=stop |
Date: |
Mon, 23 Nov 2015 08:39:59 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sun, 11/22 20:41, Paolo Bonzini wrote:
> > diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> > index e70fccf..848f3fe 100644
> > --- a/hw/block/virtio-blk.c
> > +++ b/hw/block/virtio-blk.c
> > @@ -112,6 +112,10 @@ static void virtio_blk_rw_complete(void *opaque, int
> > ret)
> > * happen on the other side of the migration).
> > */
> > if (virtio_blk_handle_rw_error(req, -ret, is_read)) {
> > + /* Break the link in case the next request is added to the
> > + * restart queue and is going to be parsed from the ring
> > again.
> > + */
> > + req->mr_next = NULL;
> > continue;
> > }
> > }
> >
>
> This is now a write-after-free for rerror/werror=stop. The right place
> to set req->mr_next is inside virtio_blk_handle_rw_error, I think.
>
Oh yes :( Sending another patch.
Fam