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 entirely within the first cluster, between the end of the header extension area and the cluster boundary. The parser previously only validated the 1023 byte cap on the name length and accepted any backing_file_offset, so a corrupt or malicious image could place the name string anywhere in the file. Add the cluster bound check in QcowHeader::new and report it via a new BackingFileOutsideFirstCluster error. Fixes: #8261 Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>