WSL2-Linux-Kernel/drivers/block
Stefan Hajnoczi 63947b3434 virtio-blk: limit seg_max to a safe value
The struct virtio_blk_config seg_max value is read from the device and
incremented by 2 to account for the request header and status byte
descriptors added by the driver.

In preparation for supporting untrusted virtio-blk devices, protect
against integer overflow and limit the value to a safe maximum.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Link: https://lore.kernel.org/r/20210524154020.98195-1-stefanha@redhat.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2021-07-03 04:50:53 -04:00
..
aoe for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
drbd for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
mtip32xx mtip32xx: remove unnecessary oom message 2021-06-09 09:41:51 -06:00
null_blk nullb: use blk_mq_alloc_disk 2021-06-11 11:54:39 -06:00
paride pd: use blk_mq_alloc_disk and blk_cleanup_disk 2021-06-11 11:54:42 -06:00
rnbd RDMA v5.14 merge window Pull Request 2021-07-01 14:54:03 -07:00
rsxx for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
xen-blkback xen-blkback: fix compatibility bug with single page rings 2021-04-23 09:34:07 +02:00
zram block: move bd_mutex to struct gendisk 2021-06-01 07:44:32 -06:00
Kconfig swim: don't call blk_queue_bounce_limit 2021-04-06 09:29:47 -06:00
Makefile drivers/block: remove the umem driver 2021-03-24 06:57:40 -06:00
amiflop.c amiflop: use blk_mq_alloc_disk and blk_cleanup_disk 2021-06-11 11:54:43 -06:00
ataflop.c ataflop: use blk_mq_alloc_disk and blk_cleanup_disk 2021-06-11 11:54:43 -06:00
brd.c brd: convert to blk_alloc_disk/blk_cleanup_disk 2021-06-01 07:42:23 -06:00
cryptoloop.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 30 2019-05-24 17:27:10 +02:00
floppy.c for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
loop.c for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
loop.h loop: charge i/o to mem and blk cg 2021-06-29 10:53:50 -07:00
n64cart.c n64cart: convert to blk_alloc_disk 2021-06-01 07:42:24 -06:00
nbd.c nbd: use blk_mq_alloc_disk and blk_cleanup_disk 2021-06-11 11:53:03 -06:00
pktcdvd.c pktcdvd: convert to blk_alloc_disk/blk_cleanup_disk 2021-06-01 07:42:23 -06:00
ps3disk.c ps3disk: use blk_mq_alloc_disk 2021-06-11 11:53:02 -06:00
ps3vram.c ps3vram: convert to blk_alloc_disk/blk_cleanup_disk 2021-06-01 07:42:24 -06:00
rbd.c rbd: use blk_mq_alloc_disk and blk_cleanup_disk 2021-06-11 11:54:42 -06:00
rbd_types.h libceph, rbd: replace zero-length array with flexible-array 2020-06-01 13:22:53 +02:00
sunvdc.c for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
swim.c swim: use blk_mq_alloc_disk 2021-06-11 11:53:03 -06:00
swim3.c swim3: use blk_mq_alloc_disk 2021-06-11 11:53:02 -06:00
swim_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
sx8.c for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
virtio_blk.c virtio-blk: limit seg_max to a safe value 2021-07-03 04:50:53 -04:00
xen-blkfront.c xen-blkfront: use blk_mq_alloc_disk and blk_cleanup_disk 2021-06-11 11:54:42 -06:00
z2ram.c for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00