[Devel] [PATCH hci-8.1] dm-qcow2: reject v3 images with header_length below 104
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Mon Nov 16 13:40:47 MSK 2026
> qcow2_check_convert_hdr() checks header_length only when the
> compression bit is set, and only against sizeof(struct QCowHeader). A
> v3 image with header_length below the fixed v3 header size is
> accepted, and the header extension parser then starts at
> header_length and reads the fixed header fields as extensions.
>
> The driver used to refuse such images, but the check went under the
> compression bit when zstd support was added.
>
> Fail with -EINVAL when a v3 image has header_length below 104,
> regardless of its incompatible features, as qemu does ("qcow2 header
> too short").
>
> Fixes: 66195f78dd3c ("dm-qcow2: add zstd decompression")
> https://virtuozzo.atlassian.net/browse/VSTOR-152393
> Feature: dm-qcow2: block device over QCOW2 files driver
>
> Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261116103752.2878746-1-alexander.ivanov@virtuozzo.com?part=1
More information about the Devel
mailing list