Re: [PATCH V2 01/12] virtio-blk: validate num_queues during probe

2021-10-13 Thread Jason Wang
On Thu, Oct 14, 2021 at 1:45 PM Michael S. Tsirkin wrote: > > On Thu, Oct 14, 2021 at 10:32:32AM +0800, Jason Wang wrote: > > On Wed, Oct 13, 2021 at 6:04 PM Michael S. Tsirkin wrote: > > > > > > On Tue, Oct 12, 2021 at 02:52:16PM +0800, Jason Wang wrote: > > > > If an untrusted device neogitates

Re: [PATCH V2 01/12] virtio-blk: validate num_queues during probe

2021-10-13 Thread Michael S. Tsirkin
On Thu, Oct 14, 2021 at 10:32:32AM +0800, Jason Wang wrote: > On Wed, Oct 13, 2021 at 6:04 PM Michael S. Tsirkin wrote: > > > > On Tue, Oct 12, 2021 at 02:52:16PM +0800, Jason Wang wrote: > > > If an untrusted device neogitates BLK_F_MQ but advertises a zero > > > num_queues, the driver may end up

Re: [PATCH V2 01/12] virtio-blk: validate num_queues during probe

2021-10-13 Thread Jason Wang
On Wed, Oct 13, 2021 at 6:04 PM Michael S. Tsirkin wrote: > > On Tue, Oct 12, 2021 at 02:52:16PM +0800, Jason Wang wrote: > > If an untrusted device neogitates BLK_F_MQ but advertises a zero > > num_queues, the driver may end up trying to allocating zero size > > buffers where ZERO_SIZE_PTR is ret

Re: [PATCH V2 01/12] virtio-blk: validate num_queues during probe

2021-10-13 Thread Michael S. Tsirkin
On Tue, Oct 12, 2021 at 02:52:16PM +0800, Jason Wang wrote: > If an untrusted device neogitates BLK_F_MQ but advertises a zero > num_queues, the driver may end up trying to allocating zero size > buffers where ZERO_SIZE_PTR is returned which may pass the checking > against the NULL. This will lead

[PATCH V2 01/12] virtio-blk: validate num_queues during probe

2021-10-11 Thread Jason Wang
If an untrusted device neogitates BLK_F_MQ but advertises a zero num_queues, the driver may end up trying to allocating zero size buffers where ZERO_SIZE_PTR is returned which may pass the checking against the NULL. This will lead unexpected results. Fixing this by using single queue if num_queues