Message ID | 20241212104212.513947-2-gerben@altlinux.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | parallels: fix ext_off assertion failure due to overflow | expand |
diff --git a/block/parallels.c b/block/parallels.c index 9205a0864f..8f2b58e1c9 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -1298,6 +1298,10 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags, error_setg(errp, "Catalog too large"); return -EFBIG; } + if (le64_to_cpu(ph.ext_off) >= (INT64_MAX >> BDRV_SECTOR_BITS)) { + error_setg(errp, "Invalid image: Too big offset"); + return -EFBIG; + } size = bat_entry_off(s->bat_size); s->header_size = ROUND_UP(size, bdrv_opt_mem_align(bs->file->bs));