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 15:51:09 -07:00
2021-06-24 18:49:01 -06:00
2021-06-30 15:51:09 -07:00
2021-06-30 15:51:09 -07:00
2021-04-18 09:36:56 +03:00
2021-06-12 12:13:55 -07:00
2021-06-11 11:53:03 -06:00
2021-06-29 10:53:48 -07:00
2021-06-16 09:03:52 -07:00
2021-04-26 12:11:52 -07:00
2021-06-30 11:15:39 -07:00
2021-07-01 12:53:43 -07:00
2021-06-29 11:21:35 -07:00
2021-05-01 10:14:08 -07:00
2021-06-29 13:39:41 -07:00
2021-06-30 11:15:39 -07:00
2021-06-30 15:51:09 -07:00
2021-06-30 12:12:56 -07:00
2021-06-30 11:15:39 -07:00
2021-06-30 12:12:56 -07:00
2021-06-30 12:21:16 -07:00
2021-07-01 12:53:43 -07:00
2021-05-05 12:53:16 -07:00
2021-05-04 11:13:33 -07:00
2021-06-01 16:44:09 +01:00
2021-06-30 15:51:09 -07:00
2021-06-30 12:12:56 -07:00
2021-06-28 12:14:19 -07:00
2021-06-30 15:51:09 -07:00
2021-06-23 10:07:48 +10:00
2021-06-16 08:53:58 -06:00
2021-06-29 11:21:35 -07:00