mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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>
14 lines
342 B
Rust
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;
|