Files
cloud-hypervisor/block/src/formats/vhd/worker/mod.rs
Alexander Lvov e0801bda3b block: vhd: fix incomplete bounds check in sync I/O worker
The sync I/O worker only checked that the operation offset did
not start past the end of the virtual disk (offset >= size) -
did not verify that the operation end (offset + len) stays
within bounds.

A read or write that started inside the image but extended
beyond the logical size was silently passed to the raw backend.

The async io_uring worker already had the correct check
(offset + len > size with overflow protection). I extracted it
into a shared helper in worker/common.rs and reused inside the
sync path to eliminate duplication and close the gap.

Fixes #8311

Signed-off-by: Alexander Lvov <alexander.lvov.git@gmail.com>
2026-06-17 14:26:25 +00:00

14 lines
342 B
Rust

// Copyright 2026 The Cloud Hypervisor Authors. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
//! Sync/async I/O workers for fixed VHD images.
//!
//! Thin wrappers around the raw workers that clamp I/O to the
//! virtual disk size.
#[cfg(feature = "io_uring")]
pub(crate) mod async_uring;
mod common;
pub(crate) mod sync;