cloud-hypervisor/fuzz/fuzz_targets
Demi Marie Obenour 42522a88c0 misc: do not use u64 to represent host pointers
To ensure that struct sizes are the same on 32-bit and 64-bit, various
kernel APIs use __u64 (Rust u64) to represent userspace pointers.
Userspace is expected to cast pointers to __u64 before passing them to
the kernel, and cast kernel-provided __u64 to a pointer before using
them.  However, various safe APIs in Cloud Hypervisor took
caller-provided u64 values and passed them to syscalls that interpret
them as userspace addresses.  Therefore, passing bad u64 values would
cause memory disclosure or corruption.

Fix the bug by using usize and pointer types as appropriate.  To make
soundness of the code easier to reason about, the PCI code gains a new
MmapRegion abstraction that ensures the validity of pointers.  The rest
of the code already has an MmapRegion abstraction it can use.  To avoid
having to reason about whether something is keeping the MmapRegion
alive, reference counting is added.  MmapRegion cannot hold references
to other objects, so the reference counting cannot introduce cycles.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2025-11-22 10:24:13 +00:00
..
balloon.rs fuzz: explicitly keep or reject fuzzer corpus 2024-12-31 19:49:48 +00:00
block.rs fuzz: explicitly keep or reject fuzzer corpus 2024-12-31 19:49:48 +00:00
cmos.rs fuzz: explicitly keep or reject fuzzer corpus 2024-12-31 19:49:48 +00:00
console.rs fuzz: explicitly keep or reject fuzzer corpus 2024-12-31 19:49:48 +00:00
http_api.rs misc: Remove SGX support from Cloud Hypervisor 2025-09-05 18:08:36 +00:00
iommu.rs virtio-devices: iommu: allow limiting maximum address width in bits 2025-01-14 21:31:47 +00:00
linux_loader.rs misc: Further improve imports styling 2024-09-29 16:13:48 +00:00
linux_loader_cmdline.rs fuzz: explicitly keep or reject fuzzer corpus 2024-12-31 19:49:48 +00:00
mem.rs fuzz: explicitly keep or reject fuzzer corpus 2024-12-31 19:49:48 +00:00
net.rs fuzz: explicitly keep or reject fuzzer corpus 2024-12-31 19:49:48 +00:00
pmem.rs misc: do not use u64 to represent host pointers 2025-11-22 10:24:13 +00:00
qcow.rs fuzz: explicitly keep or reject fuzzer corpus 2024-12-31 19:49:48 +00:00
rng.rs fuzz: explicitly keep or reject fuzzer corpus 2024-12-31 19:49:48 +00:00
serial.rs build: Apply cargo fmt check to fuzz workspace 2024-09-29 13:08:12 +01:00
vhdx.rs fuzz: explicitly keep or reject input for vhdx fuzzer 2025-01-08 22:45:58 +00:00
vsock.rs tests: streamline module names to unit_tests 2025-11-20 21:15:03 +00:00
watchdog.rs fuzz: explicitly keep or reject fuzzer corpus 2024-12-31 19:49:48 +00:00
x86emul.rs fuzz: introduce an x86 instruction emulator fuzzer 2025-01-02 22:43:59 +00:00