]> Git Repo - linux.git/commit
virtio-blk: Add validation for block size in config space
authorXie Yongji <[email protected]>
Mon, 9 Aug 2021 10:16:09 +0000 (18:16 +0800)
committerMichael S. Tsirkin <[email protected]>
Wed, 11 Aug 2021 10:44:24 +0000 (06:44 -0400)
commit82e89ea077b93b3c131fa175b0df3acb5b1d5cdf
tree42f68656fd5af5f72814197e1885885a4a1e5583
parente74cfa91f42c50f7f649b0eca46aa049754ccdbd
virtio-blk: Add validation for block size in config space

An untrusted device might presents an invalid block size
in configuration space. This tries to add validation for it
in the validate callback and clear the VIRTIO_BLK_F_BLK_SIZE
feature bit if the value is out of the supported range.

And we also double check the value in virtblk_probe() in
case that it's changed after the validation.

Signed-off-by: Xie Yongji <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
drivers/block/virtio_blk.c
This page took 0.054393 seconds and 4 git commands to generate.