Files
cloud-hypervisor/block
Anatol Belski af1d69a9dd block: Reject discard requests with flags set
The virtio spec v1.2 in 5.2.6.2 requires that the device
MUST return VIRTIO_BLK_S_UNSUPP for discard commands if the
unmap flag is set or if any unknown flag is set.

The discard handler was not reading the flags field at all,
silently accepting requests with arbitrary flags. Read and
validate the flags, rejecting any non-zero value with
VIRTIO_BLK_S_UNSUPP.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-03-31 13:11:15 +00:00
..