You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fuzz/README.md
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,45 @@ which evaluates to the following command `cargo +nightly fuzz run fuzz_host_prin
10
10
11
11
As per Microsoft's Offensive Research & Security Engineering (MORSE) team, all host exposed functions that receive or interact with guest data must be continuously fuzzed for, at least, 500 million fuzz test cases without any crashes. Because `cargo-fuzz` doesn't support setting a maximum number of iterations; instead, we use the `--max_total_time` flag to set a maximum time to run the fuzzer. We have a GitHub action (acting like a CRON job) that runs the fuzzers for 24 hours every week.
12
12
13
-
Currently, we fuzz the parameters and return type to a hardcoded `PrintOutput` guest function, the `HostPrint` host function, the packed virtqueue ring parser, and canonical ring image validation. We plan to add more fuzzers in the future.
13
+
Targets cover guest and host calls, printing, tracing, packed-ring parsing,
14
+
canonical ring images, malformed consumer I/O, and producer/consumer round trips.
15
+
16
+
## Malformed virtqueues
17
+
18
+
`fuzz_virtq_malformed` exercises ring parsing, canonical images, and
19
+
`VirtqConsumer` without a producer. Ring metadata and payloads have separate
20
+
memory bounds. The consumer attempts at most eight polls per input, with two
21
+
read/write rounds of at most 256 bytes per received chain, followed by completion.
22
+
Consumer errors are accepted, including failed reads and reply writes.
23
+
Panics and sanitizer findings fail the run.
24
+
25
+
Inputs have a 16-byte header and 12-byte descriptor records. Descriptor addresses
26
+
use signed, wrapping offsets from the payload base. Header byte 13 selects the
27
+
I/O length minus one. Trailing three-byte records select a little-endian `u16`
28
+
offset and a replacement byte. Offsets wrap within the ring followed by the
29
+
payload. When available, one mutation runs before each poll, read, reply write,
30
+
and completion.
31
+
Mutations run on the same thread between calls.
32
+
33
+
```sh
34
+
just fuzz-timed fuzz_virtq_malformed 60
35
+
cargo test -p hyperlight-fuzz --bin fuzz_virtq_malformed
36
+
```
37
+
38
+
## Virtqueue round trip
39
+
40
+
`fuzz_virtq_roundtrip` checks one request/reply round trip without a VM. Inputs
41
+
vary the payloads, I/O chunk size, and spare reply capacity. A fixed queue of
42
+
16 descriptors and 64-byte pool slots exercises fragmented messages. The target
43
+
checks payload bytes, completion types, backpressure, and resource release.
44
+
45
+
Inputs have a four-byte header and at most 1024 payload bytes. The header selects
46
+
the request/reply split, I/O chunk size, and spare reply capacity.
47
+
The malformed target shares the memory backend and covers malformed descriptors.
0 commit comments