From 981f304f8410a049645524f98e43c2adf535c2bc Mon Sep 17 00:00:00 2001 From: Dennis Kempin Date: Tue, 16 May 2023 10:19:30 -0700 Subject: [PATCH] fuzz: Move fuzzers to standard `cargo fuzz` location This simplifies `cargo fuzz` usage. Fuzzers can be built with `cargo fuzz build` without any other arguments. BUG=b:279217867 TEST=`cargo fuzz build` Change-Id: I11b8a8ba4c2b3e2d1a42973699e4d9c3920635b6 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4540001 Commit-Queue: Dennis Kempin Reviewed-by: Daniel Verkamp --- Cargo.toml | 2 +- crosvm-fuzz/OWNERS | 1 - {crosvm-fuzz => fuzz}/.gitignore | 1 + {crosvm-fuzz => fuzz}/Cargo.toml | 44 ++++++++++++------- .../fuzz_targets}/block_fuzzer.rs | 0 .../fuzz_targets}/fs_server_fuzzer.rs | 0 .../fuzz_targets}/p9_tframe_fuzzer.rs | 0 .../fuzz_targets}/qcow_fuzzer.rs | 0 .../fuzz_targets}/usb_descriptor_fuzzer.rs | 0 .../fuzz_targets}/virtqueue_fuzzer.rs | 0 .../fuzz_targets}/zimage_fuzzer.rs | 0 {crosvm-fuzz => fuzz}/src/lib.rs | 0 {crosvm-fuzz => fuzz}/src/rand.rs | 0 13 files changed, 31 insertions(+), 17 deletions(-) delete mode 100644 crosvm-fuzz/OWNERS rename {crosvm-fuzz => fuzz}/.gitignore (72%) rename {crosvm-fuzz => fuzz}/Cargo.toml (53%) rename {crosvm-fuzz => fuzz/fuzz_targets}/block_fuzzer.rs (100%) rename {crosvm-fuzz => fuzz/fuzz_targets}/fs_server_fuzzer.rs (100%) rename {crosvm-fuzz => fuzz/fuzz_targets}/p9_tframe_fuzzer.rs (100%) rename {crosvm-fuzz => fuzz/fuzz_targets}/qcow_fuzzer.rs (100%) rename {crosvm-fuzz => fuzz/fuzz_targets}/usb_descriptor_fuzzer.rs (100%) rename {crosvm-fuzz => fuzz/fuzz_targets}/virtqueue_fuzzer.rs (100%) rename {crosvm-fuzz => fuzz/fuzz_targets}/zimage_fuzzer.rs (100%) rename {crosvm-fuzz => fuzz}/src/lib.rs (100%) rename {crosvm-fuzz => fuzz}/src/rand.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 257f039e53..9ac3e5fe3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,11 +53,11 @@ members = [ "crosvm_cli", "crosvm_control", "crosvm_plugin", - "crosvm-fuzz", "devices", "disk", "e2e_tests", "fuse", + "fuzz", "gpu_display", "hypervisor", "io_uring", diff --git a/crosvm-fuzz/OWNERS b/crosvm-fuzz/OWNERS deleted file mode 100644 index dcd119abbd..0000000000 --- a/crosvm-fuzz/OWNERS +++ /dev/null @@ -1 +0,0 @@ -denniskempin@chromium.org diff --git a/crosvm-fuzz/.gitignore b/fuzz/.gitignore similarity index 72% rename from crosvm-fuzz/.gitignore rename to fuzz/.gitignore index a0925114d6..1a45eee776 100644 --- a/crosvm-fuzz/.gitignore +++ b/fuzz/.gitignore @@ -1,3 +1,4 @@ target corpus artifacts +coverage diff --git a/crosvm-fuzz/Cargo.toml b/fuzz/Cargo.toml similarity index 53% rename from crosvm-fuzz/Cargo.toml rename to fuzz/Cargo.toml index 4d621099d5..dc039b862c 100644 --- a/crosvm-fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "crosvm-fuzz" version = "0.0.1" -authors = ["The ChromiumOS Authors"] +publish = false edition = "2021" [package.metadata] @@ -31,30 +31,44 @@ libfuzzer-sys = "=0.4.4" default = ["disk/qcow"] [[bin]] -name = "crosvm_block_fuzzer" -path = "block_fuzzer.rs" +name = "block_fuzzer" +path = "fuzz_targets/block_fuzzer.rs" +test = false +doc = false [[bin]] -name = "crosvm_fs_server_fuzzer" -path = "fs_server_fuzzer.rs" +name = "fs_server_fuzzer" +path = "fuzz_targets/fs_server_fuzzer.rs" +test = false +doc = false [[bin]] -name = "crosvm_qcow_fuzzer" -path = "qcow_fuzzer.rs" +name = "p9_tframe_fuzzer" +path = "fuzz_targets/p9_tframe_fuzzer.rs" +test = false +doc = false [[bin]] -name = "crosvm_usb_descriptor_fuzzer" -path = "usb_descriptor_fuzzer.rs" +name = "qcow_fuzzer" +path = "fuzz_targets/qcow_fuzzer.rs" +test = false +doc = false [[bin]] -name = "crosvm_virtqueue_fuzzer" -path = "virtqueue_fuzzer.rs" +name = "usb_descriptor_fuzzer" +path = "fuzz_targets/usb_descriptor_fuzzer.rs" +test = false +doc = false [[bin]] -name = "crosvm_zimage_fuzzer" -path = "zimage_fuzzer.rs" +name = "virtqueue_fuzzer" +path = "fuzz_targets/virtqueue_fuzzer.rs" +test = false +doc = false [[bin]] -name = "crosvm_p9_tframe_fuzzer" -path = "p9_tframe_fuzzer.rs" +name = "zimage_fuzzer" +path = "fuzz_targets/zimage_fuzzer.rs" +test = false +doc = false diff --git a/crosvm-fuzz/block_fuzzer.rs b/fuzz/fuzz_targets/block_fuzzer.rs similarity index 100% rename from crosvm-fuzz/block_fuzzer.rs rename to fuzz/fuzz_targets/block_fuzzer.rs diff --git a/crosvm-fuzz/fs_server_fuzzer.rs b/fuzz/fuzz_targets/fs_server_fuzzer.rs similarity index 100% rename from crosvm-fuzz/fs_server_fuzzer.rs rename to fuzz/fuzz_targets/fs_server_fuzzer.rs diff --git a/crosvm-fuzz/p9_tframe_fuzzer.rs b/fuzz/fuzz_targets/p9_tframe_fuzzer.rs similarity index 100% rename from crosvm-fuzz/p9_tframe_fuzzer.rs rename to fuzz/fuzz_targets/p9_tframe_fuzzer.rs diff --git a/crosvm-fuzz/qcow_fuzzer.rs b/fuzz/fuzz_targets/qcow_fuzzer.rs similarity index 100% rename from crosvm-fuzz/qcow_fuzzer.rs rename to fuzz/fuzz_targets/qcow_fuzzer.rs diff --git a/crosvm-fuzz/usb_descriptor_fuzzer.rs b/fuzz/fuzz_targets/usb_descriptor_fuzzer.rs similarity index 100% rename from crosvm-fuzz/usb_descriptor_fuzzer.rs rename to fuzz/fuzz_targets/usb_descriptor_fuzzer.rs diff --git a/crosvm-fuzz/virtqueue_fuzzer.rs b/fuzz/fuzz_targets/virtqueue_fuzzer.rs similarity index 100% rename from crosvm-fuzz/virtqueue_fuzzer.rs rename to fuzz/fuzz_targets/virtqueue_fuzzer.rs diff --git a/crosvm-fuzz/zimage_fuzzer.rs b/fuzz/fuzz_targets/zimage_fuzzer.rs similarity index 100% rename from crosvm-fuzz/zimage_fuzzer.rs rename to fuzz/fuzz_targets/zimage_fuzzer.rs diff --git a/crosvm-fuzz/src/lib.rs b/fuzz/src/lib.rs similarity index 100% rename from crosvm-fuzz/src/lib.rs rename to fuzz/src/lib.rs diff --git a/crosvm-fuzz/src/rand.rs b/fuzz/src/rand.rs similarity index 100% rename from crosvm-fuzz/src/rand.rs rename to fuzz/src/rand.rs