mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
The qcow2 spec requires the backing file name string to live in the remaining space between the end of the header extension area and the end of the first cluster. Header parsing accepted any backing file offset above zero, including offsets pointing into the fixed header fields themselves, so a corrupt or malicious image could redirect the parser into reinterpreting header bytes as the backing path. Reject any backing_file_offset that is less than header.header_size via a new BackingFileOverlapsHeader error. The check fires before the existing first cluster bound, since an overlap is a different class of corruption and deserves a distinct diagnostic. Ref: #8261 Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>