Re: [PATCH v1 1/4] virtio: protect non-modern devices from too big virtqueue size setting

2019-11-06 Thread Michael S. Tsirkin
On Wed, Nov 06, 2019 at 10:18:12AM +0100, Stefan Hajnoczi wrote: > On Tue, Nov 05, 2019 at 03:56:43PM -0500, Michael S. Tsirkin wrote: > > On Tue, Nov 05, 2019 at 07:11:02PM +0300, Denis Plotnikov wrote: > > > @@ -47,6 +48,15 @@ static void virtio_scsi_pci_realize(VirtIOPCIProxy > > > *vpci_dev,

Re: [PATCH v1 1/4] virtio: protect non-modern devices from too big virtqueue size setting

2019-11-06 Thread Michael S. Tsirkin
On Wed, Nov 06, 2019 at 07:46:31AM +, Denis Plotnikov wrote: > > On 05.11.2019 23:56, Michael S. Tsirkin wrote: > > On Tue, Nov 05, 2019 at 07:11:02PM +0300, Denis Plotnikov wrote: > >> The patch protects from creating illegal virtio device configuration > >> via direct virtqueue size

Re: [PATCH v1 1/4] virtio: protect non-modern devices from too big virtqueue size setting

2019-11-06 Thread Stefan Hajnoczi
On Wed, Nov 06, 2019 at 07:46:31AM +, Denis Plotnikov wrote: > Could I ask why one want to the check > whether accessing through the modern interface and how it could be checked? BTW the VERSION_1 check I mentioned won't work in .realize() since feature negotiation happens later at guest

Re: [PATCH v1 1/4] virtio: protect non-modern devices from too big virtqueue size setting

2019-11-06 Thread Stefan Hajnoczi
On Tue, Nov 05, 2019 at 03:56:43PM -0500, Michael S. Tsirkin wrote: > On Tue, Nov 05, 2019 at 07:11:02PM +0300, Denis Plotnikov wrote: > > @@ -47,6 +48,15 @@ static void virtio_scsi_pci_realize(VirtIOPCIProxy > > *vpci_dev, Error **errp) > > VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(vdev); >

Re: [PATCH v1 1/4] virtio: protect non-modern devices from too big virtqueue size setting

2019-11-06 Thread Stefan Hajnoczi
On Wed, Nov 06, 2019 at 07:46:31AM +, Denis Plotnikov wrote: > > On 05.11.2019 23:56, Michael S. Tsirkin wrote: > > On Tue, Nov 05, 2019 at 07:11:02PM +0300, Denis Plotnikov wrote: > >> The patch protects from creating illegal virtio device configuration > >> via direct virtqueue size

Re: [PATCH v1 1/4] virtio: protect non-modern devices from too big virtqueue size setting

2019-11-05 Thread Denis Plotnikov
On 05.11.2019 23:56, Michael S. Tsirkin wrote: > On Tue, Nov 05, 2019 at 07:11:02PM +0300, Denis Plotnikov wrote: >> The patch protects from creating illegal virtio device configuration >> via direct virtqueue size property setting. >> >> Signed-off-by: Denis Plotnikov >> --- >>

Re: [PATCH v1 1/4] virtio: protect non-modern devices from too big virtqueue size setting

2019-11-05 Thread Michael S. Tsirkin
On Tue, Nov 05, 2019 at 07:11:02PM +0300, Denis Plotnikov wrote: > The patch protects from creating illegal virtio device configuration > via direct virtqueue size property setting. > > Signed-off-by: Denis Plotnikov > --- > hw/virtio/virtio-blk-pci.c | 9 + >

[PATCH v1 1/4] virtio: protect non-modern devices from too big virtqueue size setting

2019-11-05 Thread Denis Plotnikov
The patch protects from creating illegal virtio device configuration via direct virtqueue size property setting. Signed-off-by: Denis Plotnikov --- hw/virtio/virtio-blk-pci.c | 9 + hw/virtio/virtio-scsi-pci.c | 10 ++ 2 files changed, 19 insertions(+) diff --git