Skip to content

Commit 20b6949

Browse files
committed
renaming fuzz targets to start with fuzz_
Signed-off-by: Mark Rossett <marosset@microsoft.com>
1 parent 4e9dd68 commit 20b6949

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

.github/workflows/Fuzzing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
fuzzing:
1414
uses: ./.github/workflows/dep_fuzzing.yml
1515
with:
16-
targets: '["host_print", "guest_call", "host_call"]' # Pass as a JSON array
16+
targets: '["fuzz_host_print", "fuzz_guest_call", "fuzz_host_call"]' # Pass as a JSON array
1717
max_total_time: 18000 # 5 hours in seconds
1818
secrets: inherit

.github/workflows/ValidatePullRequest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- docs-pr
5555
uses: ./.github/workflows/dep_fuzzing.yml
5656
with:
57-
targets: '["host_print", "guest_call", "host_call"]' # Pass as a JSON array
57+
targets: '["fuzz_host_print", "fuzz_guest_call", "fuzz_host_call"]' # Pass as a JSON array
5858
max_total_time: 300 # 5 minutes in seconds
5959
docs_only: ${{needs.docs-pr.outputs.docs-only}}
6060
secrets: inherit

Justfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,10 @@ fuzz fuzz-target:
198198
# Fuzzes the given target. Stops after `max_time` seconds
199199
fuzz-timed fuzz-target max_time:
200200
cargo +nightly fuzz run {{ fuzz-target }} --release -- -max_total_time={{ max_time }}
201+
202+
# Builds fuzzers for submission to external fuzzing services
203+
build-fuzzers: (build-fuzzer "fuzz_guest_call") (build-fuzzer "fuzz_host_call") (build-fuzzer "fuzz_host_print")
204+
205+
# Builds the given fuzzer
206+
build-fuzzer fuzz-target:
207+
cargo +nightly fuzz build {{ fuzz-target }} --release -s none

fuzz/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ hyperlight-testing = { workspace = true }
1313
hyperlight-host = { workspace = true, default-features = true, features = ["fuzzing"]}
1414

1515
[[bin]]
16-
name = "host_print"
16+
name = "fuzz_host_print"
1717
path = "fuzz_targets/host_print.rs"
1818
test = false
1919
doc = false
2020
bench = false
2121

2222
[[bin]]
23-
name = "guest_call"
23+
name = "fuzz_guest_call"
2424
path = "fuzz_targets/guest_call.rs"
2525
test = false
2626
doc = false
2727
bench = false
2828

2929
[[bin]]
30-
name = "host_call"
30+
name = "fuzz_host_call"
3131
path = "fuzz_targets/host_call.rs"
3232
test = false
3333
doc = false

fuzz/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You can run the fuzzers with:
66
```sh
77
just fuzz <fuzz_target>
88
```
9-
which evaluates to the following command `cargo +nightly fuzz run host_print --release`. We use the release profile to make sure the release-optimized guest is used. The default fuzz profile which is release+debugsymbols would cause our debug guests to be loaded, since we currently determine which test guest to load based on whether debug symbols are present.
9+
which evaluates to the following command `cargo +nightly fuzz run fuzz_host_print --release`. We use the release profile to make sure the release-optimized guest is used. The default fuzz profile which is release+debugsymbols would cause our debug guests to be loaded, since we currently determine which test guest to load based on whether debug symbols are present.
1010

1111
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.
1212

0 commit comments

Comments
 (0)