mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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>