Re: [PATCH] virtio: clean up when virtio_queue_set_rings() fails

2020-02-05 Thread Michael S. Tsirkin
On Wed, Feb 05, 2020 at 02:56:57PM +, Stefan Hajnoczi wrote: > On Wed, Feb 05, 2020 at 01:13:37AM -0500, Michael S. Tsirkin wrote: > > On Tue, Feb 04, 2020 at 03:16:18PM +, Stefan Hajnoczi wrote: > > > hw/virtio.c checks vq->vring.desc != NULL to see if the vring has been > > > set up succe

Re: [PATCH] virtio: clean up when virtio_queue_set_rings() fails

2020-02-05 Thread Cornelia Huck
On Wed, 5 Feb 2020 14:49:46 + Stefan Hajnoczi wrote: > On Tue, Feb 04, 2020 at 05:02:39PM +0100, Cornelia Huck wrote: > > On Tue, 4 Feb 2020 15:16:18 + > > Stefan Hajnoczi wrote: > > > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > > > index 2c5410e981..5d7f619a1e 100644 > > >

Re: [PATCH] virtio: clean up when virtio_queue_set_rings() fails

2020-02-05 Thread Stefan Hajnoczi
On Wed, Feb 05, 2020 at 01:13:37AM -0500, Michael S. Tsirkin wrote: > On Tue, Feb 04, 2020 at 03:16:18PM +, Stefan Hajnoczi wrote: > > hw/virtio.c checks vq->vring.desc != NULL to see if the vring has been > > set up successfully. > > > > When virtio_queue_set_rings() fails due to an invalid v

Re: [PATCH] virtio: clean up when virtio_queue_set_rings() fails

2020-02-05 Thread Stefan Hajnoczi
On Tue, Feb 04, 2020 at 05:02:39PM +0100, Cornelia Huck wrote: > On Tue, 4 Feb 2020 15:16:18 + > Stefan Hajnoczi wrote: > > > hw/virtio.c checks vq->vring.desc != NULL to see if the vring has been > > set up successfully. > > > > When virtio_queue_set_rings() fails due to an invalid vring m

Re: [PATCH] virtio: clean up when virtio_queue_set_rings() fails

2020-02-04 Thread Michael S. Tsirkin
On Tue, Feb 04, 2020 at 03:16:18PM +, Stefan Hajnoczi wrote: > hw/virtio.c checks vq->vring.desc != NULL to see if the vring has been > set up successfully. > > When virtio_queue_set_rings() fails due to an invalid vring memory > address it must clear vq->vring.desc (and related fields) so we

Re: [PATCH] virtio: clean up when virtio_queue_set_rings() fails

2020-02-04 Thread Michael S. Tsirkin
On Tue, Feb 04, 2020 at 03:16:18PM +, Stefan Hajnoczi wrote: > hw/virtio.c checks vq->vring.desc != NULL to see if the vring has been > set up successfully. > > When virtio_queue_set_rings() fails due to an invalid vring memory > address it must clear vq->vring.desc (and related fields) so we

Re: [PATCH] virtio: clean up when virtio_queue_set_rings() fails

2020-02-04 Thread Cornelia Huck
On Tue, 4 Feb 2020 15:16:18 + Stefan Hajnoczi wrote: > hw/virtio.c checks vq->vring.desc != NULL to see if the vring has been > set up successfully. > > When virtio_queue_set_rings() fails due to an invalid vring memory > address it must clear vq->vring.desc (and related fields) so we don't

[PATCH] virtio: clean up when virtio_queue_set_rings() fails

2020-02-04 Thread Stefan Hajnoczi
hw/virtio.c checks vq->vring.desc != NULL to see if the vring has been set up successfully. When virtio_queue_set_rings() fails due to an invalid vring memory address it must clear vq->vring.desc (and related fields) so we don't treat this virtqueue as successfully initialized later on. This bug