vm-virtio: Add centralized descriptor range validation

Introduce a CheckedDescriptorIter adapter over DescriptorChain that
validates each descriptor's translated (addr, len) range against guest
memory before yielding it. Any descriptor whose buffer is not fully
backed by guest RAM is rejected, so the device never performs I/O
against memory the guest does not actually own.

The helper lives in vm-virtio so it can be shared across the
virtio-devices and block crates, both of which already depend on
vm-virtio.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-05-13 14:26:39 +02:00
committed by Rob Bradford
parent e033b593d9
commit 4c6d60f162
4 changed files with 181 additions and 0 deletions

1
Cargo.lock generated
View File

@@ -2692,6 +2692,7 @@ dependencies = [
name = "vm-virtio"
version = "0.1.0"
dependencies = [
"log",
"virtio-queue",
"vm-memory",
]