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
..
2021-06-30 12:21:16 -07:00
2021-06-30 12:21:16 -07:00
2021-06-11 11:54:39 -06:00
2021-07-01 14:54:03 -07:00
2021-06-30 12:21:16 -07:00
2021-06-30 12:21:16 -07:00
2021-06-30 12:21:16 -07:00
2021-06-29 10:53:50 -07:00
2021-03-24 06:57:40 -06:00
2021-06-01 07:42:24 -06:00
2021-06-11 11:53:02 -06:00
2021-06-30 12:21:16 -07:00
2021-06-11 11:53:02 -06:00
2021-06-11 11:53:03 -06:00
2021-06-30 12:21:16 -07:00
2021-06-30 12:21:16 -07:00