2020-07-16 14:44:36 +00:00
|
|
|
[package]
|
|
|
|
authors = ["Automatically generated"]
|
2022-04-08 15:11:04 +00:00
|
|
|
edition = "2021"
|
2024-05-08 08:56:31 +00:00
|
|
|
name = "cloud-hypervisor-fuzz"
|
|
|
|
publish = false
|
|
|
|
version = "0.0.0"
|
2020-07-16 14:44:36 +00:00
|
|
|
|
|
|
|
[package.metadata]
|
|
|
|
cargo-fuzz = true
|
|
|
|
|
2023-10-05 01:07:45 +00:00
|
|
|
[features]
|
|
|
|
igvm = []
|
devices: Add pvmemcontrol device
Pvmemcontrol provides a way for the guest to control its physical memory
properties, and enables optimizations and security features. For
example, the guest can provide information to the host where parts of a
hugepage may be unbacked, or sensitive data may not be swapped out, etc.
Pvmemcontrol allows guests to manipulate its gPTE entries in the SLAT,
and also some other properties of the memory map the back's host memory.
This is achieved by using the KVM_CAP_SYNC_MMU capability. When this
capability is available, the changes in the backing of the memory region
on the host are automatically reflected into the guest. For example, an
mmap() or madvise() that affects the region will be made visible
immediately.
There are two components of the implementation: the guest Linux driver
and Virtual Machine Monitor (VMM) device. A guest-allocated shared
buffer is negotiated per-cpu through a few PCI MMIO registers, the VMM
device assigns a unique command for each per-cpu buffer. The guest
writes its pvmemcontrol request in the per-cpu buffer, then writes the
corresponding command into the command register, calling into the VMM
device to perform the pvmemcontrol request.
The synchronous per-cpu shared buffer approach avoids the kick and busy
waiting that the guest would have to do with virtio virtqueue transport.
The Cloud Hypervisor component can be enabled with --pvmemcontrol.
Co-developed-by: Stanko Novakovic <stanko@google.com>
Co-developed-by: Pasha Tatashin <tatashin@google.com>
Signed-off-by: Yuanchu Xie <yuanchu@google.com>
2023-10-25 22:46:47 +00:00
|
|
|
pvmemcontrol = []
|
2023-10-05 01:07:45 +00:00
|
|
|
|
2020-07-16 14:44:36 +00:00
|
|
|
[dependencies]
|
2023-07-12 02:24:28 +00:00
|
|
|
block = { path = "../block" }
|
2022-07-26 15:30:56 +00:00
|
|
|
devices = { path = "../devices" }
|
2024-04-06 07:47:54 +00:00
|
|
|
epoll = "4.3.3"
|
2024-05-21 23:36:55 +00:00
|
|
|
libc = "0.2.155"
|
2023-08-11 23:19:24 +00:00
|
|
|
libfuzzer-sys = "0.4.7"
|
2024-11-04 01:27:09 +00:00
|
|
|
linux-loader = { version = "0.13.0", features = ["bzimage", "elf", "pe"] }
|
2022-07-29 00:07:32 +00:00
|
|
|
micro_http = { git = "https://github.com/firecracker-microvm/micro-http", branch = "main" }
|
2022-11-23 23:23:00 +00:00
|
|
|
net_util = { path = "../net_util" }
|
2023-12-13 23:45:07 +00:00
|
|
|
once_cell = "1.19.0"
|
2023-10-30 18:31:10 +00:00
|
|
|
seccompiler = "0.4.0"
|
2020-07-20 15:41:40 +00:00
|
|
|
virtio-devices = { path = "../virtio-devices" }
|
2024-11-04 01:27:09 +00:00
|
|
|
virtio-queue = "0.14.0"
|
2024-05-08 08:56:31 +00:00
|
|
|
vm-device = { path = "../vm-device" }
|
2024-11-04 01:27:09 +00:00
|
|
|
vm-memory = "0.16.0"
|
vmm: use trait objects for API actions
Uses of the old ApiRequest enum conflated two different concerns:
identifying an API request endpoint, and storing data for an API
request. This led to ApiRequest values being passed around with junk
data just to communicate a request type, which forced all API request
body types to implement Default, which in some cases doesn't make any
sense — what's the "default" path for a vhost-user socket? The
nonsensical Default values have led to tests relying on being able to
use nonsensical data, which is an impediment to adding better
validation for these types.
Rather than having API request types be represented by an enum, which
has to carry associated body data everywhere it's used, it makes more
sense to represent API request types as trait objects. These can have
an associated type for the type of the request body, and this makes it
possible to pass API request types and data around as siblings in a
type-safe way without forcing them into a single value even where it
doesn't make sense. Trait objects also give us dynamic dispatch,
which lets us get rid of several large match blocks.
To keep it possible to fuzz the HTTP API, all the Vmm methods called
by the HTTP API are pulled out into a trait, so the fuzzer can provide
its own stub implementation of the VMM.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
2024-01-05 14:08:53 +00:00
|
|
|
vm-migration = { path = "../vm-migration" }
|
2022-07-26 15:30:56 +00:00
|
|
|
vm-virtio = { path = "../vm-virtio" }
|
2024-05-08 08:56:31 +00:00
|
|
|
vmm = { path = "../vmm", features = ["guest_debug"] }
|
|
|
|
vmm-sys-util = "0.12.1"
|
2020-07-16 14:44:36 +00:00
|
|
|
|
|
|
|
# Prevent this from interfering with workspaces
|
|
|
|
[workspace]
|
|
|
|
members = ["."]
|
|
|
|
|
2022-09-16 20:35:09 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-09-16 20:35:09 +00:00
|
|
|
name = "balloon"
|
|
|
|
path = "fuzz_targets/balloon.rs"
|
|
|
|
test = false
|
|
|
|
|
2020-07-16 14:44:36 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-07-27 09:35:22 +00:00
|
|
|
name = "block"
|
|
|
|
path = "fuzz_targets/block.rs"
|
2020-07-16 14:44:36 +00:00
|
|
|
test = false
|
2020-07-20 15:41:40 +00:00
|
|
|
|
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-07-27 09:35:22 +00:00
|
|
|
name = "cmos"
|
|
|
|
path = "fuzz_targets/cmos.rs"
|
2020-07-20 15:41:40 +00:00
|
|
|
test = false
|
2021-08-02 15:51:36 +00:00
|
|
|
|
2022-11-01 20:39:45 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-11-01 20:39:45 +00:00
|
|
|
name = "console"
|
|
|
|
path = "fuzz_targets/console.rs"
|
|
|
|
test = false
|
|
|
|
|
2022-07-29 00:07:32 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-07-29 00:07:32 +00:00
|
|
|
name = "http_api"
|
|
|
|
path = "fuzz_targets/http_api.rs"
|
|
|
|
test = false
|
|
|
|
|
2022-10-18 22:12:55 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-10-18 22:12:55 +00:00
|
|
|
name = "iommu"
|
|
|
|
path = "fuzz_targets/iommu.rs"
|
|
|
|
test = false
|
|
|
|
|
2022-12-06 00:53:13 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-12-06 00:53:13 +00:00
|
|
|
name = "linux_loader"
|
|
|
|
path = "fuzz_targets/linux_loader.rs"
|
|
|
|
test = false
|
|
|
|
|
2022-12-07 19:32:14 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-12-07 19:32:14 +00:00
|
|
|
name = "linux_loader_cmdline"
|
|
|
|
path = "fuzz_targets/linux_loader_cmdline.rs"
|
|
|
|
test = false
|
|
|
|
|
2022-10-11 01:18:19 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-10-11 01:18:19 +00:00
|
|
|
name = "mem"
|
|
|
|
path = "fuzz_targets/mem.rs"
|
|
|
|
test = false
|
|
|
|
|
2022-11-23 23:23:00 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-11-23 23:23:00 +00:00
|
|
|
name = "net"
|
|
|
|
path = "fuzz_targets/net.rs"
|
|
|
|
test = false
|
|
|
|
|
2022-09-12 23:46:44 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-09-12 23:46:44 +00:00
|
|
|
name = "pmem"
|
|
|
|
path = "fuzz_targets/pmem.rs"
|
|
|
|
test = false
|
|
|
|
|
2021-08-02 15:51:36 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-07-27 09:35:22 +00:00
|
|
|
name = "qcow"
|
|
|
|
path = "fuzz_targets/qcow.rs"
|
2021-08-02 15:51:36 +00:00
|
|
|
test = false
|
2022-07-26 15:30:56 +00:00
|
|
|
|
2022-09-19 23:43:10 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-09-19 23:43:10 +00:00
|
|
|
name = "rng"
|
|
|
|
path = "fuzz_targets/rng.rs"
|
|
|
|
test = false
|
|
|
|
|
2022-07-26 15:30:56 +00:00
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-07-26 15:30:56 +00:00
|
|
|
name = "serial"
|
|
|
|
path = "fuzz_targets/serial.rs"
|
|
|
|
test = false
|
2022-07-26 15:30:56 +00:00
|
|
|
|
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-07-27 09:35:22 +00:00
|
|
|
name = "vhdx"
|
|
|
|
path = "fuzz_targets/vhdx.rs"
|
2022-07-26 15:30:56 +00:00
|
|
|
test = false
|
2022-09-15 23:16:16 +00:00
|
|
|
|
|
|
|
[[bin]]
|
2024-05-08 08:56:31 +00:00
|
|
|
doc = false
|
2022-09-15 23:16:16 +00:00
|
|
|
name = "watchdog"
|
|
|
|
path = "fuzz_targets/watchdog.rs"
|
|
|
|
test = false
|