From: "Denis V. Lunev" <den@openvz.org>
To: qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: den@openvz.org, Thomas Huth <thuth@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [PULL v2 1/9] parallels: fix integer overflow in header size calculation
Date: Tue, 28 Jul 2026 17:38:41 +0200 [thread overview]
Message-ID: <20260728153849.601939-2-den@openvz.org> (raw)
In-Reply-To: <20260728153849.601939-1-den@openvz.org>
parallels_open() caches bat_entry_off(s->bat_size) - a uint32_t -
in a plain int before it feeds into s->header_size. Near the
"Catalog too large" bound the value exceeds INT_MAX and overflows
on assignment.
Match the cached value's type to bat_entry_off()'s return type.
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Thomas Huth <thuth@redhat.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
---
block/parallels.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/parallels.c b/block/parallels.c
index 7a90fb5220..59f00c64a6 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -1240,7 +1240,8 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
{
BDRVParallelsState *s = bs->opaque;
ParallelsHeader ph;
- int ret, size, i;
+ int ret, i;
+ uint32_t size;
int64_t file_nb_sectors, sector;
uint32_t data_start;
bool need_check = false;
--
2.53.0
next prev parent reply other threads:[~2026-07-28 15:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 15:38 [PULL v2 0/9] parallels: fix reachable assertion and related bounds-checking gaps Denis V. Lunev
2026-07-28 15:38 ` Denis V. Lunev [this message]
2026-07-28 15:38 ` [PULL v2 2/9] parallels: read header/BAT table in bounded chunks Denis V. Lunev
2026-07-28 15:38 ` [PULL v2 3/9] parallels: fix bat_entries overflow in image creation Denis V. Lunev
2026-07-28 15:38 ` [PULL v2 4/9] parallels: reject BAT entries pointing outside backed storage Denis V. Lunev
2026-07-28 15:38 ` [PULL v2 5/9] parallels: validate bitmap L1 table size before allocating it Denis V. Lunev
2026-07-28 15:38 ` [PULL v2 6/9] parallels: skip loading a genuinely empty bitmap L1 table Denis V. Lunev
2026-07-28 15:38 ` [PULL v2 7/9] parallels: avoid fatal abort on large " Denis V. Lunev
2026-07-28 15:38 ` [PULL v2 8/9] parallels: validate BAT capacity against advertised disk size Denis V. Lunev
2026-07-28 15:38 ` [PULL v2 9/9] MAINTAINERS: update parallels tree location Denis V. Lunev
2026-07-29 10:13 ` [PULL v2 0/9] parallels: fix reachable assertion and related bounds-checking gaps Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260728153849.601939-2-den@openvz.org \
--to=den@openvz.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.