Message ID | 20240917114313.616836-2-stefanha@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [PULL,1/1] hw/block: fix uint32 overflow | expand |
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 73bdfd6122..115795392c 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -700,7 +700,7 @@ static int virtio_blk_handle_zone_mgmt(VirtIOBlockReq *req, BlockZoneOp op) } else { if (bs->bl.zone_size > capacity - offset) { /* The zoned device allows the last smaller zone. */ - len = capacity - bs->bl.zone_size * (bs->bl.nr_zones - 1); + len = capacity - bs->bl.zone_size * (bs->bl.nr_zones - 1ull); } else { len = bs->bl.zone_size; }