From afbdc02c54ce06f4dac5ab8e24031bdcab2f4ced Mon Sep 17 00:00:00 2001 From: Mrmaxmeier <3913977+Mrmaxmeier@users.noreply.github.com> Date: Fri, 26 Jul 2024 10:03:10 +0200 Subject: [PATCH] Format all tomls with `taplo fmt` (#2436) Co-authored-by: Dominik Maier --- Cargo.toml | 74 ++--- bindings/pylibafl/Cargo.toml | 12 +- bindings/pylibafl/pyproject.toml | 10 +- fuzzers/baby/baby_fuzzer/Cargo.toml | 5 +- fuzzers/baby/baby_fuzzer_gramatron/Cargo.toml | 9 +- fuzzers/baby/baby_fuzzer_grimoire/Cargo.toml | 5 +- .../baby/baby_fuzzer_minimizing/Cargo.toml | 6 +- fuzzers/baby/baby_fuzzer_multi/Cargo.toml | 6 +- fuzzers/baby/baby_fuzzer_nautilus/Cargo.toml | 5 +- .../baby_fuzzer_swap_differential/Cargo.toml | 7 +- .../Makefile.toml | 24 +- fuzzers/baby/baby_fuzzer_tokens/Cargo.toml | 5 +- fuzzers/baby/baby_fuzzer_unicode/Cargo.toml | 5 +- fuzzers/baby/baby_fuzzer_wasm/Makefile.toml | 8 +- .../baby_fuzzer_with_forkexecutor/Cargo.toml | 5 +- fuzzers/baby/baby_no_std/Cargo.toml | 6 +- fuzzers/baby/baby_no_std/Makefile.toml | 25 +- .../forkserver_libafl_cc/Cargo.toml | 6 +- .../forkserver_libafl_cc/Makefile.toml | 44 +-- .../frida/frida_executable_libpng/Cargo.toml | 17 +- .../frida_executable_libpng/Makefile.toml | 48 ++-- fuzzers/frida/frida_gdiplus/Cargo.toml | 21 +- fuzzers/frida/frida_gdiplus/Makefile.toml | 40 +-- fuzzers/frida/frida_libpng/Cargo.toml | 24 +- fuzzers/frida/frida_libpng/Makefile.toml | 70 ++--- fuzzers/fuzzbench/fuzzbench/Cargo.toml | 11 +- fuzzers/fuzzbench/fuzzbench/Makefile.toml | 28 +- fuzzers/fuzzbench/fuzzbench_ctx/Cargo.toml | 12 +- fuzzers/fuzzbench/fuzzbench_ctx/Makefile.toml | 28 +- .../fuzzbench/fuzzbench_fork_qemu/Cargo.toml | 10 +- .../fuzzbench_fork_qemu/Makefile.toml | 47 ++-- .../fuzzbench/fuzzbench_forkserver/Cargo.toml | 5 +- .../fuzzbench_forkserver_cmplog/Cargo.toml | 7 +- fuzzers/fuzzbench/fuzzbench_qemu/Cargo.toml | 11 +- .../fuzzbench/fuzzbench_qemu/Makefile.toml | 45 ++-- fuzzers/fuzzbench/fuzzbench_text/Cargo.toml | 11 +- .../fuzzbench/fuzzbench_text/Makefile.toml | 34 +-- fuzzers/libpng/libfuzzer_libpng/Cargo.toml | 11 +- fuzzers/libpng/libfuzzer_libpng/Makefile.toml | 89 +++--- .../libfuzzer_libpng_accounting/Cargo.toml | 23 +- .../libfuzzer_libpng_accounting/Makefile.toml | 61 +++-- .../libfuzzer_libpng_centralized/Cargo.toml | 25 +- .../Makefile.toml | 61 +++-- .../libpng/libfuzzer_libpng_cmin/Cargo.toml | 12 +- .../libfuzzer_libpng_cmin/Makefile.toml | 91 ++++--- .../libfuzzer_libpng_launcher/Cargo.toml | 17 +- .../libfuzzer_libpng_launcher/Makefile.toml | 61 +++-- .../libfuzzer_libpng_norestart/Cargo.toml | 14 +- .../libfuzzer_libpng_norestart/Makefile.toml | 55 ++-- .../libfuzzer_libpng_tcp_manager/Cargo.toml | 11 +- .../Makefile.toml | 89 +++--- .../nyx/nyx_libxml2_parallel/Makefile.toml | 22 +- .../nyx/nyx_libxml2_standalone/Makefile.toml | 22 +- fuzzers/others/cargo_fuzz/Cargo.toml | 13 +- fuzzers/others/dynamic_analysis/Cargo.toml | 12 +- fuzzers/others/dynamic_analysis/Makefile.toml | 49 +++- fuzzers/others/libafl-fuzz/Cargo.toml | 17 +- fuzzers/others/libafl-fuzz/Makefile.toml | 26 +- fuzzers/others/libafl_atheris/Cargo.toml | 12 +- .../others/libfuzzer_libmozjpeg/Cargo.toml | 11 +- .../others/libfuzzer_libmozjpeg/Makefile.toml | 58 ++-- .../others/libfuzzer_windows_asan/Cargo.toml | 5 +- .../libfuzzer_windows_asan/Makefile.toml | 38 +-- fuzzers/others/nautilus_sync/Cargo.toml | 10 +- fuzzers/others/nautilus_sync/Makefile.toml | 65 +++-- fuzzers/others/push_harness/Cargo.toml | 5 +- fuzzers/others/push_stage_harness/Cargo.toml | 5 +- .../Cargo.toml | 35 ++- fuzzers/others/tinyinst_simple/Makefile.toml | 26 +- fuzzers/others/tutorial/Cargo.toml | 19 +- fuzzers/qemu/qemu_cmin/Cargo.toml | 19 +- fuzzers/qemu/qemu_cmin/Makefile.toml | 164 +++++------- fuzzers/qemu/qemu_coverage/Cargo.toml | 19 +- fuzzers/qemu/qemu_coverage/Makefile.toml | 162 +++++------ fuzzers/qemu/qemu_launcher/Cargo.toml | 22 +- fuzzers/qemu/qemu_launcher/Makefile.toml | 253 +++++++++--------- fuzzers/qemu/qemu_launcher/injections.toml | 31 +-- fuzzers/qemu/qemu_systemmode/Cargo.toml | 18 +- fuzzers/qemu/qemu_systemmode/Makefile.toml | 179 +++++++------ fuzzers/stb/libfuzzer_stb_image/Cargo.toml | 14 +- fuzzers/stb/libfuzzer_stb_image/Makefile.toml | 46 ++-- .../Makefile.toml | 12 +- .../fuzzer/Cargo.toml | 16 +- .../runtime/Cargo.toml | 2 +- .../stb/libfuzzer_stb_image_sugar/Cargo.toml | 19 +- .../libfuzzer_stb_image_sugar/Makefile.toml | 42 +-- libafl/Cargo.toml | 131 +++++++-- libafl_bolts/Cargo.toml | 88 +++++- libafl_cc/Cargo.toml | 25 +- libafl_concolic/symcc_libafl/Cargo.toml | 14 +- libafl_concolic/symcc_runtime/Cargo.toml | 24 +- .../test/dump_constraints/Cargo.toml | 12 +- libafl_concolic/test/runtime_test/Cargo.toml | 10 +- libafl_derive/Cargo.toml | 8 +- libafl_frida/Cargo.toml | 57 ++-- libafl_libfuzzer/Cargo.toml | 7 +- libafl_libfuzzer/runtime/Cargo.toml.template | 44 ++- libafl_nyx/Cargo.toml | 25 +- libafl_qemu/Cargo.toml | 52 +++- libafl_qemu/libafl_qemu_build/Cargo.toml | 19 +- libafl_qemu/libafl_qemu_sys/Cargo.toml | 33 ++- libafl_sugar/Cargo.toml | 14 +- libafl_targets/Cargo.toml | 44 +-- libafl_tinyinst/Cargo.toml | 21 +- utils/deexit/Cargo.toml | 15 +- utils/desyscall/Cargo.toml | 8 +- utils/gdb_qemu/Cargo.toml | 5 +- utils/gdb_qemu/Makefile.toml | 78 +++--- utils/gdb_qemu/demo/Cargo.toml | 16 +- utils/gdb_qemu/gdb_qemu/Cargo.toml | 26 +- utils/gramatron/construct_automata/Cargo.toml | 17 +- utils/libafl_benches/Cargo.toml | 23 +- utils/libafl_fmt/Cargo.toml | 9 +- utils/multi_machine_generator/Cargo.toml | 2 +- utils/noaslr/Cargo.toml | 6 +- utils/noaslr/Makefile.toml | 71 +++-- utils/noaslr/demo/Cargo.toml | 16 +- utils/noaslr/libnoaslr/Cargo.toml | 7 +- utils/noaslr/noaslr/Cargo.toml | 24 +- 119 files changed, 2381 insertions(+), 1394 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1b70fee66c..37ebf6d45c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,48 +1,48 @@ [workspace] resolver = "2" members = [ - "libafl", - "libafl_bolts", - "libafl_cc", - "libafl_derive", - "libafl_targets", - "libafl_sugar", - "libafl_concolic/test/dump_constraints", - "libafl_concolic/test/runtime_test", - "utils/build_and_test_fuzzers", - "utils/deexit", - "utils/libafl_benches", - "utils/gramatron/construct_automata", + "libafl", + "libafl_bolts", + "libafl_cc", + "libafl_derive", + "libafl_targets", + "libafl_sugar", + "libafl_concolic/test/dump_constraints", + "libafl_concolic/test/runtime_test", + "utils/build_and_test_fuzzers", + "utils/deexit", + "utils/libafl_benches", + "utils/gramatron/construct_automata", ] default-members = [ - "libafl", - "libafl_bolts", - "libafl_cc", - "libafl_derive", - "libafl_targets", + "libafl", + "libafl_bolts", + "libafl_cc", + "libafl_derive", + "libafl_targets", ] exclude = [ - "bindings", - "fuzzers", - "utils/noaslr", - "utils/gdb_qemu", - "utils/libafl_fmt", - "utils/desyscall", - "utils/multi_machine_generator", - "scripts", - # additional crates - "libafl_concolic/symcc_runtime", - "libafl_concolic/symcc_libafl", - "libafl_frida", - "libafl_libfuzzer", - "libafl_libfuzzer_runtime", - "libafl_nyx", - "libafl_qemu", - "libafl_tinyinst", - "libafl_qemu/libafl_qemu_build", - "libafl_qemu/libafl_qemu_sys", - "libafl_concolic/test/symcc/util/symcc_fuzzing_helper", + "bindings", + "fuzzers", + "utils/noaslr", + "utils/gdb_qemu", + "utils/libafl_fmt", + "utils/desyscall", + "utils/multi_machine_generator", + "scripts", + # additional crates + "libafl_concolic/symcc_runtime", + "libafl_concolic/symcc_libafl", + "libafl_frida", + "libafl_libfuzzer", + "libafl_libfuzzer_runtime", + "libafl_nyx", + "libafl_qemu", + "libafl_tinyinst", + "libafl_qemu/libafl_qemu_build", + "libafl_qemu/libafl_qemu_sys", + "libafl_concolic/test/symcc/util/symcc_fuzzing_helper", ] [workspace.package] diff --git a/bindings/pylibafl/Cargo.toml b/bindings/pylibafl/Cargo.toml index d80aedcdf5..d723c35839 100644 --- a/bindings/pylibafl/Cargo.toml +++ b/bindings/pylibafl/Cargo.toml @@ -6,11 +6,17 @@ edition = "2021" [dependencies] pyo3 = { version = "0.18.3", features = ["extension-module"] } pyo3-log = "0.8.1" -libafl_sugar = { path = "../../libafl_sugar", version = "0.13.2", features = ["python"] } -libafl_bolts = { path = "../../libafl_bolts", version = "0.13.2", features = ["python"] } +libafl_sugar = { path = "../../libafl_sugar", version = "0.13.2", features = [ + "python", +] } +libafl_bolts = { path = "../../libafl_bolts", version = "0.13.2", features = [ + "python", +] } [target.'cfg(target_os = "linux")'.dependencies] -libafl_qemu = { path = "../../libafl_qemu", version = "0.13.2", features = ["python"] } +libafl_qemu = { path = "../../libafl_qemu", version = "0.13.2", features = [ + "python", +] } [build-dependencies] pyo3-build-config = { version = "0.17" } diff --git a/bindings/pylibafl/pyproject.toml b/bindings/pylibafl/pyproject.toml index 7e62ce01e8..d1263cb343 100644 --- a/bindings/pylibafl/pyproject.toml +++ b/bindings/pylibafl/pyproject.toml @@ -8,12 +8,12 @@ version = "0.10.1" description = "Advanced Fuzzing Library for Python" readme = "README.md" requires-python = ">=3.8" -license = {text = "Apache-2.0"} +license = { text = "Apache-2.0" } classifiers = [ - "License :: OSI Approved :: Apache Software License", - "License :: OSI Approved :: MIT License", - "Programming Language :: Rust", - "Topic :: Security", + "License :: OSI Approved :: Apache Software License", + "License :: OSI Approved :: MIT License", + "Programming Language :: Rust", + "Topic :: Security", ] [project.urls] diff --git a/fuzzers/baby/baby_fuzzer/Cargo.toml b/fuzzers/baby/baby_fuzzer/Cargo.toml index 4a6e58079a..0ba12d95fb 100644 --- a/fuzzers/baby/baby_fuzzer/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "baby_fuzzer" version = "0.10.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] diff --git a/fuzzers/baby/baby_fuzzer_gramatron/Cargo.toml b/fuzzers/baby/baby_fuzzer_gramatron/Cargo.toml index 901372a828..83a245e6d4 100644 --- a/fuzzers/baby/baby_fuzzer_gramatron/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer_gramatron/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "baby_fuzzer_gramatron" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -21,4 +24,6 @@ debug = true [dependencies] libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -postcard = { version = "1.0", features = ["alloc"], default-features = false } # no_std compatible serde serialization format \ No newline at end of file +postcard = { version = "1.0", features = [ + "alloc", +], default-features = false } # no_std compatible serde serialization format diff --git a/fuzzers/baby/baby_fuzzer_grimoire/Cargo.toml b/fuzzers/baby/baby_fuzzer_grimoire/Cargo.toml index 2d4ee55832..32a03091a7 100644 --- a/fuzzers/baby/baby_fuzzer_grimoire/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer_grimoire/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "baby_fuzzer_grimoire" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] diff --git a/fuzzers/baby/baby_fuzzer_minimizing/Cargo.toml b/fuzzers/baby/baby_fuzzer_minimizing/Cargo.toml index 1afdf121b3..9156977309 100644 --- a/fuzzers/baby/baby_fuzzer_minimizing/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer_minimizing/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "baby_fuzzer_minimizing" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier ", "Addison Crump "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", + "Addison Crump ", +] edition = "2021" [features] diff --git a/fuzzers/baby/baby_fuzzer_multi/Cargo.toml b/fuzzers/baby/baby_fuzzer_multi/Cargo.toml index 7071ae3f1d..317e33f66f 100644 --- a/fuzzers/baby/baby_fuzzer_multi/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer_multi/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "baby_fuzzer_multi" version = "0.10.0" -authors = ["Andrea Fioraldi ", "Dominik Maier ", "Addison Crump "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", + "Addison Crump ", +] edition = "2021" [features] diff --git a/fuzzers/baby/baby_fuzzer_nautilus/Cargo.toml b/fuzzers/baby/baby_fuzzer_nautilus/Cargo.toml index d58b39ebf4..63891cb381 100644 --- a/fuzzers/baby/baby_fuzzer_nautilus/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer_nautilus/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "baby_fuzzer_nautilus" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] diff --git a/fuzzers/baby/baby_fuzzer_swap_differential/Cargo.toml b/fuzzers/baby/baby_fuzzer_swap_differential/Cargo.toml index f52fdabfeb..b07c79b05e 100644 --- a/fuzzers/baby/baby_fuzzer_swap_differential/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer_swap_differential/Cargo.toml @@ -27,7 +27,12 @@ cc = "1.0" [dependencies] libafl = { path = "../../../libafl" } libafl_bolts = { path = "../../../libafl_bolts" } -libafl_targets = { path = "../../../libafl_targets", features = ["sancov_pcguard_hitcounts", "libfuzzer", "sancov_cmplog", "pointer_maps"] } +libafl_targets = { path = "../../../libafl_targets", features = [ + "sancov_pcguard_hitcounts", + "libfuzzer", + "sancov_cmplog", + "pointer_maps", +] } mimalloc = { version = "*", default-features = false } libafl_cc = { path = "../../../libafl_cc/" } diff --git a/fuzzers/baby/baby_fuzzer_swap_differential/Makefile.toml b/fuzzers/baby/baby_fuzzer_swap_differential/Makefile.toml index 6ff335b2eb..96f6e1f907 100644 --- a/fuzzers/baby/baby_fuzzer_swap_differential/Makefile.toml +++ b/fuzzers/baby/baby_fuzzer_swap_differential/Makefile.toml @@ -1,23 +1,25 @@ # Variables [env] -FUZZER_NAME='fuzzer_sd' +FUZZER_NAME = 'fuzzer_sd' PROJECT_DIR = { script = ["pwd"] } -CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } +CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } PROFILE = { value = "release" } -PROFILE_DIR = {value = "release" } +PROFILE_DIR = { value = "release" } LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc' FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' # Compilers [tasks.cc] command = "cargo" -args = ["build" , "--profile", "${PROFILE}", "--bin", "libafl_cc"] +args = ["build", "--profile", "${PROFILE}", "--bin", "libafl_cc"] # Harness [tasks.fuzzer] command = "cargo" -args = ["build" , "--profile", "${PROFILE}", "--bin", "${FUZZER_NAME}"] -dependencies = [ "cc" ] +args = ["build", "--profile", "${PROFILE}", "--bin", "${FUZZER_NAME}"] +dependencies = ["cc"] [tasks.build] alias = "fuzzer" @@ -25,7 +27,7 @@ alias = "fuzzer" # Run the fuzzer [tasks.run] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}" -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Test [tasks.test] @@ -35,7 +37,7 @@ windows_alias = "unsupported" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' timeout 30s ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME} | tee fuzz_stdout.log || true if grep -qa "objectives: 1" fuzz_stdout.log; then echo "Fuzzer is working" @@ -44,13 +46,13 @@ else exit 1 fi ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cargo clean ''' diff --git a/fuzzers/baby/baby_fuzzer_tokens/Cargo.toml b/fuzzers/baby/baby_fuzzer_tokens/Cargo.toml index b1cefd7b64..e66907322e 100644 --- a/fuzzers/baby/baby_fuzzer_tokens/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer_tokens/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "baby_fuzzer_tokens" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] diff --git a/fuzzers/baby/baby_fuzzer_unicode/Cargo.toml b/fuzzers/baby/baby_fuzzer_unicode/Cargo.toml index 2dd5b227ab..5dead3d69e 100644 --- a/fuzzers/baby/baby_fuzzer_unicode/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer_unicode/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "baby_fuzzer_unicode" version = "0.10.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] diff --git a/fuzzers/baby/baby_fuzzer_wasm/Makefile.toml b/fuzzers/baby/baby_fuzzer_wasm/Makefile.toml index 38324abd36..d57074798b 100644 --- a/fuzzers/baby/baby_fuzzer_wasm/Makefile.toml +++ b/fuzzers/baby/baby_fuzzer_wasm/Makefile.toml @@ -1,10 +1,10 @@ [env] -FUZZER_NAME="fuzzer" +FUZZER_NAME = "fuzzer" PROJECT_DIR = { script = ["pwd"] } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -26,4 +26,4 @@ args = ["test", "--chrome", "--headless"] # Clean [tasks.clean] command = "cargo" -args = ["clean"] \ No newline at end of file +args = ["clean"] diff --git a/fuzzers/baby/baby_fuzzer_with_forkexecutor/Cargo.toml b/fuzzers/baby/baby_fuzzer_with_forkexecutor/Cargo.toml index fa6aab4372..156dd9769b 100644 --- a/fuzzers/baby/baby_fuzzer_with_forkexecutor/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer_with_forkexecutor/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "baby_fuzzer_with_forkexecutor" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] diff --git a/fuzzers/baby/baby_no_std/Cargo.toml b/fuzzers/baby/baby_no_std/Cargo.toml index f546a1ffa6..21e7d99fb2 100644 --- a/fuzzers/baby/baby_no_std/Cargo.toml +++ b/fuzzers/baby/baby_no_std/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "baby_no_std" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [profile.dev] @@ -21,4 +24,3 @@ static-alloc = "0.2.3" [target.'cfg(unix)'.dependencies] libc = "0.2" - diff --git a/fuzzers/baby/baby_no_std/Makefile.toml b/fuzzers/baby/baby_no_std/Makefile.toml index 7df8099700..28c9951b7a 100644 --- a/fuzzers/baby/baby_no_std/Makefile.toml +++ b/fuzzers/baby/baby_no_std/Makefile.toml @@ -1,19 +1,28 @@ [env] -FUZZER_NAME="fuzzer" +FUZZER_NAME = "fuzzer" PROJECT_DIR = { script = ["pwd"] } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' # Fuzzer [tasks.build] command = "cargo" -args = ["build", "--profile", "${PROFILE}", "-Zbuild-std=core,alloc", "--target", "x86_64-unknown-linux-gnu"] +args = [ + "build", + "--profile", + "${PROFILE}", + "-Zbuild-std=core,alloc", + "--target", + "x86_64-unknown-linux-gnu", +] # Test [tasks.test] @@ -22,7 +31,7 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.test_unix] -script=''' +script = ''' cargo run -Zbuild-std=core,alloc --target x86_64-unknown-linux-gnu || true ''' dependencies = ["build"] @@ -33,4 +42,4 @@ script = "cargo +nightly build -Zbuild-std=core,alloc --target aarch64-unknown-n # Clean [tasks.clean] command = "cargo" -args = ["clean"] \ No newline at end of file +args = ["clean"] diff --git a/fuzzers/forkserver/forkserver_libafl_cc/Cargo.toml b/fuzzers/forkserver/forkserver_libafl_cc/Cargo.toml index 118391588d..660d5b930a 100644 --- a/fuzzers/forkserver/forkserver_libafl_cc/Cargo.toml +++ b/fuzzers/forkserver/forkserver_libafl_cc/Cargo.toml @@ -26,7 +26,11 @@ nix = { version = "0.29", features = ["signal"] } libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } libafl_cc = { path = "../../../libafl_cc/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "libfuzzer", "pointer_maps"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "libfuzzer", + "pointer_maps", +] } env_logger = "0.11" [lib] diff --git a/fuzzers/forkserver/forkserver_libafl_cc/Makefile.toml b/fuzzers/forkserver/forkserver_libafl_cc/Makefile.toml index 94bf9daf19..3d41c8b342 100644 --- a/fuzzers/forkserver/forkserver_libafl_cc/Makefile.toml +++ b/fuzzers/forkserver/forkserver_libafl_cc/Makefile.toml @@ -1,17 +1,21 @@ # Variables [env] -FUZZER_NAME='fuzzer_libafl_cc' -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +FUZZER_NAME = 'fuzzer_libafl_cc' +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc' LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx' FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' PROJECT_DIR = { script = ["pwd"] } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -23,7 +27,7 @@ windows_alias = "unsupported" [tasks.cxx_unix] command = "cargo" -args = ["build" , "--profile","${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] linux_alias = "cc_unix" @@ -32,7 +36,7 @@ windows_alias = "unsupported" [tasks.cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.crash_cxx] linux_alias = "crash_cxx_unix" @@ -41,7 +45,7 @@ windows_alias = "unsupported" [tasks.crash_cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}", "--features=crash"] +args = ["build", "--profile", "${PROFILE}", "--features=crash"] [tasks.crash_cc] linux_alias = "crash_cc_unix" @@ -50,7 +54,7 @@ windows_alias = "unsupported" [tasks.crash_cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}", "--features=crash"] +args = ["build", "--profile", "${PROFILE}", "--features=crash"] # Harness [tasks.fuzzer] @@ -61,7 +65,7 @@ windows_alias = "unsupported" [tasks.fuzzer_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" args = ["${PROJECT_DIR}/src/program.c", "-o", "${FUZZER_NAME}", "-lm"] -dependencies = [ "cxx", "cc" ] +dependencies = ["cxx", "cc"] # Crashing Harness [tasks.fuzzer_crash] @@ -72,7 +76,7 @@ windows_alias = "unsupported" [tasks.fuzzer_crash_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" args = ["${PROJECT_DIR}/src/program.c", "-o", "${FUZZER_NAME}_crash", "-lm"] -dependencies = [ "crash_cxx", "crash_cc" ] +dependencies = ["crash_cxx", "crash_cc"] # Run the fuzzer [tasks.run] @@ -82,10 +86,10 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' taskset -c 1 ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME} ./corpus/ -t 1000 ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Run the fuzzer with a crash @@ -96,10 +100,10 @@ windows_alias = "unsupported" [tasks.crash_unix] script_runner = "@shell" -script=''' +script = ''' taskset -c 1 ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME}_crash ./corpus/ -t 1000 ''' -dependencies = [ "fuzzer_crash" ] +dependencies = ["fuzzer_crash"] # Test [tasks.test] @@ -109,7 +113,7 @@ windows_alias = "unsupported" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' timeout 30s ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${CARGO_MAKE_PROJECT_NAME} ./${FUZZER_NAME} ./corpus/ -t 1000 | tee fuzz_stdout.log || true if grep -qa "objectives: 1" fuzz_stdout.log; then echo "Fuzzer is working" @@ -119,7 +123,7 @@ else fi ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] @@ -130,8 +134,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} cargo clean ''' diff --git a/fuzzers/frida/frida_executable_libpng/Cargo.toml b/fuzzers/frida/frida_executable_libpng/Cargo.toml index a00188bc51..f6ae2c85e1 100644 --- a/fuzzers/frida/frida_executable_libpng/Cargo.toml +++ b/fuzzers/frida/frida_executable_libpng/Cargo.toml @@ -18,11 +18,22 @@ opt-level = 3 debug = true [dependencies] -libafl = { path = "../../../libafl/", features = [ "std", "llmp_compression", "llmp_bind_public", "frida_cli" ] } #, "llmp_small_maps", "llmp_debug"]} +libafl = { path = "../../../libafl/", features = [ + "std", + "llmp_compression", + "llmp_bind_public", + "frida_cli", +] } #, "llmp_small_maps", "llmp_debug"]} libafl_bolts = { path = "../../../libafl_bolts/" } -frida-gum = { version = "0.13.6", features = [ "auto-download", "event-sink", "invocation-listener"] } +frida-gum = { version = "0.13.6", features = [ + "auto-download", + "event-sink", + "invocation-listener", +] } libafl_frida = { path = "../../../libafl_frida", features = ["cmplog"] } -libafl_targets = { path = "../../../libafl_targets", features = ["sancov_cmplog"] } +libafl_targets = { path = "../../../libafl_targets", features = [ + "sancov_cmplog", +] } libc = "0.2" libloading = "0.7" num-traits = "0.2" diff --git a/fuzzers/frida/frida_executable_libpng/Makefile.toml b/fuzzers/frida/frida_executable_libpng/Makefile.toml index 92868e51c7..ae798ed011 100644 --- a/fuzzers/frida/frida_executable_libpng/Makefile.toml +++ b/fuzzers/frida/frida_executable_libpng/Makefile.toml @@ -1,12 +1,16 @@ # Variables [env] -CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -17,9 +21,9 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.libpng_unix] -condition = { files_not_exist = ["./libpng-1.6.37"]} -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./libpng-1.6.37"] } +script_runner = "@shell" +script = ''' wget https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz tar -xvf v1.6.37.tar.gz ''' @@ -31,13 +35,13 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd .. make -C libpng-1.6.37 ''' -dependencies = [ "libpng" ] +dependencies = ["libpng"] # Harness [tasks.harness] @@ -46,12 +50,12 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.harness_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' clang++ -O0 -c -fPIC harness.cc -o harness.o clang++ -O0 harness.cc libpng-1.6.37/.libs/libpng16.a -lz -o libpng-harness -g ''' -dependencies = [ "lib" ] +dependencies = ["lib"] # Fuzzer [tasks.fuzzer] @@ -60,8 +64,8 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.fuzzer_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cargo build --profile ${PROFILE} ''' @@ -73,10 +77,10 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' LD_PRELOAD=$CARGO_TARGET_DIR/${PROFILE_DIR}/libfrida_executable_fuzzer.so ./libpng-harness -i corpus -o out -H ./libpng-harness ''' -dependencies = [ "fuzzer", "harness" ] +dependencies = ["fuzzer", "harness"] # Test [tasks.test] @@ -86,7 +90,7 @@ windows_alias = "unsupported" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true LD_PRELOAD=$CARGO_TARGET_DIR/${PROFILE_DIR}/libfrida_executable_fuzzer.so ./libpng-harness -i corpus -o out -H ./libpng-harness > fuzz_stdout.log & sleep 10s && pkill libpng-harness @@ -97,7 +101,7 @@ else exit 1 fi ''' -dependencies = [ "fuzzer", "harness" ] +dependencies = ["fuzzer", "harness"] # Clean up [tasks.clean] @@ -108,8 +112,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./libpng-harness make -C libpng-1.6.37 clean cargo clean diff --git a/fuzzers/frida/frida_gdiplus/Cargo.toml b/fuzzers/frida/frida_gdiplus/Cargo.toml index 6ca773d9b5..82ed3229e5 100644 --- a/fuzzers/frida/frida_gdiplus/Cargo.toml +++ b/fuzzers/frida/frida_gdiplus/Cargo.toml @@ -15,15 +15,26 @@ opt-level = 3 debug = true [dependencies] -libafl = { path = "../../../libafl/", features = [ "std", "llmp_compression", - "llmp_bind_public", "frida_cli", "errors_backtrace" ] } #, "llmp_small_maps", "llmp_debug"]} +libafl = { path = "../../../libafl/", features = [ + "std", + "llmp_compression", + "llmp_bind_public", + "frida_cli", + "errors_backtrace", +] } #, "llmp_small_maps", "llmp_debug"]} libafl_bolts = { path = "../../../libafl_bolts/" } -frida-gum = { version = "0.13.6", features = ["auto-download", "event-sink", "invocation-listener"] } +frida-gum = { version = "0.13.6", features = [ + "auto-download", + "event-sink", + "invocation-listener", +] } libafl_frida = { path = "../../../libafl_frida", features = ["cmplog"] } -libafl_targets = { path = "../../../libafl_targets", features = ["sancov_cmplog"] } +libafl_targets = { path = "../../../libafl_targets", features = [ + "sancov_cmplog", +] } libloading = "0.7" mimalloc = { version = "*", default-features = false } -dlmalloc ={version = "0.2.6", features = ["global"]} +dlmalloc = { version = "0.2.6", features = ["global"] } color-backtrace = "0.5" env_logger = "0.10.0" iced-x86 = { version = "1.20.0", features = ["code_asm"] } diff --git a/fuzzers/frida/frida_gdiplus/Makefile.toml b/fuzzers/frida/frida_gdiplus/Makefile.toml index 5d7f24b555..6ec014adfe 100644 --- a/fuzzers/frida/frida_gdiplus/Makefile.toml +++ b/fuzzers/frida/frida_gdiplus/Makefile.toml @@ -1,13 +1,17 @@ # Variables [env] -CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -FUZZER_NAME={ source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "frida_gdiplus", mapping = {"linux" = "frida_gdiplus", "macos" = "frida_gdiplus", "windows" = "frida_gdiplus.exe"} } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +FUZZER_NAME = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "frida_gdiplus", mapping = { "linux" = "frida_gdiplus", "macos" = "frida_gdiplus", "windows" = "frida_gdiplus.exe" } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -19,14 +23,14 @@ windows_alias = "harness_windows" [tasks.harness_windows] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cl.exe /LD harness.cc /link /dll gdiplus.lib ole32.lib ''' [tasks.harness_windows_cmplog_test] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' ml64 cmplog_test.asm /subsystem:windows /link /dll /def:cmplog_test.def /entry:dll_main /out:cmplog.dll ''' @@ -37,8 +41,8 @@ mac_alias = "unsupported" windows_alias = "fuzzer_windows" [tasks.fuzzer_windows] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cargo build --profile ${PROFILE} cp ./target/${PROFILE_DIR}/${FUZZER_NAME} . ''' @@ -51,10 +55,10 @@ windows_alias = "run_windows" [tasks.run_windows] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} -H harness.dll -i corpus -o output --libs-to-instrument gdi32.dll --libs-to-instrument gdi32full.dll --libs-to-instrument gdiplus.dll --libs-to-instrument WindowsCodecs.dll --disable-excludes ''' -dependencies = [ "fuzzer", "harness" ] +dependencies = ["fuzzer", "harness"] # Test [tasks.test] @@ -69,7 +73,7 @@ windows_alias = "test_windows_cmplog" [tasks.test_windows_cmplog] script_runner = "@shell" -script=''' +script = ''' @echo off for %%i in (t1 t2 t3 t4 t5 t6 t7) do ( @@ -82,14 +86,14 @@ for %%i in (t1 t2 t3 t4 t5 t6 t7) do ( echo All tests done ''' -dependencies = [ "fuzzer", "harness_windows_cmplog_test" ] +dependencies = ["fuzzer", "harness_windows_cmplog_test"] [tasks.test_windows] script_runner = "@shell" -script=''' +script = ''' start "" "frida_gdiplus.exe" -H harness.dll -i corpus -o output --libs-to-instrument gdi32.dll --libs-to-instrument gdi32full.dll --libs-to-instrument gdiplus.dll --libs-to-instrument WindowsCodecs.dll --disable-excludes #ping is for timeout ping -n 10 127.0.0.1>NUL && taskkill /im frida_gdiplus.exe /F >nul 2>nul dir /a-d "corpus_discovered\*" && (echo Files exist) || (exit /b 1337) ''' -dependencies = [ "fuzzer", "harness" ] +dependencies = ["fuzzer", "harness"] diff --git a/fuzzers/frida/frida_libpng/Cargo.toml b/fuzzers/frida/frida_libpng/Cargo.toml index 6ed108c655..b81a1d3a01 100644 --- a/fuzzers/frida/frida_libpng/Cargo.toml +++ b/fuzzers/frida/frida_libpng/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "frida_fuzzer" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -15,12 +18,23 @@ opt-level = 3 debug = true [dependencies] -libafl = { path = "../../../libafl/", features = [ "std", "llmp_compression", - "llmp_bind_public", "frida_cli", "errors_backtrace" ] } #, "llmp_small_maps", "llmp_debug"]} +libafl = { path = "../../../libafl/", features = [ + "std", + "llmp_compression", + "llmp_bind_public", + "frida_cli", + "errors_backtrace", +] } #, "llmp_small_maps", "llmp_debug"]} libafl_bolts = { path = "../../../libafl_bolts/" } -frida-gum = { version = "0.13.6", features = ["auto-download", "event-sink", "invocation-listener"] } +frida-gum = { version = "0.13.6", features = [ + "auto-download", + "event-sink", + "invocation-listener", +] } libafl_frida = { path = "../../../libafl_frida", features = ["cmplog"] } -libafl_targets = { path = "../../../libafl_targets", features = ["sancov_cmplog"] } +libafl_targets = { path = "../../../libafl_targets", features = [ + "sancov_cmplog", +] } libloading = "0.7" mimalloc = { version = "*", default-features = false } color-backtrace = "0.5" diff --git a/fuzzers/frida/frida_libpng/Makefile.toml b/fuzzers/frida/frida_libpng/Makefile.toml index 531f77445b..9359fbfe6d 100644 --- a/fuzzers/frida/frida_libpng/Makefile.toml +++ b/fuzzers/frida/frida_libpng/Makefile.toml @@ -1,13 +1,17 @@ # Variables [env] -CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -FUZZER_NAME={ source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "frida_fuzzer", mapping = {"linux" = "frida_fuzzer", "macos" = "frida_fuzzer", "windows" = "frida_fuzzer.exe"} } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +FUZZER_NAME = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "frida_fuzzer", mapping = { "linux" = "frida_fuzzer", "macos" = "frida_fuzzer", "windows" = "frida_fuzzer.exe" } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -18,9 +22,9 @@ mac_alias = "libpng_unix" windows_alias = "unsupported" [tasks.libpng_unix] -condition = { files_not_exist = ["./libpng-1.6.37"]} -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./libpng-1.6.37"] } +script_runner = "@shell" +script = ''' wget https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz tar -xvf v1.6.37.tar.gz ''' @@ -32,13 +36,13 @@ mac_alias = "lib_unix" windows_alias = "unsupported" [tasks.lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes --disable-dependency-tracking cd .. make -C libpng-1.6.37 ''' -dependencies = [ "libpng" ] +dependencies = ["libpng"] # Harness [tasks.harness] @@ -47,16 +51,16 @@ mac_alias = "harness_unix" windows_alias = "harness_windows" [tasks.harness_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' clang++ -O3 -c -fPIC harness.cc -o harness.o clang++ -O3 harness.o libpng-1.6.37/.libs/libpng16.a -shared -lz -o libpng-harness.so ''' -dependencies = [ "lib" ] +dependencies = ["lib"] [tasks.harness_windows] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cl /c harness_win.cpp && link harness_win.obj /dll ''' @@ -67,15 +71,15 @@ mac_alias = "fuzzer_unix" windows_alias = "fuzzer_windows" [tasks.fuzzer_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cargo build --profile ${PROFILE} cp ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME} . ''' [tasks.fuzzer_windows] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cargo build --profile ${PROFILE} cp ./target/${PROFILE_DIR}/${FUZZER_NAME} . ''' @@ -88,17 +92,17 @@ windows_alias = "run_windows" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} -F LLVMFuzzerTestOneInput -H ./libpng-harness.so -l ./libpng-harness.so ''' -dependencies = [ "fuzzer", "harness" ] +dependencies = ["fuzzer", "harness"] [tasks.run_windows] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} -F LLVMFuzzerTestOneInput -H ./harness_win.dll -l ./harness_win.dll --cores=0 ''' -dependencies = [ "fuzzer", "harness" ] +dependencies = ["fuzzer", "harness"] # Test [tasks.test] @@ -108,7 +112,7 @@ windows_alias = "test_windows" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 30s ./${FUZZER_NAME} -F LLVMFuzzerTestOneInput -H ./libpng-harness.so -l ./libpng-harness.so | tee fuzz_stdout.log 2>/dev/null || true if grep -qa "corpus: 70" fuzz_stdout.log; then @@ -118,26 +122,26 @@ else exit 1 fi ''' -dependencies = [ "fuzzer", "harness" ] +dependencies = ["fuzzer", "harness"] # Don't grep and check the result on macOS because it's unstable [tasks.test_mac] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 30s ./${FUZZER_NAME} -F LLVMFuzzerTestOneInput -H ./libpng-harness.so -l ./libpng-harness.so | tee fuzz_stdout.log 2>/dev/null || true ''' -dependencies = [ "fuzzer", "harness" ] +dependencies = ["fuzzer", "harness"] [tasks.test_windows] script_runner = "@shell" -script=''' +script = ''' start "" "frida_fuzzer.exe" -F LLVMFuzzerTestOneInput -H ./harness_win.dll -l ./harness_win.dll --cores=0 #ping is for timeout ping -n 10 127.0.0.1>NUL && taskkill /im frida_fuzzer.exe /F >nul 2>nul dir /a-d "corpus_discovered\*" && (echo Files exist) || (exit /b 1337) ''' -dependencies = [ "fuzzer", "harness" ] +dependencies = ["fuzzer", "harness"] # Clean up [tasks.clean] @@ -148,8 +152,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} make -C libpng-1.6.37 clean cargo clean diff --git a/fuzzers/fuzzbench/fuzzbench/Cargo.toml b/fuzzers/fuzzbench/fuzzbench/Cargo.toml index 6dd6a1a315..6dce6aa3db 100644 --- a/fuzzers/fuzzbench/fuzzbench/Cargo.toml +++ b/fuzzers/fuzzbench/fuzzbench/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "fuzzbench" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -27,7 +30,11 @@ which = "6.0" [dependencies] libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "sancov_cmplog", "libfuzzer"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "sancov_cmplog", + "libfuzzer", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } clap = { version = "4.5", features = ["default"] } diff --git a/fuzzers/fuzzbench/fuzzbench/Makefile.toml b/fuzzers/fuzzbench/fuzzbench/Makefile.toml index c3bfdb78c1..7e668a1e39 100644 --- a/fuzzers/fuzzbench/fuzzbench/Makefile.toml +++ b/fuzzers/fuzzbench/fuzzbench/Makefile.toml @@ -1,13 +1,17 @@ [env] PROJECT_DIR = { script = ["pwd"] } -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -FUZZER_NAME="fuzzer" -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +FUZZER_NAME = "fuzzer" +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -59,8 +63,8 @@ mac_alias = "run_unix" windows_alias = "unsupported" [tasks.run_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf libafl_unix_shmem_server || true mkdir in || true echo a > in/a @@ -76,8 +80,8 @@ mac_alias = "test_unix" windows_alias = "unsupported" [tasks.test_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf libafl_unix_shmem_server || true mkdir in || true echo a > in/a @@ -101,8 +105,8 @@ mac_alias = "clean_unix" windows_alias = "unsupported" [tasks.clean_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm ./${FUZZER_NAME} || true rm fuzz.o || true ''' diff --git a/fuzzers/fuzzbench/fuzzbench_ctx/Cargo.toml b/fuzzers/fuzzbench/fuzzbench_ctx/Cargo.toml index 09c1961fc2..15b64776fe 100644 --- a/fuzzers/fuzzbench/fuzzbench_ctx/Cargo.toml +++ b/fuzzers/fuzzbench/fuzzbench_ctx/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "fuzzbench_ctx" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -27,7 +30,12 @@ which = "6.0" [dependencies] libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "sancov_cmplog", "libfuzzer", "sancov_ctx"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "sancov_cmplog", + "libfuzzer", + "sancov_ctx", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } clap = { version = "4.5", features = ["default"] } diff --git a/fuzzers/fuzzbench/fuzzbench_ctx/Makefile.toml b/fuzzers/fuzzbench/fuzzbench_ctx/Makefile.toml index c3bfdb78c1..7e668a1e39 100644 --- a/fuzzers/fuzzbench/fuzzbench_ctx/Makefile.toml +++ b/fuzzers/fuzzbench/fuzzbench_ctx/Makefile.toml @@ -1,13 +1,17 @@ [env] PROJECT_DIR = { script = ["pwd"] } -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -FUZZER_NAME="fuzzer" -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +FUZZER_NAME = "fuzzer" +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -59,8 +63,8 @@ mac_alias = "run_unix" windows_alias = "unsupported" [tasks.run_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf libafl_unix_shmem_server || true mkdir in || true echo a > in/a @@ -76,8 +80,8 @@ mac_alias = "test_unix" windows_alias = "unsupported" [tasks.test_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf libafl_unix_shmem_server || true mkdir in || true echo a > in/a @@ -101,8 +105,8 @@ mac_alias = "clean_unix" windows_alias = "unsupported" [tasks.clean_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm ./${FUZZER_NAME} || true rm fuzz.o || true ''' diff --git a/fuzzers/fuzzbench/fuzzbench_fork_qemu/Cargo.toml b/fuzzers/fuzzbench/fuzzbench_fork_qemu/Cargo.toml index 7e41255019..0f9fc95963 100644 --- a/fuzzers/fuzzbench/fuzzbench_fork_qemu/Cargo.toml +++ b/fuzzers/fuzzbench/fuzzbench_fork_qemu/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "fuzzbench_fork_qemu" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -22,7 +25,10 @@ strip = true [dependencies] libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_qemu = { path = "../../../libafl_qemu/", features = ["x86_64", "usermode"] } +libafl_qemu = { path = "../../../libafl_qemu/", features = [ + "x86_64", + "usermode", +] } clap = { version = "4.5", features = ["default"] } nix = { version = "0.29", features = ["fs"] } diff --git a/fuzzers/fuzzbench/fuzzbench_fork_qemu/Makefile.toml b/fuzzers/fuzzbench/fuzzbench_fork_qemu/Makefile.toml index 940f250527..b5c4a904a0 100644 --- a/fuzzers/fuzzbench/fuzzbench_fork_qemu/Makefile.toml +++ b/fuzzers/fuzzbench/fuzzbench_fork_qemu/Makefile.toml @@ -1,13 +1,15 @@ # Variables [env] -FUZZER_NAME='libpng_harness' +FUZZER_NAME = 'libpng_harness' PROJECT_DIR = { script = ["pwd"] } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Qemu fuzzer not supported on windows" ''' @@ -18,9 +20,9 @@ mac_alias = "libpng_unix" windows_alias = "unsupported" [tasks.libpng_unix] -condition = { files_not_exist = [ "./libpng-1.6.37" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./libpng-1.6.37"] } +script_runner = "@shell" +script = ''' wget https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz tar -xvf v1.6.37.tar.gz ''' @@ -42,8 +44,8 @@ mac_alias = "harness_unix" windows_alias = "unsupported" [tasks.harness_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" make -C libpng-1.6.37 @@ -67,8 +69,19 @@ windows_alias = "unsupported" [tasks.run_unix] command = "cargo" -args = ["run", "--profile", "${PROFILE_DIR}", "./${FUZZER_NAME}", "--", "--libafl-in", "../libfuzzer_libpng/corpus", "--libafl-out", "./out", "./${FUZZER_NAME}"] -dependencies = [ "harness", "fuzzer" ] +args = [ + "run", + "--profile", + "${PROFILE_DIR}", + "./${FUZZER_NAME}", + "--", + "--libafl-in", + "../libfuzzer_libpng/corpus", + "--libafl-out", + "./out", + "./${FUZZER_NAME}", +] +dependencies = ["harness", "fuzzer"] # Run the fuzzer [tasks.test] @@ -79,10 +92,10 @@ windows_alias = "unsupported" # Short test [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' echo "This test is skipped. QEMU-based fuzzer doesn't work on Github runners" ''' -dependencies = [ "harness", "fuzzer" ] +dependencies = ["harness", "fuzzer"] # Clean up [tasks.clean] @@ -93,9 +106,9 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} libfuzzer_main.o make -C libpng-1.6.37 clean cargo clean -''' \ No newline at end of file +''' diff --git a/fuzzers/fuzzbench/fuzzbench_forkserver/Cargo.toml b/fuzzers/fuzzbench/fuzzbench_forkserver/Cargo.toml index ddcbfbe883..1596cf6b79 100644 --- a/fuzzers/fuzzbench/fuzzbench_forkserver/Cargo.toml +++ b/fuzzers/fuzzbench/fuzzbench_forkserver/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "fuzzbench_forkserver" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [profile.release] diff --git a/fuzzers/fuzzbench/fuzzbench_forkserver_cmplog/Cargo.toml b/fuzzers/fuzzbench/fuzzbench_forkserver_cmplog/Cargo.toml index 04b22237a8..ab7ecc6eb3 100644 --- a/fuzzers/fuzzbench/fuzzbench_forkserver_cmplog/Cargo.toml +++ b/fuzzers/fuzzbench/fuzzbench_forkserver_cmplog/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "fuzzbench_forkserver_cmplog" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [profile.release] @@ -24,4 +27,4 @@ libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } libafl_targets = { path = "../../../libafl_targets/" } clap = { version = "4.5", features = ["default"] } -nix = { version = "0.29", features = ["signal"] } \ No newline at end of file +nix = { version = "0.29", features = ["signal"] } diff --git a/fuzzers/fuzzbench/fuzzbench_qemu/Cargo.toml b/fuzzers/fuzzbench/fuzzbench_qemu/Cargo.toml index 6384df6402..cc5c4e6fd4 100644 --- a/fuzzers/fuzzbench/fuzzbench_qemu/Cargo.toml +++ b/fuzzers/fuzzbench/fuzzbench_qemu/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "fuzzbench_qemu" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -22,8 +25,10 @@ strip = true [dependencies] libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_qemu = { path = "../../../libafl_qemu/", features = ["x86_64", "usermode"] } +libafl_qemu = { path = "../../../libafl_qemu/", features = [ + "x86_64", + "usermode", +] } clap = { version = "4.5", features = ["default"] } nix = { version = "0.29", features = ["fs"] } - diff --git a/fuzzers/fuzzbench/fuzzbench_qemu/Makefile.toml b/fuzzers/fuzzbench/fuzzbench_qemu/Makefile.toml index b34b02fa24..b1b5f80196 100644 --- a/fuzzers/fuzzbench/fuzzbench_qemu/Makefile.toml +++ b/fuzzers/fuzzbench/fuzzbench_qemu/Makefile.toml @@ -1,13 +1,15 @@ # Variables [env] -FUZZER_NAME='libpng_harness' +FUZZER_NAME = 'libpng_harness' PROJECT_DIR = { script = ["pwd"] } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Qemu fuzzer not supported on windows" ''' @@ -18,9 +20,9 @@ mac_alias = "libpng_unix" windows_alias = "unsupported" [tasks.libpng_unix] -condition = { files_not_exist = [ "./libpng-1.6.37" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./libpng-1.6.37"] } +script_runner = "@shell" +script = ''' wget https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz tar -xvf v1.6.37.tar.gz ''' @@ -42,8 +44,8 @@ mac_alias = "harness_unix" windows_alias = "unsupported" [tasks.harness_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" make -C libpng-1.6.37 @@ -67,8 +69,19 @@ windows_alias = "unsupported" [tasks.run_unix] command = "cargo" -args = ["run", "--profile", "${PROFILE}", "./${FUZZER_NAME}", "--", "--libafl-in", "../../libpng/libfuzzer_libpng/corpus", "--libafl-out", "./out", "./${FUZZER_NAME}"] -dependencies = [ "harness", "fuzzer" ] +args = [ + "run", + "--profile", + "${PROFILE}", + "./${FUZZER_NAME}", + "--", + "--libafl-in", + "../../libpng/libfuzzer_libpng/corpus", + "--libafl-out", + "./out", + "./${FUZZER_NAME}", +] +dependencies = ["harness", "fuzzer"] # Run the fuzzer [tasks.test] @@ -79,10 +92,10 @@ windows_alias = "unsupported" # Short test [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' echo "This test is skipped. QEMU-based fuzzer doesn't work on Github runners" ''' -dependencies = [ "harness", "fuzzer" ] +dependencies = ["harness", "fuzzer"] # Clean up [tasks.clean] @@ -93,8 +106,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} libfuzzer_main.o make -C libpng-1.6.37 clean cargo clean diff --git a/fuzzers/fuzzbench/fuzzbench_text/Cargo.toml b/fuzzers/fuzzbench/fuzzbench_text/Cargo.toml index 61c8bca89e..8eb955bfcd 100644 --- a/fuzzers/fuzzbench/fuzzbench_text/Cargo.toml +++ b/fuzzers/fuzzbench/fuzzbench_text/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "fuzzbench_text" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -22,7 +25,11 @@ which = "6.0" [dependencies] libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "sancov_cmplog", "libfuzzer"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "sancov_cmplog", + "libfuzzer", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } clap = { version = "4.5", features = ["default"] } diff --git a/fuzzers/fuzzbench/fuzzbench_text/Makefile.toml b/fuzzers/fuzzbench/fuzzbench_text/Makefile.toml index 94faa860ce..8b9008ab79 100644 --- a/fuzzers/fuzzbench/fuzzbench_text/Makefile.toml +++ b/fuzzers/fuzzbench/fuzzbench_text/Makefile.toml @@ -1,13 +1,17 @@ [env] PROJECT_DIR = { script = ["pwd"] } -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -FUZZER_NAME="fuzzer" -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +FUZZER_NAME = "fuzzer" +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -19,7 +23,7 @@ windows_alias = "unsupported" [tasks.cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] linux_alias = "cc_unix" @@ -28,7 +32,7 @@ windows_alias = "unsupported" [tasks.cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] # fuzz.o File [tasks.fuzz_o] @@ -59,8 +63,8 @@ mac_alias = "run_unix" windows_alias = "unsupported" [tasks.run_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf libafl_unix_shmem_server || true mkdir in || true echo a > in/a @@ -77,8 +81,8 @@ mac_alias = "test_unix" windows_alias = "unsupported" [tasks.test_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf libafl_unix_shmem_server || true mkdir in || true echo a > in/a @@ -103,8 +107,8 @@ mac_alias = "clean_unix" windows_alias = "unsupported" [tasks.clean_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm ./${FUZZER_NAME} || true rm fuzz.o || true -''' \ No newline at end of file +''' diff --git a/fuzzers/libpng/libfuzzer_libpng/Cargo.toml b/fuzzers/libpng/libfuzzer_libpng/Cargo.toml index 4e8b96e5e8..ca48a67666 100644 --- a/fuzzers/libpng/libfuzzer_libpng/Cargo.toml +++ b/fuzzers/libpng/libfuzzer_libpng/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "libfuzzer_libpng" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -24,7 +27,11 @@ which = "6.0" libafl = { path = "../../../libafl/", features = ["default"] } # libafl = { path = "../../../libafl/", features = ["default"] } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "libfuzzer", "sancov_cmplog"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "libfuzzer", + "sancov_cmplog", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } mimalloc = { version = "*", default-features = false } diff --git a/fuzzers/libpng/libfuzzer_libpng/Makefile.toml b/fuzzers/libpng/libfuzzer_libpng/Makefile.toml index fb1dc6cfd2..9b7c61978e 100644 --- a/fuzzers/libpng/libfuzzer_libpng/Makefile.toml +++ b/fuzzers/libpng/libfuzzer_libpng/Makefile.toml @@ -1,17 +1,21 @@ # Variables [env] -FUZZER_NAME='fuzzer_libpng' +FUZZER_NAME = 'fuzzer_libpng' PROJECT_DIR = { script = ["pwd"] } -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc' LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx' FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -22,9 +26,9 @@ mac_alias = "libpng_unix" windows_alias = "unsupported" [tasks.libpng_unix] -condition = { files_not_exist = ["./libpng-1.6.37"]} -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./libpng-1.6.37"] } +script_runner = "@shell" +script = ''' wget https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz tar -xvf v1.6.37.tar.gz ''' @@ -37,7 +41,7 @@ windows_alias = "unsupported" [tasks.cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] linux_alias = "cc_unix" @@ -46,7 +50,7 @@ windows_alias = "unsupported" [tasks.cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.crash_cxx] linux_alias = "crash_cxx_unix" @@ -55,7 +59,7 @@ windows_alias = "unsupported" [tasks.crash_cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}", "--features=crash"] +args = ["build", "--profile", "${PROFILE}", "--features=crash"] [tasks.crash_cc] linux_alias = "crash_cc_unix" @@ -64,7 +68,7 @@ windows_alias = "unsupported" [tasks.crash_cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}", "--features=crash"] +args = ["build", "--profile", "${PROFILE}", "--features=crash"] # Library [tasks.lib] @@ -73,13 +77,13 @@ mac_alias = "lib_unix" windows_alias = "unsupported" [tasks.lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" make -C libpng-1.6.37 CC="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" CXX="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" ''' -dependencies = [ "libpng", "cxx", "cc" ] +dependencies = ["libpng", "cxx", "cc"] # Library [tasks.crash_lib] @@ -88,13 +92,13 @@ mac_alias = "crash_lib_unix" windows_alias = "unsupported" [tasks.crash_lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" make -C libpng-1.6.37 CC="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" CXX="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" ''' -dependencies = [ "libpng", "crash_cxx", "crash_cc" ] +dependencies = ["libpng", "crash_cxx", "crash_cc"] # Harness [tasks.fuzzer] @@ -104,8 +108,17 @@ windows_alias = "unsupported" [tasks.fuzzer_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["${PROJECT_DIR}/harness.cc", "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", "-I", "${PROJECT_DIR}/libpng-1.6.37/", "-o", "${FUZZER_NAME}", "-lm", "-lz"] -dependencies = [ "lib", "cxx", "cc" ] +args = [ + "${PROJECT_DIR}/harness.cc", + "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", + "-I", + "${PROJECT_DIR}/libpng-1.6.37/", + "-o", + "${FUZZER_NAME}", + "-lm", + "-lz", +] +dependencies = ["lib", "cxx", "cc"] # Crashing Harness [tasks.fuzzer_crash] @@ -115,8 +128,17 @@ windows_alias = "unsupported" [tasks.fuzzer_crash_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["${PROJECT_DIR}/harness.cc", "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", "-I", "${PROJECT_DIR}/libpng-1.6.37/", "-o", "${FUZZER_NAME}_crash", "-lm", "-lz"] -dependencies = [ "crash_lib", "crash_cxx", "crash_cc" ] +args = [ + "${PROJECT_DIR}/harness.cc", + "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", + "-I", + "${PROJECT_DIR}/libpng-1.6.37/", + "-o", + "${FUZZER_NAME}_crash", + "-lm", + "-lz", +] +dependencies = ["crash_lib", "crash_cxx", "crash_cc"] # Run the fuzzer [tasks.run] @@ -126,12 +148,12 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} & sleep 0.2 ./${FUZZER_NAME} 2>/dev/null ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Run the fuzzer with a crash @@ -142,13 +164,12 @@ windows_alias = "unsupported" [tasks.crash_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME}_crash & sleep 0.2 ./${FUZZER_NAME}_crash 2>/dev/null ''' -dependencies = [ "fuzzer_crash" ] - +dependencies = ["fuzzer_crash"] # Test @@ -159,7 +180,7 @@ windows_alias = "unsupported" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) & sleep 0.2 @@ -171,17 +192,17 @@ else exit 1 fi ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.test_mac] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) & sleep 0.2 timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] @@ -192,8 +213,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} make -C libpng-1.6.37 clean cargo clean diff --git a/fuzzers/libpng/libfuzzer_libpng_accounting/Cargo.toml b/fuzzers/libpng/libfuzzer_libpng_accounting/Cargo.toml index 94394e4e01..853e67753d 100644 --- a/fuzzers/libpng/libfuzzer_libpng_accounting/Cargo.toml +++ b/fuzzers/libpng/libfuzzer_libpng_accounting/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "libfuzzer_libpng_accounting" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -19,9 +22,21 @@ cc = { version = "1.0", features = ["parallel"] } which = "6.0" [dependencies] -libafl = { path = "../../../libafl/", features = ["std", "derive", "llmp_compression", "introspection"] } -libafl_bolts = { path = "../../../libafl_bolts/", features = ["std", "derive", "llmp_compression"] } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "libfuzzer"] } +libafl = { path = "../../../libafl/", features = [ + "std", + "derive", + "llmp_compression", + "introspection", +] } +libafl_bolts = { path = "../../../libafl_bolts/", features = [ + "std", + "derive", + "llmp_compression", +] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "libfuzzer", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } clap = { version = "4.5", features = ["derive"] } diff --git a/fuzzers/libpng/libfuzzer_libpng_accounting/Makefile.toml b/fuzzers/libpng/libfuzzer_libpng_accounting/Makefile.toml index 13aaf5e3a3..20e0642934 100644 --- a/fuzzers/libpng/libfuzzer_libpng_accounting/Makefile.toml +++ b/fuzzers/libpng/libfuzzer_libpng_accounting/Makefile.toml @@ -1,17 +1,21 @@ # Variables [env] -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} -FUZZER_NAME='fuzzer_libpng_accounting' +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } +FUZZER_NAME = 'fuzzer_libpng_accounting' LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc' LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx' FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' PROJECT_DIR = { script = ["pwd"] } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this platform" ''' @@ -22,9 +26,9 @@ mac_alias = "libpng_unix" windows_alias = "unsupported" [tasks.libpng_unix] -condition = { files_not_exist = ["./libpng-1.6.37"]} -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./libpng-1.6.37"] } +script_runner = "@shell" +script = ''' wget https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz tar -xvf v1.6.37.tar.gz ''' @@ -37,7 +41,7 @@ windows_alias = "unsupported" [tasks.cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] linux_alias = "cc_unix" @@ -46,7 +50,7 @@ windows_alias = "unsupported" [tasks.cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] # Library [tasks.lib] @@ -55,13 +59,13 @@ mac_alias = "lib_unix" windows_alias = "unsupported" [tasks.lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" make -C libpng-1.6.37 CC="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" CXX="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" ''' -dependencies = [ "libpng", "cxx", "cc" ] +dependencies = ["libpng", "cxx", "cc"] # Harness @@ -72,8 +76,17 @@ windows_alias = "unsupported" [tasks.fuzzer_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["${PROJECT_DIR}/harness.cc", "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", "-I", "${PROJECT_DIR}/libpng-1.6.37/", "-o", "${FUZZER_NAME}", "-lm", "-lz"] -dependencies = [ "lib", "cxx", "cc" ] +args = [ + "${PROJECT_DIR}/harness.cc", + "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", + "-I", + "${PROJECT_DIR}/libpng-1.6.37/", + "-o", + "${FUZZER_NAME}", + "-lm", + "-lz", +] +dependencies = ["lib", "cxx", "cc"] # Run the fuzzer [tasks.run] @@ -83,10 +96,10 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} --cores 0 --input ./corpus ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Test [tasks.test] @@ -96,7 +109,7 @@ windows_alias = "unsupported" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus | tee fuzz_stdout.log 2>/dev/null || true if grep -qa "corpus: 30" fuzz_stdout.log; then @@ -106,15 +119,15 @@ else exit 1 fi ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.test_mac] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus | tee fuzz_stdout.log 2>/dev/null || true ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] @@ -125,8 +138,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} make -C libpng-1.6.37 clean cargo clean diff --git a/fuzzers/libpng/libfuzzer_libpng_centralized/Cargo.toml b/fuzzers/libpng/libfuzzer_libpng_centralized/Cargo.toml index 9801ecd2c1..c4a91b226d 100644 --- a/fuzzers/libpng/libfuzzer_libpng_centralized/Cargo.toml +++ b/fuzzers/libpng/libfuzzer_libpng_centralized/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "libfuzzer_libpng_launcher_centralized" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -19,9 +22,23 @@ cc = { version = "1.0", features = ["parallel"] } which = "6.0" [dependencies] -libafl = { path = "../../../libafl/", features = ["std", "derive", "rand_trait", "fork", "prelude", "gzip", "regex", "scalability_introspection"] } -libafl_bolts = { path = "../../../libafl_bolts/", features = ["errors_backtrace"] } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "libfuzzer"] } +libafl = { path = "../../../libafl/", features = [ + "std", + "derive", + "rand_trait", + "fork", + "prelude", + "gzip", + "regex", + "scalability_introspection", +] } +libafl_bolts = { path = "../../../libafl_bolts/", features = [ + "errors_backtrace", +] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "libfuzzer", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } clap = { version = "4.5", features = ["derive"] } diff --git a/fuzzers/libpng/libfuzzer_libpng_centralized/Makefile.toml b/fuzzers/libpng/libfuzzer_libpng_centralized/Makefile.toml index a1e30b393d..a7092a97a3 100644 --- a/fuzzers/libpng/libfuzzer_libpng_centralized/Makefile.toml +++ b/fuzzers/libpng/libfuzzer_libpng_centralized/Makefile.toml @@ -1,17 +1,21 @@ # Variables [env] -FUZZER_NAME='fuzzer_libpng_launcher' -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +FUZZER_NAME = 'fuzzer_libpng_launcher' +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc' LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx' FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' PROJECT_DIR = { script = ["pwd"] } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this platform" ''' @@ -22,9 +26,9 @@ mac_alias = "libpng_unix" windows_alias = "unsupported" [tasks.libpng_unix] -condition = { files_not_exist = ["./libpng-1.6.37"]} -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./libpng-1.6.37"] } +script_runner = "@shell" +script = ''' wget https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz tar -xvf v1.6.37.tar.gz ''' @@ -37,7 +41,7 @@ windows_alias = "unsupported" [tasks.cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] linux_alias = "cc_unix" @@ -46,7 +50,7 @@ windows_alias = "unsupported" [tasks.cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] # Library [tasks.lib] @@ -55,13 +59,13 @@ mac_alias = "lib_unix" windows_alias = "unsupported" [tasks.lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" make -C libpng-1.6.37 CC="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" CXX="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" ''' -dependencies = [ "libpng", "cxx", "cc" ] +dependencies = ["libpng", "cxx", "cc"] # Harness @@ -72,8 +76,17 @@ windows_alias = "unsupported" [tasks.fuzzer_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["${PROJECT_DIR}/harness.cc", "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", "-I", "${PROJECT_DIR}/libpng-1.6.37/", "-o", "${FUZZER_NAME}", "-lm", "-lz"] -dependencies = [ "lib", "cxx", "cc" ] +args = [ + "${PROJECT_DIR}/harness.cc", + "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", + "-I", + "${PROJECT_DIR}/libpng-1.6.37/", + "-o", + "${FUZZER_NAME}", + "-lm", + "-lz", +] +dependencies = ["lib", "cxx", "cc"] # Run the fuzzer [tasks.run] @@ -83,10 +96,10 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} --cores 0-1 --input ./corpus ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Test [tasks.test] @@ -96,7 +109,7 @@ windows_alias = "unsupported" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 31s ./${FUZZER_NAME} --cores 0-1 --input ./corpus 2>/dev/null | tee fuzz_stdout.log || true if grep -qa "corpus: 30" fuzz_stdout.log; then @@ -106,15 +119,15 @@ else exit 1 fi ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.test_mac] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null | tee fuzz_stdout.log || true ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] @@ -125,8 +138,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} make -C libpng-1.6.37 clean cargo clean diff --git a/fuzzers/libpng/libfuzzer_libpng_cmin/Cargo.toml b/fuzzers/libpng/libfuzzer_libpng_cmin/Cargo.toml index e38c882f70..ad2e8e304a 100644 --- a/fuzzers/libpng/libfuzzer_libpng_cmin/Cargo.toml +++ b/fuzzers/libpng/libfuzzer_libpng_cmin/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "libfuzzer_libpng_cmin" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier ", "Addison Crump "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", + "Addison Crump ", +] edition = "2021" [features] @@ -25,7 +29,11 @@ env_logger = "0.10" libafl = { path = "../../../libafl/", features = ["default", "cmin"] } # libafl = { path = "../../../libafl/", features = ["default"] } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "libfuzzer", "sancov_cmplog"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "libfuzzer", + "sancov_cmplog", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } mimalloc = { version = "*", default-features = false } diff --git a/fuzzers/libpng/libfuzzer_libpng_cmin/Makefile.toml b/fuzzers/libpng/libfuzzer_libpng_cmin/Makefile.toml index b590ba024b..a1e83768e0 100644 --- a/fuzzers/libpng/libfuzzer_libpng_cmin/Makefile.toml +++ b/fuzzers/libpng/libfuzzer_libpng_cmin/Makefile.toml @@ -1,17 +1,21 @@ # Variables [env] -FUZZER_NAME='fuzzer_libpng' +FUZZER_NAME = 'fuzzer_libpng' PROJECT_DIR = { script = ["pwd"] } -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc' LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx' FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -22,9 +26,9 @@ mac_alias = "libpng_unix" windows_alias = "unsupported" [tasks.libpng_unix] -condition = { files_not_exist = ["./libpng-1.6.37"]} -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./libpng-1.6.37"] } +script_runner = "@shell" +script = ''' wget https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz tar -xvf v1.6.37.tar.gz ''' @@ -37,7 +41,7 @@ windows_alias = "unsupported" [tasks.cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] linux_alias = "cc_unix" @@ -46,7 +50,7 @@ windows_alias = "unsupported" [tasks.cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.crash_cxx] linux_alias = "crash_cxx_unix" @@ -55,7 +59,7 @@ windows_alias = "unsupported" [tasks.crash_cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}", "--features=crash"] +args = ["build", "--profile", "${PROFILE}", "--features=crash"] [tasks.crash_cc] linux_alias = "crash_cc_unix" @@ -64,7 +68,7 @@ windows_alias = "unsupported" [tasks.crash_cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}", "--features=crash"] +args = ["build", "--profile", "${PROFILE}", "--features=crash"] # Library [tasks.lib] @@ -73,13 +77,13 @@ mac_alias = "lib_unix" windows_alias = "unsupported" [tasks.lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" make -C libpng-1.6.37 CC="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" CXX="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" ''' -dependencies = [ "libpng", "cxx", "cc" ] +dependencies = ["libpng", "cxx", "cc"] # Library [tasks.crash_lib] @@ -88,13 +92,13 @@ mac_alias = "crash_lib_unix" windows_alias = "unsupported" [tasks.crash_lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" make -C libpng-1.6.37 CC="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" CXX="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" ''' -dependencies = [ "libpng", "crash_cxx", "crash_cc" ] +dependencies = ["libpng", "crash_cxx", "crash_cc"] # Harness [tasks.fuzzer] @@ -104,8 +108,18 @@ windows_alias = "unsupported" [tasks.fuzzer_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["${PROJECT_DIR}/harness.cc", "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", "-I", "${PROJECT_DIR}/libpng-1.6.37/", "-o", "${FUZZER_NAME}", "-lm", "-lz", "-lz3"] -dependencies = [ "lib", "cxx", "cc" ] +args = [ + "${PROJECT_DIR}/harness.cc", + "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", + "-I", + "${PROJECT_DIR}/libpng-1.6.37/", + "-o", + "${FUZZER_NAME}", + "-lm", + "-lz", + "-lz3", +] +dependencies = ["lib", "cxx", "cc"] # Crashing Harness [tasks.fuzzer_crash] @@ -115,8 +129,18 @@ windows_alias = "unsupported" [tasks.fuzzer_crash_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["${PROJECT_DIR}/harness.cc", "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", "-I", "${PROJECT_DIR}/libpng-1.6.37/", "-o", "${FUZZER_NAME}_crash", "-lm", "-lz", "-lz3"] -dependencies = [ "crash_lib", "crash_cxx", "crash_cc" ] +args = [ + "${PROJECT_DIR}/harness.cc", + "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", + "-I", + "${PROJECT_DIR}/libpng-1.6.37/", + "-o", + "${FUZZER_NAME}_crash", + "-lm", + "-lz", + "-lz3", +] +dependencies = ["crash_lib", "crash_cxx", "crash_cc"] # Run the fuzzer [tasks.run] @@ -126,12 +150,12 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} & sleep 0.2 ./${FUZZER_NAME} 2>/dev/null ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Run the fuzzer with a crash @@ -142,13 +166,12 @@ windows_alias = "unsupported" [tasks.crash_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME}_crash & sleep 0.2 ./${FUZZER_NAME}_crash 2>/dev/null ''' -dependencies = [ "fuzzer_crash" ] - +dependencies = ["fuzzer_crash"] # Test @@ -159,7 +182,7 @@ windows_alias = "unsupported" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log & sleep 0.2 @@ -171,17 +194,17 @@ else exit 1 fi ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.test_mac] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log & sleep 0.2 timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] @@ -192,8 +215,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} make -C libpng-1.6.37 clean cargo clean diff --git a/fuzzers/libpng/libfuzzer_libpng_launcher/Cargo.toml b/fuzzers/libpng/libfuzzer_libpng_launcher/Cargo.toml index 8d4de66eaf..aeffe48954 100644 --- a/fuzzers/libpng/libfuzzer_libpng_launcher/Cargo.toml +++ b/fuzzers/libpng/libfuzzer_libpng_launcher/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "libfuzzer_libpng_launcher" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -19,9 +22,17 @@ cc = { version = "1.0", features = ["parallel"] } which = "6.0" [dependencies] -libafl = { path = "../../../libafl/", features = ["std", "derive", "llmp_compression", "introspection"] } +libafl = { path = "../../../libafl/", features = [ + "std", + "derive", + "llmp_compression", + "introspection", +] } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "libfuzzer"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "libfuzzer", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } clap = { version = "4.5", features = ["derive"] } diff --git a/fuzzers/libpng/libfuzzer_libpng_launcher/Makefile.toml b/fuzzers/libpng/libfuzzer_libpng_launcher/Makefile.toml index 86f63f1613..437a9cf7dc 100644 --- a/fuzzers/libpng/libfuzzer_libpng_launcher/Makefile.toml +++ b/fuzzers/libpng/libfuzzer_libpng_launcher/Makefile.toml @@ -1,9 +1,13 @@ # Variables [env] -FUZZER_NAME='fuzzer_libpng_launcher' -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +FUZZER_NAME = 'fuzzer_libpng_launcher' +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc' LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx' LIBAFL_LIBTOOL = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_libtool' @@ -11,8 +15,8 @@ FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' PROJECT_DIR = { script = ["pwd"] } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this platform" ''' @@ -23,9 +27,9 @@ mac_alias = "libpng_unix" windows_alias = "unsupported" [tasks.libpng_unix] -condition = { files_not_exist = ["./libpng-1.6.37"]} -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./libpng-1.6.37"] } +script_runner = "@shell" +script = ''' wget https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz tar -xvf v1.6.37.tar.gz ''' @@ -38,7 +42,7 @@ windows_alias = "unsupported" [tasks.cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] linux_alias = "cc_unix" @@ -47,7 +51,7 @@ windows_alias = "unsupported" [tasks.cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] # Library [tasks.lib] @@ -56,13 +60,13 @@ mac_alias = "lib_unix" windows_alias = "unsupported" [tasks.lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && CC="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" CXX="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" make -C libpng-1.6.37 CC="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" CXX="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" LIBTOOL=${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_libtool ''' -dependencies = [ "libpng", "cxx", "cc" ] +dependencies = ["libpng", "cxx", "cc"] # Harness @@ -73,8 +77,17 @@ windows_alias = "unsupported" [tasks.fuzzer_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["${PROJECT_DIR}/harness.cc", "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", "-I", "${PROJECT_DIR}/libpng-1.6.37/", "-o", "${FUZZER_NAME}", "-lm", "-lz"] -dependencies = [ "lib", "cxx", "cc" ] +args = [ + "${PROJECT_DIR}/harness.cc", + "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", + "-I", + "${PROJECT_DIR}/libpng-1.6.37/", + "-o", + "${FUZZER_NAME}", + "-lm", + "-lz", +] +dependencies = ["lib", "cxx", "cc"] # Run the fuzzer [tasks.run] @@ -84,10 +97,10 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME}.coverage --broker-port 21337 --cores 0 --input ./corpus ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Test [tasks.test] @@ -97,7 +110,7 @@ windows_alias = "unsupported" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 31s ./${FUZZER_NAME}.coverage --broker-port 21337 --cores 0 --input ./corpus 2>/dev/null | tee fuzz_stdout.log || true if grep -qa "corpus: 30" fuzz_stdout.log; then @@ -107,15 +120,15 @@ else exit 1 fi ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.test_mac] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null | tee fuzz_stdout.log || true ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] @@ -126,8 +139,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} make -C libpng-1.6.37 clean cargo clean diff --git a/fuzzers/libpng/libfuzzer_libpng_norestart/Cargo.toml b/fuzzers/libpng/libfuzzer_libpng_norestart/Cargo.toml index 0d27fa1eda..82f15aefb8 100644 --- a/fuzzers/libpng/libfuzzer_libpng_norestart/Cargo.toml +++ b/fuzzers/libpng/libfuzzer_libpng_norestart/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "libfuzzer_libpng_launcher_norestart" version = "0.9.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -21,8 +24,13 @@ which = "6.0" [dependencies] env_logger = "0.10" libafl = { path = "../../../libafl/" } -libafl_bolts = { path = "../../../libafl_bolts/", features = ["errors_backtrace"] } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "libfuzzer"] } +libafl_bolts = { path = "../../../libafl_bolts/", features = [ + "errors_backtrace", +] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "libfuzzer", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } clap = { version = "4.5", features = ["derive"] } diff --git a/fuzzers/libpng/libfuzzer_libpng_norestart/Makefile.toml b/fuzzers/libpng/libfuzzer_libpng_norestart/Makefile.toml index e63e7bc674..dbb1e2c7a8 100644 --- a/fuzzers/libpng/libfuzzer_libpng_norestart/Makefile.toml +++ b/fuzzers/libpng/libfuzzer_libpng_norestart/Makefile.toml @@ -1,17 +1,21 @@ # Variables [env] -FUZZER_NAME='fuzzer_libpng_launcher' -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +FUZZER_NAME = 'fuzzer_libpng_launcher' +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc' LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx' FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' PROJECT_DIR = { script = ["pwd"] } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this platform" ''' @@ -22,9 +26,9 @@ mac_alias = "libpng_unix" windows_alias = "unsupported" [tasks.libpng_unix] -condition = { files_not_exist = ["./libpng-1.6.37"]} -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./libpng-1.6.37"] } +script_runner = "@shell" +script = ''' wget https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz tar -xvf v1.6.37.tar.gz ''' @@ -36,7 +40,7 @@ windows_alias = "unsupported" [tasks.cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] # Library [tasks.lib] @@ -45,13 +49,13 @@ mac_alias = "lib_unix" windows_alias = "unsupported" [tasks.lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" make -C libpng-1.6.37 CC="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" CXX="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" ''' -dependencies = [ "libpng", "cc" ] +dependencies = ["libpng", "cc"] # Harness @@ -62,8 +66,17 @@ windows_alias = "unsupported" [tasks.fuzzer_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["${PROJECT_DIR}/harness.cc", "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", "-I", "${PROJECT_DIR}/libpng-1.6.37/", "-o", "${FUZZER_NAME}", "-lm", "-lz"] -dependencies = [ "lib", "cc" ] +args = [ + "${PROJECT_DIR}/harness.cc", + "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", + "-I", + "${PROJECT_DIR}/libpng-1.6.37/", + "-o", + "${FUZZER_NAME}", + "-lm", + "-lz", +] +dependencies = ["lib", "cc"] # Run the fuzzer [tasks.run] @@ -73,13 +86,13 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf corpus/ || true mkdir corpus/ || true cp seeds/* corpus/ || true ./${FUZZER_NAME} --cores 0 --input ./corpus ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Test [tasks.test] @@ -89,7 +102,7 @@ windows_alias = "unsupported" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true rm -rf corpus/ || true mkdir corpus/ || true @@ -102,7 +115,7 @@ else exit 1 fi ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] @@ -113,8 +126,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf corpus/ || true rm -f ./${FUZZER_NAME} make -C libpng-1.6.37 clean diff --git a/fuzzers/libpng/libfuzzer_libpng_tcp_manager/Cargo.toml b/fuzzers/libpng/libfuzzer_libpng_tcp_manager/Cargo.toml index 6a5d3cffbd..e50acb5877 100644 --- a/fuzzers/libpng/libfuzzer_libpng_tcp_manager/Cargo.toml +++ b/fuzzers/libpng/libfuzzer_libpng_tcp_manager/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "libfuzzer_libpng_tcp_manager" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -24,7 +27,11 @@ which = "6.0" libafl = { path = "../../../libafl/", features = ["default", "tcp_manager"] } # libafl = { path = "../../../libafl/", features = ["default"] } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "libfuzzer", "sancov_cmplog"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "libfuzzer", + "sancov_cmplog", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } mimalloc = { version = "*", default-features = false } diff --git a/fuzzers/libpng/libfuzzer_libpng_tcp_manager/Makefile.toml b/fuzzers/libpng/libfuzzer_libpng_tcp_manager/Makefile.toml index fb1dc6cfd2..9b7c61978e 100644 --- a/fuzzers/libpng/libfuzzer_libpng_tcp_manager/Makefile.toml +++ b/fuzzers/libpng/libfuzzer_libpng_tcp_manager/Makefile.toml @@ -1,17 +1,21 @@ # Variables [env] -FUZZER_NAME='fuzzer_libpng' +FUZZER_NAME = 'fuzzer_libpng' PROJECT_DIR = { script = ["pwd"] } -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc' LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx' FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -22,9 +26,9 @@ mac_alias = "libpng_unix" windows_alias = "unsupported" [tasks.libpng_unix] -condition = { files_not_exist = ["./libpng-1.6.37"]} -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./libpng-1.6.37"] } +script_runner = "@shell" +script = ''' wget https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz tar -xvf v1.6.37.tar.gz ''' @@ -37,7 +41,7 @@ windows_alias = "unsupported" [tasks.cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] linux_alias = "cc_unix" @@ -46,7 +50,7 @@ windows_alias = "unsupported" [tasks.cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.crash_cxx] linux_alias = "crash_cxx_unix" @@ -55,7 +59,7 @@ windows_alias = "unsupported" [tasks.crash_cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}", "--features=crash"] +args = ["build", "--profile", "${PROFILE}", "--features=crash"] [tasks.crash_cc] linux_alias = "crash_cc_unix" @@ -64,7 +68,7 @@ windows_alias = "unsupported" [tasks.crash_cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}", "--features=crash"] +args = ["build", "--profile", "${PROFILE}", "--features=crash"] # Library [tasks.lib] @@ -73,13 +77,13 @@ mac_alias = "lib_unix" windows_alias = "unsupported" [tasks.lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" make -C libpng-1.6.37 CC="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" CXX="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" ''' -dependencies = [ "libpng", "cxx", "cc" ] +dependencies = ["libpng", "cxx", "cc"] # Library [tasks.crash_lib] @@ -88,13 +92,13 @@ mac_alias = "crash_lib_unix" windows_alias = "unsupported" [tasks.crash_lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" make -C libpng-1.6.37 CC="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" CXX="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" ''' -dependencies = [ "libpng", "crash_cxx", "crash_cc" ] +dependencies = ["libpng", "crash_cxx", "crash_cc"] # Harness [tasks.fuzzer] @@ -104,8 +108,17 @@ windows_alias = "unsupported" [tasks.fuzzer_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["${PROJECT_DIR}/harness.cc", "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", "-I", "${PROJECT_DIR}/libpng-1.6.37/", "-o", "${FUZZER_NAME}", "-lm", "-lz"] -dependencies = [ "lib", "cxx", "cc" ] +args = [ + "${PROJECT_DIR}/harness.cc", + "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", + "-I", + "${PROJECT_DIR}/libpng-1.6.37/", + "-o", + "${FUZZER_NAME}", + "-lm", + "-lz", +] +dependencies = ["lib", "cxx", "cc"] # Crashing Harness [tasks.fuzzer_crash] @@ -115,8 +128,17 @@ windows_alias = "unsupported" [tasks.fuzzer_crash_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["${PROJECT_DIR}/harness.cc", "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", "-I", "${PROJECT_DIR}/libpng-1.6.37/", "-o", "${FUZZER_NAME}_crash", "-lm", "-lz"] -dependencies = [ "crash_lib", "crash_cxx", "crash_cc" ] +args = [ + "${PROJECT_DIR}/harness.cc", + "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", + "-I", + "${PROJECT_DIR}/libpng-1.6.37/", + "-o", + "${FUZZER_NAME}_crash", + "-lm", + "-lz", +] +dependencies = ["crash_lib", "crash_cxx", "crash_cc"] # Run the fuzzer [tasks.run] @@ -126,12 +148,12 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} & sleep 0.2 ./${FUZZER_NAME} 2>/dev/null ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Run the fuzzer with a crash @@ -142,13 +164,12 @@ windows_alias = "unsupported" [tasks.crash_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME}_crash & sleep 0.2 ./${FUZZER_NAME}_crash 2>/dev/null ''' -dependencies = [ "fuzzer_crash" ] - +dependencies = ["fuzzer_crash"] # Test @@ -159,7 +180,7 @@ windows_alias = "unsupported" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) & sleep 0.2 @@ -171,17 +192,17 @@ else exit 1 fi ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.test_mac] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) & sleep 0.2 timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] @@ -192,8 +213,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} make -C libpng-1.6.37 clean cargo clean diff --git a/fuzzers/nyx/nyx_libxml2_parallel/Makefile.toml b/fuzzers/nyx/nyx_libxml2_parallel/Makefile.toml index ded65f8afd..f3283a2767 100644 --- a/fuzzers/nyx/nyx_libxml2_parallel/Makefile.toml +++ b/fuzzers/nyx/nyx_libxml2_parallel/Makefile.toml @@ -1,20 +1,20 @@ # Variables [env] -FUZZER_NAME='nyx_libxml2_parallel' +FUZZER_NAME = 'nyx_libxml2_parallel' PROJECT_DIR = { script = ["pwd"] } [config] skip_core_tasks = true # skip `cargo test` to avoid error [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this platform" ''' [tasks.build] -dependencies = [ "libxml2" ] +dependencies = ["libxml2"] [tasks.libxml2] linux_alias = "libxml2_unix" @@ -23,14 +23,14 @@ windows_alias = "unsupported" [tasks.libxml2_unix] # condition = { files_not_exist = ["./libxml2"]} -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' ./setup_libxml2.sh ''' [tasks.enable_kvm_vmware_hypercall] script_runner = "@shell" -script=''' +script = ''' if [ ! -e /sys/module/kvm/parameters/enable_vmware_backdoor ] || ! grep -qF Y /sys/module/kvm/parameters/enable_vmware_backdoor; then sudo modprobe -r kvm-intel # or kvm-amd for AMD @@ -48,10 +48,10 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' cargo run ''' -dependencies = [ "libxml2", "enable_kvm_vmware_hypercall" ] +dependencies = ["libxml2", "enable_kvm_vmware_hypercall"] # Clean up [tasks.clean] @@ -62,8 +62,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' make -C ./libxml2 clean cargo clean ''' diff --git a/fuzzers/nyx/nyx_libxml2_standalone/Makefile.toml b/fuzzers/nyx/nyx_libxml2_standalone/Makefile.toml index 904359f285..7fb8746b1a 100644 --- a/fuzzers/nyx/nyx_libxml2_standalone/Makefile.toml +++ b/fuzzers/nyx/nyx_libxml2_standalone/Makefile.toml @@ -1,20 +1,20 @@ # Variables [env] -FUZZER_NAME='nyx_libxml2_standalone' +FUZZER_NAME = 'nyx_libxml2_standalone' PROJECT_DIR = { script = ["pwd"] } [config] skip_core_tasks = true # skip `cargo test` to avoid error [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this platform" ''' [tasks.build] -dependencies = [ "libxml2" ] +dependencies = ["libxml2"] [tasks.libxml2] linux_alias = "libxml2_unix" @@ -23,14 +23,14 @@ windows_alias = "unsupported" [tasks.libxml2_unix] # condition = { files_not_exist = ["./libxml2"]} -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' ./setup_libxml2.sh ''' [tasks.enable_kvm_vmware_hypercall] script_runner = "@shell" -script=''' +script = ''' if [ ! -e /sys/module/kvm/parameters/enable_vmware_backdoor ] || ! grep -qF Y /sys/module/kvm/parameters/enable_vmware_backdoor; then sudo modprobe -r kvm-intel # or kvm-amd for AMD @@ -48,10 +48,10 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' cargo run ''' -dependencies = [ "libxml2", "enable_kvm_vmware_hypercall" ] +dependencies = ["libxml2", "enable_kvm_vmware_hypercall"] # Clean up [tasks.clean] @@ -62,8 +62,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' make -C ./libxml2 clean cargo clean ''' diff --git a/fuzzers/others/cargo_fuzz/Cargo.toml b/fuzzers/others/cargo_fuzz/Cargo.toml index 9933834c8b..551a4b3e1d 100644 --- a/fuzzers/others/cargo_fuzz/Cargo.toml +++ b/fuzzers/others/cargo_fuzz/Cargo.toml @@ -3,10 +3,19 @@ name = "cargo_fuzz_test" edition = "2021" version = "0.0.0" description = "test" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] repository = "https://github.com/AFLplusplus/LibAFL/" keywords = ["fuzzing", "testing", "compiler"] -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/fuzzers/others/dynamic_analysis/Cargo.toml b/fuzzers/others/dynamic_analysis/Cargo.toml index 80aa2bdf9f..fd040238f2 100644 --- a/fuzzers/others/dynamic_analysis/Cargo.toml +++ b/fuzzers/others/dynamic_analysis/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "dynamic_analysis" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -29,7 +32,12 @@ env_logger = "0.11" once_cell = "1.19" libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "sancov_cmplog", "libfuzzer", "function-logging"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "sancov_cmplog", + "libfuzzer", + "function-logging", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } clap = { version = "4.5", features = ["default"] } diff --git a/fuzzers/others/dynamic_analysis/Makefile.toml b/fuzzers/others/dynamic_analysis/Makefile.toml index 036c83e5f2..6c6a7568c8 100644 --- a/fuzzers/others/dynamic_analysis/Makefile.toml +++ b/fuzzers/others/dynamic_analysis/Makefile.toml @@ -1,13 +1,17 @@ [env] PROJECT_DIR = { script = ["pwd"] } -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -FUZZER_NAME="fuzzer" -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +FUZZER_NAME = "fuzzer" +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -38,7 +42,16 @@ windows_alias = "unsupported" [tasks.fuzz_o_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["--libafl-no-link", "-O3","-I", "./Little-CMS/include", "-c", "cms_transform_fuzzer.cc", "-o", "cms_transform_fuzzer.o"] +args = [ + "--libafl-no-link", + "-O3", + "-I", + "./Little-CMS/include", + "-c", + "cms_transform_fuzzer.cc", + "-o", + "cms_transform_fuzzer.o", +] dependencies = ["cc", "cxx"] # Fuzzer @@ -49,7 +62,15 @@ windows_alias = "unsupported" [tasks.fuzzer_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["--libafl", "cms_transform_fuzzer.o", "./Little-CMS/src/.libs/liblcms2.a", "-o", "${FUZZER_NAME}", "-lm", "-lz"] +args = [ + "--libafl", + "cms_transform_fuzzer.o", + "./Little-CMS/src/.libs/liblcms2.a", + "-o", + "${FUZZER_NAME}", + "-lm", + "-lz", +] dependencies = ["cc", "cxx", "fuzz_o"] # Run @@ -59,8 +80,8 @@ mac_alias = "run_unix" windows_alias = "unsupported" [tasks.run_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf libafl_unix_shmem_server || true mkdir in || true echo a > in/a @@ -76,8 +97,8 @@ mac_alias = "test_unix" windows_alias = "unsupported" [tasks.test_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf libafl_unix_shmem_server || true mkdir in || true echo a > in/a @@ -101,8 +122,8 @@ mac_alias = "clean_unix" windows_alias = "unsupported" [tasks.clean_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm ./${FUZZER_NAME} || true rm fuzz.o || true ''' diff --git a/fuzzers/others/libafl-fuzz/Cargo.toml b/fuzzers/others/libafl-fuzz/Cargo.toml index fcf7cc35fd..700e9daa57 100644 --- a/fuzzers/others/libafl-fuzz/Cargo.toml +++ b/fuzzers/others/libafl-fuzz/Cargo.toml @@ -6,11 +6,20 @@ edition = "2021" [dependencies] clap = { version = "4.5", features = ["derive", "env"] } env_logger = "0.11.3" -libafl = { path = "../../../libafl", features = ["std", "derive", "track_hit_feedbacks", "clap", "errors_backtrace"]} -libafl_bolts = { path = "../../../libafl_bolts", features = ["std", "errors_backtrace"]} -libafl_targets = { path = "../../../libafl_targets"} +libafl = { path = "../../../libafl", features = [ + "std", + "derive", + "track_hit_feedbacks", + "clap", + "errors_backtrace", +] } +libafl_bolts = { path = "../../../libafl_bolts", features = [ + "std", + "errors_backtrace", +] } +libafl_targets = { path = "../../../libafl_targets" } memmap2 = "0.9.4" -nix = {version = "0.29", features = ["fs"]} +nix = { version = "0.29", features = ["fs"] } regex = "1.10.5" serde = { version = "1.0.117", features = ["derive"] } diff --git a/fuzzers/others/libafl-fuzz/Makefile.toml b/fuzzers/others/libafl-fuzz/Makefile.toml index 5bd29e2cd6..e62facbcc1 100644 --- a/fuzzers/others/libafl-fuzz/Makefile.toml +++ b/fuzzers/others/libafl-fuzz/Makefile.toml @@ -1,19 +1,25 @@ [env] PROJECT_DIR = { script = ["pwd"] } -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } FUZZER_NAME = 'libafl-fuzz' FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' -LLVM_CONFIG = {value = "llvm-config-18", condition = {env_not_set = ["LLVM_CONFIG"] }} +LLVM_CONFIG = { value = "llvm-config-18", condition = { env_not_set = [ + "LLVM_CONFIG", +] } } AFL_VERSION = "db23931e7c1727ddac8691a6241c97b2203ec6fc" AFL_DIR_NAME= {value = "./AFLplusplus-${AFL_VERSION}"} AFL_CC_PATH= {value = "${AFL_DIR_NAME}/afl-clang-fast"} [tasks.build_afl] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' if [ ! -d "$AFL_DIR_NAME" ]; then if [ -f "v${AFL_VERSION}.zip" ]; then rm v${AFL_VERSION}.zip @@ -33,8 +39,8 @@ mac_alias = "test_unix" windows_alias = "unsupported" [tasks.test_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cargo build --profile ${PROFILE} AFL_PATH=${AFL_DIR_NAME} ${AFL_CC_PATH} ./test/test-instr.c -o ./test/out-instr LIBAFL_DEBUG_OUTPUT=1 AFL_CORES=1 AFL_STATS_INTERVAL=1 timeout 5 ${FUZZER} -i ./test/seeds -o ./test/output ./test/out-instr || true @@ -74,8 +80,8 @@ mac_alias = "clean_unix" windows_alias = "unsupported" [tasks.clean_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf AFLplusplus-${AFL_VERSION} rm ${AFL_VERSION}.zip rm -rf ./test/out-instr diff --git a/fuzzers/others/libafl_atheris/Cargo.toml b/fuzzers/others/libafl_atheris/Cargo.toml index fe686292d0..b706adb65e 100644 --- a/fuzzers/others/libafl_atheris/Cargo.toml +++ b/fuzzers/others/libafl_atheris/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "libafl_atheris" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -21,7 +24,12 @@ which = "6.0" [dependencies] libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["pointer_maps", "sancov_cmplog", "libfuzzer", "sancov_8bit"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "pointer_maps", + "sancov_cmplog", + "libfuzzer", + "sancov_8bit", +] } clap = { version = "4.5", features = ["default"] } [lib] diff --git a/fuzzers/others/libfuzzer_libmozjpeg/Cargo.toml b/fuzzers/others/libfuzzer_libmozjpeg/Cargo.toml index bfb062090a..0117936610 100644 --- a/fuzzers/others/libfuzzer_libmozjpeg/Cargo.toml +++ b/fuzzers/others/libfuzzer_libmozjpeg/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "libfuzzer_libmozjpeg" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -17,7 +20,11 @@ debug = true [dependencies] libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_edges", "sancov_value_profile", "libfuzzer"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_edges", + "sancov_value_profile", + "libfuzzer", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } mimalloc = { version = "*", default-features = false } diff --git a/fuzzers/others/libfuzzer_libmozjpeg/Makefile.toml b/fuzzers/others/libfuzzer_libmozjpeg/Makefile.toml index f96e02ef2c..2da143627f 100644 --- a/fuzzers/others/libfuzzer_libmozjpeg/Makefile.toml +++ b/fuzzers/others/libfuzzer_libmozjpeg/Makefile.toml @@ -1,17 +1,21 @@ # Variables [env] -FUZZER_NAME='fuzzer_mozjpeg' -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +FUZZER_NAME = 'fuzzer_mozjpeg' +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc' LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx' FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' PROJECT_DIR = { script = ["pwd"] } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this platform" ''' @@ -22,9 +26,9 @@ mac_alias = "mozjpeg_unix" windows_alias = "unsupported" [tasks.mozjpeg_unix] -condition = { files_not_exist = ["./mozjpeg-4.0.3"]} -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./mozjpeg-4.0.3"] } +script_runner = "@shell" +script = ''' wget https://github.com/mozilla/mozjpeg/archive/v4.0.3.tar.gz tar -xzvf v4.0.3.tar.gz ''' @@ -37,7 +41,7 @@ windows_alias = "unsupported" [tasks.cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] linux_alias = "cc_unix" @@ -46,7 +50,7 @@ windows_alias = "unsupported" [tasks.cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] # Library [tasks.lib] @@ -55,12 +59,12 @@ mac_alias = "lib_unix" windows_alias = "unsupported" [tasks.lib_unix] -script=''' +script = ''' cd mozjpeg-4.0.3 && cmake . -DENABLE_SHARED=false -DPNG_SUPPORTED=false -DCMAKE_C_COMPILER="${LIBAFL_CC}" -DCMAKE_CXX_COMPILER="${LIBAFL_CXX}" -G "Unix Makefiles" cd "${PROJECT_DIR}" make -C mozjpeg-4.0.3 ''' -dependencies = [ "mozjpeg", "cxx", "cc" ] +dependencies = ["mozjpeg", "cxx", "cc"] # Harness @@ -71,8 +75,18 @@ windows_alias = "unsupported" [tasks.fuzzer_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["${PROJECT_DIR}/harness.cc", "${PROJECT_DIR}/mozjpeg-4.0.3/libjpeg.a", "${PROJECT_DIR}/mozjpeg-4.0.3/libturbojpeg.a", "-I", "${PROJECT_DIR}/mozjpeg-4.0.3/", "-o", "${FUZZER_NAME}", "-lm", "-lz"] -dependencies = [ "lib", "cxx", "cc" ] +args = [ + "${PROJECT_DIR}/harness.cc", + "${PROJECT_DIR}/mozjpeg-4.0.3/libjpeg.a", + "${PROJECT_DIR}/mozjpeg-4.0.3/libturbojpeg.a", + "-I", + "${PROJECT_DIR}/mozjpeg-4.0.3/", + "-o", + "${FUZZER_NAME}", + "-lm", + "-lz", +] +dependencies = ["lib", "cxx", "cc"] # Run the fuzzer [tasks.run] @@ -82,12 +96,12 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} & sleep 0.2 ./${FUZZER_NAME} ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Test [tasks.test] @@ -97,7 +111,7 @@ windows_alias = "unsupported" [tasks.test_linux] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) & sleep 0.2 @@ -109,10 +123,10 @@ else exit 1 fi ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.test_mac] -script=''' +script = ''' echo "Skipping build on MacOS as libpng in Github is ancient, see LibAFL GH issue #254" ''' @@ -125,8 +139,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} make -C mozjpeg-4.0.3 clean cargo clean diff --git a/fuzzers/others/libfuzzer_windows_asan/Cargo.toml b/fuzzers/others/libfuzzer_windows_asan/Cargo.toml index 6ebe426302..ea9671838e 100644 --- a/fuzzers/others/libfuzzer_windows_asan/Cargo.toml +++ b/fuzzers/others/libfuzzer_windows_asan/Cargo.toml @@ -16,7 +16,10 @@ debug = true [dependencies] libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["libfuzzer", "sancov_pcguard_edges"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "libfuzzer", + "sancov_pcguard_edges", +] } libafl_cc = { path = "../../../libafl_cc/" } [build-dependencies] diff --git a/fuzzers/others/libfuzzer_windows_asan/Makefile.toml b/fuzzers/others/libfuzzer_windows_asan/Makefile.toml index 16112f488d..b84eaf88d0 100644 --- a/fuzzers/others/libfuzzer_windows_asan/Makefile.toml +++ b/fuzzers/others/libfuzzer_windows_asan/Makefile.toml @@ -1,13 +1,17 @@ # Variables [env] -FUZZER_NAME='libfuzzer_windows_asan' -CARGO_TARGET_DIR = { value = "./target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +FUZZER_NAME = 'libfuzzer_windows_asan' +CARGO_TARGET_DIR = { value = "./target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -19,7 +23,7 @@ windows_alias = "cxx_unix" [tasks.cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] linux_alias = "cc_unix" @@ -28,7 +32,7 @@ windows_alias = "cc_unix" [tasks.cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.crash_cxx] linux_alias = "unsupported" @@ -47,7 +51,7 @@ mac_alias = "unsupported" windows_alias = "lib_unix" [tasks.lib_unix] -dependencies = [ "cxx", "cc" ] +dependencies = ["cxx", "cc"] # Harness [tasks.fuzzer] @@ -58,7 +62,7 @@ windows_alias = "fuzzer_windows" [tasks.fuzzer_windows] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" args = ["./harness.cpp", "-o", "${FUZZER_NAME}.exe"] -dependencies = [ "lib", "cxx", "cc" ] +dependencies = ["lib", "cxx", "cc"] # Run the fuzzer [tasks.run] @@ -68,9 +72,9 @@ windows_alias = "run_windows" # TODO [tasks.run_windows] script_runner = "@shell" -script=''' +script = ''' ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Test [tasks.test] @@ -80,14 +84,14 @@ windows_alias = "test_windows" # TODO [tasks.test_windows] script_runner = "@shell" -script=''' +script = ''' start "" "${FUZZER_NAME}.exe" start "" "${FUZZER_NAME}.exe" #ping is for timeout ping -n 10 127.0.0.1>NUL && taskkill /im ${FUZZER_NAME}.exe /F >nul 2>nul dir /a-d "crashes\*" && (echo Files exist) || (exit /b 1337) ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] @@ -98,8 +102,8 @@ windows_alias = "clean_windows" [tasks.clean_windows] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' del ./${FUZZER_NAME} cargo clean -''' \ No newline at end of file +''' diff --git a/fuzzers/others/nautilus_sync/Cargo.toml b/fuzzers/others/nautilus_sync/Cargo.toml index fe067299f5..2598a2125f 100644 --- a/fuzzers/others/nautilus_sync/Cargo.toml +++ b/fuzzers/others/nautilus_sync/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "nautilus_sync" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -22,7 +25,10 @@ debug = true [dependencies] libafl = { path = "../../../libafl/", features = ["default", "nautilus"] } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "libfuzzer"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "libfuzzer", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } clap = { version = "4.5", features = ["derive"] } diff --git a/fuzzers/others/nautilus_sync/Makefile.toml b/fuzzers/others/nautilus_sync/Makefile.toml index 0422ce776e..327e867106 100644 --- a/fuzzers/others/nautilus_sync/Makefile.toml +++ b/fuzzers/others/nautilus_sync/Makefile.toml @@ -1,17 +1,21 @@ # Variables [env] -FUZZER_NAME='fuzzer_libpng_nautilus' -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +FUZZER_NAME = 'fuzzer_libpng_nautilus' +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } LIBAFL_CC = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc' LIBAFL_CXX = '${CARGO_TARGET_DIR}/${PROFILE}/libafl_cxx' FUZZER = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME}' PROJECT_DIR = { script = ["pwd"] } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this platform" ''' @@ -22,9 +26,9 @@ mac_alias = "libpng_unix" windows_alias = "unsupported" [tasks.libpng_unix] -condition = { files_not_exist = ["./libpng-1.6.37"]} -script_runner="@shell" -script=''' +condition = { files_not_exist = ["./libpng-1.6.37"] } +script_runner = "@shell" +script = ''' wget https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz tar -xvf v1.6.37.tar.gz ''' @@ -37,7 +41,7 @@ windows_alias = "unsupported" [tasks.cxx_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] linux_alias = "cc_unix" @@ -46,7 +50,7 @@ windows_alias = "unsupported" [tasks.cc_unix] command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] # Library [tasks.lib] @@ -55,14 +59,14 @@ mac_alias = "lib_unix" windows_alias = "unsupported" [tasks.lib_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes cd "${PROJECT_DIR}" cp ../../baby/baby_fuzzer_nautilus/grammar.json . make -C libpng-1.6.37 CC="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc" CXX="${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" ''' -dependencies = [ "libpng", "cxx", "cc" ] +dependencies = ["libpng", "cxx", "cc"] # Harness @@ -73,8 +77,17 @@ windows_alias = "unsupported" [tasks.fuzzer_unix] command = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx" -args = ["${PROJECT_DIR}/../../libpng/libfuzzer_libpng/harness.cc", "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", "-I", "${PROJECT_DIR}/libpng-1.6.37/", "-o", "${FUZZER_NAME}", "-lm", "-lz"] -dependencies = [ "lib", "cxx", "cc" ] +args = [ + "${PROJECT_DIR}/../../libpng/libfuzzer_libpng/harness.cc", + "${PROJECT_DIR}/libpng-1.6.37/.libs/libpng16.a", + "-I", + "${PROJECT_DIR}/libpng-1.6.37/", + "-o", + "${FUZZER_NAME}", + "-lm", + "-lz", +] +dependencies = ["lib", "cxx", "cc"] # Run the fuzzer [tasks.run] @@ -84,17 +97,17 @@ windows_alias = "unsupported" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} --cores 0 ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.run_unix_sync] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} --cores 0 -b 1337 ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Test [tasks.test] @@ -104,7 +117,7 @@ windows_alias = "unsupported" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 31s ./${FUZZER_NAME} --cores 0 | tee fuzz_stdout.log 2>/dev/null || true if grep -qa "corpus: 8" fuzz_stdout.log; then @@ -114,15 +127,15 @@ else exit 1 fi ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.test_mac] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 31s ./${FUZZER_NAME} --cores 0 | tee fuzz_stdout.log 2>/dev/null || true ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] @@ -133,8 +146,8 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} make -C libpng-1.6.37 clean cargo clean diff --git a/fuzzers/others/push_harness/Cargo.toml b/fuzzers/others/push_harness/Cargo.toml index 727e6daa79..09cdb8a27b 100644 --- a/fuzzers/others/push_harness/Cargo.toml +++ b/fuzzers/others/push_harness/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "push_harness" version = "0.10.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] diff --git a/fuzzers/others/push_stage_harness/Cargo.toml b/fuzzers/others/push_stage_harness/Cargo.toml index 7f6bbfbfb2..9bf5baa385 100644 --- a/fuzzers/others/push_stage_harness/Cargo.toml +++ b/fuzzers/others/push_stage_harness/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "push_stage_harness" version = "0.10.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] diff --git a/fuzzers/others/sqlite_centralized_multi_machine/Cargo.toml b/fuzzers/others/sqlite_centralized_multi_machine/Cargo.toml index 6ec4236d04..561c259b17 100644 --- a/fuzzers/others/sqlite_centralized_multi_machine/Cargo.toml +++ b/fuzzers/others/sqlite_centralized_multi_machine/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "libfuzzer_libpng_launcher_centralized_multi_machine" version = "0.12.0" -authors = ["Romain Malmain ", "Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Romain Malmain ", + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -20,9 +24,34 @@ which = "6.0" [dependencies] # no llmp compression for now, better perfs. -libafl = { path = "../../../libafl", default-features = false, features = ["std", "derive", "llmp_small_maps", "llmp_broker_timeouts", "rand_trait", "fork", "prelude", "gzip", "regex", "serdeany_autoreg", "tui_monitor", "std", "derive", "rand_trait", "fork", "prelude", "gzip", "regex", "scalability_introspection", "multi_machine", "errors_backtrace"] } +libafl = { path = "../../../libafl", default-features = false, features = [ + "std", + "derive", + "llmp_small_maps", + "llmp_broker_timeouts", + "rand_trait", + "fork", + "prelude", + "gzip", + "regex", + "serdeany_autoreg", + "tui_monitor", + "std", + "derive", + "rand_trait", + "fork", + "prelude", + "gzip", + "regex", + "scalability_introspection", + "multi_machine", + "errors_backtrace", +] } libafl_bolts = { path = "../../../libafl_bolts", features = ["xxh3"] } -libafl_targets = { path = "../../../libafl_targets", features = ["sancov_pcguard_hitcounts", "libfuzzer"] } +libafl_targets = { path = "../../../libafl_targets", features = [ + "sancov_pcguard_hitcounts", + "libfuzzer", +] } # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc" } clap = { version = "4.5", features = ["derive"] } diff --git a/fuzzers/others/tinyinst_simple/Makefile.toml b/fuzzers/others/tinyinst_simple/Makefile.toml index 7b6aefc1a0..26a9261c05 100644 --- a/fuzzers/others/tinyinst_simple/Makefile.toml +++ b/fuzzers/others/tinyinst_simple/Makefile.toml @@ -1,11 +1,15 @@ [env] -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = { value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} -CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } +CARGO_TARGET_DIR = { value = "target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Cargo-make not integrated yet on this" ''' @@ -16,12 +20,12 @@ mac_alias = "unsupported" windows_alias = "harness_windows" [tasks.harness_linux] -script=''' +script = ''' clang test/test.cpp -o test.exe ''' [tasks.harness_windows] -script=''' +script = ''' cl test\test.cpp -o test.exe ''' @@ -65,8 +69,8 @@ mac_alias = "unsupported" windows_alias = "test_windows" [tasks.test_linux] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cp ${CARGO_TARGET_DIR}/${PROFILE_DIR}/tinyinst_simple . echo running tests timeout 5s ./tinyinst_simple || true @@ -81,11 +85,11 @@ dependencies = ["harness", "fuzzer"] [tasks.test_windows] script_runner = "@shell" -script=''' +script = ''' copy .\target\${PROFILE_DIR}\tinyinst_simple.exe . start "" "tinyinst_simple.exe" #ping is for timeout ping -n 10 127.0.0.1>NUL && taskkill /im tinyinst_simple.exe /F >nul 2>nul dir /a-d "corpus_discovered\*" && (echo Files exist) || (exit /b 1337) ''' -dependencies = ["harness", "fuzzer"] \ No newline at end of file +dependencies = ["harness", "fuzzer"] diff --git a/fuzzers/others/tutorial/Cargo.toml b/fuzzers/others/tutorial/Cargo.toml index 6d818f6365..ca19a915a7 100644 --- a/fuzzers/others/tutorial/Cargo.toml +++ b/fuzzers/others/tutorial/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tutorial" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -21,9 +24,17 @@ which = "6.0" [dependencies] libafl = { path = "../../../libafl/", features = ["default", "rand_trait"] } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "libfuzzer", "sancov_cmplog"] } -serde = { version = "1.0", default-features = false, features = ["alloc"] } # serialization lib -lain = { version = "0.5", features = ["serde_support"], git = "https://github.com/AFLplusplus/lain.git", rev = "208e927bcf411f62f8a1f51ac2d9f9423a1ec5d3" } # We're using a lain fork compatible with libafl's rand version +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_hitcounts", + "libfuzzer", + "sancov_cmplog", +] } +serde = { version = "1.0", default-features = false, features = [ + "alloc", +] } # serialization lib +lain = { version = "0.5", features = [ + "serde_support", +], git = "https://github.com/AFLplusplus/lain.git", rev = "208e927bcf411f62f8a1f51ac2d9f9423a1ec5d3" } # We're using a lain fork compatible with libafl's rand version # TODO Include it only when building cc libafl_cc = { path = "../../../libafl_cc/" } diff --git a/fuzzers/qemu/qemu_cmin/Cargo.toml b/fuzzers/qemu/qemu_cmin/Cargo.toml index ce9792115d..ceec2a3dbc 100644 --- a/fuzzers/qemu/qemu_cmin/Cargo.toml +++ b/fuzzers/qemu/qemu_cmin/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "qemu_cmin" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier ", "WorksButNotTested"] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", + "WorksButNotTested", +] edition = "2021" [profile.release] @@ -22,12 +26,19 @@ mips = ["libafl_qemu/mips"] ppc = ["libafl_qemu/ppc", "be"] [build-dependencies] -vergen = { version = "8.2.1", features = ["build", "cargo", "git", "gitcl", "rustc", "si"] } +vergen = { version = "8.2.1", features = [ + "build", + "cargo", + "git", + "gitcl", + "rustc", + "si", +] } [dependencies] -clap = { version = "4.5", features = ["derive", "string"]} +clap = { version = "4.5", features = ["derive", "string"] } libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } libafl_qemu = { path = "../../../libafl_qemu/", features = ["usermode"] } -log = {version = "0.4.20" } +log = { version = "0.4.20" } rangemap = { version = "1.3" } diff --git a/fuzzers/qemu/qemu_cmin/Makefile.toml b/fuzzers/qemu/qemu_cmin/Makefile.toml index c43f51af6b..8fa6d1fa1a 100644 --- a/fuzzers/qemu/qemu_cmin/Makefile.toml +++ b/fuzzers/qemu/qemu_cmin/Makefile.toml @@ -1,6 +1,8 @@ [env] -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } CROSS_CC = "x86_64-linux-gnu-gcc" CROSS_CXX = "x86_64-linux-gnu-g++" CROSS_CFLAGS = "" @@ -73,32 +75,32 @@ FEATURE = "ppc" LIBAFL_QEMU_CLONE_DIR = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/qemu-libafl-bridge" [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Qemu fuzzer not supported on windows/mac" ''' [tasks.target_dir] -condition = { files_not_exist = [ "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["${CARGO_MAKE_CRATE_TARGET_DIRECTORY}"] } +script_runner = "@shell" +script = ''' mkdir ${CARGO_MAKE_CRATE_TARGET_DIRECTORY} ''' [tasks.deps_dir] dependencies = ["target_dir"] -condition = { files_not_exist = [ "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/"] } +script_runner = "@shell" +script = ''' mkdir ${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/ ''' [tasks.arch_target_dir] dependencies = ["target_dir"] -condition = { files_not_exist = [ "${TARGET_DIR}" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["${TARGET_DIR}"] } +script_runner = "@shell" +script = ''' mkdir ${TARGET_DIR} ''' @@ -109,11 +111,13 @@ windows_alias = "unsupported" [tasks.zlib_unix_wget] dependencies = ["deps_dir"] -condition = { files_not_exist = [ "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/zlib-1.2.13" ] } -script_runner="@shell" +condition = { files_not_exist = [ + "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/zlib-1.2.13", +] } +script_runner = "@shell" # NOTE: There's no specific reason we're using an old version of zlib, # but newer versions get moved to fossils/ after a while. -script=''' +script = ''' wget \ -O "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/zlib-1.2.13.tar.gz" \ https://zlib.net/fossils/zlib-1.2.13.tar.gz @@ -124,10 +128,10 @@ tar \ ''' [tasks.zlib_unix] -dependencies = ["arch_target_dir", "zlib_unix_wget" ] -condition = { files_not_exist = [ "${TARGET_DIR}/build-zlib/libz.a" ] } -script_runner="@shell" -script=''' +dependencies = ["arch_target_dir", "zlib_unix_wget"] +condition = { files_not_exist = ["${TARGET_DIR}/build-zlib/libz.a"] } +script_runner = "@shell" +script = ''' rm -rf ${TARGET_DIR}/build-zlib/ mkdir ${TARGET_DIR}/build-zlib/ @@ -148,9 +152,11 @@ windows_alias = "unsupported" [tasks.libpng_unix_wget] dependencies = ["deps_dir"] -condition = { files_not_exist = [ "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/libpng-1.6.37" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = [ + "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/libpng-1.6.37", +] } +script_runner = "@shell" +script = ''' wget \ -O "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/v1.6.37.tar.gz" \ https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz @@ -161,10 +167,10 @@ tar \ ''' [tasks.libpng_unix] -dependencies = [ "arch_target_dir", "zlib", "libpng_unix_wget" ] -condition = { files_not_exist = [ "${TARGET_DIR}/build-png/.libs/libpng16.a" ] } -script_runner="@shell" -script=''' +dependencies = ["arch_target_dir", "zlib", "libpng_unix_wget"] +condition = { files_not_exist = ["${TARGET_DIR}/build-png/.libs/libpng16.a"] } +script_runner = "@shell" +script = ''' rm -rf ${TARGET_DIR}/build-png/ mkdir ${TARGET_DIR}/build-png/ @@ -190,17 +196,19 @@ windows_alias = "unsupported" [tasks.build_unix] command = "cargo" args = [ - "build", - "--profile", - "${PROFILE}", - "--features", "${FEATURE}", - "--target-dir", "${TARGET_DIR}" + "build", + "--profile", + "${PROFILE}", + "--features", + "${FEATURE}", + "--target-dir", + "${TARGET_DIR}", ] [tasks.fuzzer] dependencies = ["build"] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ${TARGET_DIR}/${PROFILE_DIR}/qemu_cmin-${CARGO_MAKE_PROFILE} mv ${TARGET_DIR}/${PROFILE_DIR}/qemu_cmin ${TARGET_DIR}/${PROFILE_DIR}/qemu_cmin-${CARGO_MAKE_PROFILE} ''' @@ -211,8 +219,8 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.harness_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' ${CROSS_CXX} \ ./harness.cc \ $CROSS_CFLAGS \ @@ -225,7 +233,7 @@ ${CROSS_CXX} \ -lm \ -static ''' -dependencies = [ "libpng" ] +dependencies = ["libpng"] [tasks.run] linux_alias = "run_unix" @@ -235,13 +243,15 @@ windows_alias = "unsupported" [tasks.run_unix] command = "${TARGET_DIR}/${PROFILE_DIR}/qemu_cmin-${CARGO_MAKE_PROFILE}" args = [ - "--output", "./output", - "--input", "./corpus", - "--verbose", - "--", - "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", + "--output", + "./output", + "--input", + "./corpus", + "--verbose", + "--", + "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", ] -dependencies = [ "harness", "fuzzer" ] +dependencies = ["harness", "fuzzer"] [tasks.test] linux_alias = "test_unix" @@ -249,13 +259,10 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.test_unix] -dependencies = [ "lightweight" ] +dependencies = ["lightweight"] # Tidy up after we've run our tests so we don't hog all the disk space command = "cargo" -args = [ - "make", - "clean", -] +args = ["make", "clean"] [tasks.test_full] linux_alias = "test_unix_full" @@ -263,13 +270,10 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.test_unix_full] -dependencies = [ "all" ] +dependencies = ["all"] # Tidy up after we've run our tests so we don't hog all the disk space command = "cargo" -args = [ - "make", - "clean", -] +args = ["make", "clean"] [tasks.clean] linux_alias = "clean_unix" @@ -279,72 +283,38 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf ${CARGO_MAKE_CRATE_TARGET_DIRECTORY} cargo clean ''' [tasks.arm] command = "cargo" -args = [ - "make", - "-p", "arm", - "run", -] +args = ["make", "-p", "arm", "run"] [tasks.aarch64] command = "cargo" -args = [ - "make", - "-p", "aarch64", - "run", -] +args = ["make", "-p", "aarch64", "run"] [tasks.x86_64] command = "cargo" -args = [ - "make", - "-p", "x86_64", - "run", -] +args = ["make", "-p", "x86_64", "run"] [tasks.i386] command = "cargo" -args = [ - "make", - "-p", "i386", - "run", -] +args = ["make", "-p", "i386", "run"] [tasks.mips] command = "cargo" -args = [ - "make", - "-p", "mips", - "run", -] +args = ["make", "-p", "mips", "run"] [tasks.ppc] command = "cargo" -args = [ - "make", - "-p", "ppc", - "run", -] +args = ["make", "-p", "ppc", "run"] [tasks.all] -dependencies = [ - "arm", - "aarch64", - "x86_64", - "i386", - "mips", - "ppc" -] +dependencies = ["arm", "aarch64", "x86_64", "i386", "mips", "ppc"] [tasks.lightweight] -dependencies = [ - "arm", - "x86_64", -] +dependencies = ["arm", "x86_64"] diff --git a/fuzzers/qemu/qemu_coverage/Cargo.toml b/fuzzers/qemu/qemu_coverage/Cargo.toml index 347540eb60..a4a13a3f8a 100644 --- a/fuzzers/qemu/qemu_coverage/Cargo.toml +++ b/fuzzers/qemu/qemu_coverage/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "qemu_coverage" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier ", "WorksButNotTested"] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", + "WorksButNotTested", +] edition = "2021" [profile.release] @@ -22,12 +26,19 @@ mips = ["libafl_qemu/mips"] ppc = ["libafl_qemu/ppc", "be"] [build-dependencies] -vergen = { version = "8.2.1", features = ["build", "cargo", "git", "gitcl", "rustc", "si"] } +vergen = { version = "8.2.1", features = [ + "build", + "cargo", + "git", + "gitcl", + "rustc", + "si", +] } [dependencies] -clap = { version = "4.5", features = ["derive", "string"]} +clap = { version = "4.5", features = ["derive", "string"] } libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } libafl_qemu = { path = "../../../libafl_qemu/", features = ["usermode"] } -log = {version = "0.4.20" } +log = { version = "0.4.20" } rangemap = { version = "1.3" } diff --git a/fuzzers/qemu/qemu_coverage/Makefile.toml b/fuzzers/qemu/qemu_coverage/Makefile.toml index 6527cafc92..6a37aaa315 100644 --- a/fuzzers/qemu/qemu_coverage/Makefile.toml +++ b/fuzzers/qemu/qemu_coverage/Makefile.toml @@ -1,6 +1,8 @@ [env] -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } CROSS_CC = "x86_64-linux-gnu-gcc" CROSS_CXX = "x86_64-linux-gnu-g++" CROSS_CFLAGS = "" @@ -73,32 +75,32 @@ FEATURE = "ppc" LIBAFL_QEMU_CLONE_DIR = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/qemu-libafl-bridge" [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Qemu fuzzer not supported on windows/mac" ''' [tasks.target_dir] -condition = { files_not_exist = [ "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["${CARGO_MAKE_CRATE_TARGET_DIRECTORY}"] } +script_runner = "@shell" +script = ''' mkdir ${CARGO_MAKE_CRATE_TARGET_DIRECTORY} ''' [tasks.deps_dir] dependencies = ["target_dir"] -condition = { files_not_exist = [ "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/"] } +script_runner = "@shell" +script = ''' mkdir ${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/ ''' [tasks.arch_target_dir] dependencies = ["target_dir"] -condition = { files_not_exist = [ "${TARGET_DIR}" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["${TARGET_DIR}"] } +script_runner = "@shell" +script = ''' mkdir ${TARGET_DIR} ''' @@ -109,11 +111,13 @@ windows_alias = "unsupported" [tasks.zlib_unix_wget] dependencies = ["deps_dir"] -condition = { files_not_exist = [ "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/zlib-1.2.13" ] } -script_runner="@shell" +condition = { files_not_exist = [ + "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/zlib-1.2.13", +] } +script_runner = "@shell" # NOTE: There's no specific reason we're using an old version of zlib, # but newer versions get moved to fossils/ after a while. -script=''' +script = ''' wget \ -O "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/zlib-1.2.13.tar.gz" \ https://zlib.net/fossils/zlib-1.2.13.tar.gz @@ -124,10 +128,10 @@ tar \ ''' [tasks.zlib_unix] -dependencies = ["arch_target_dir", "zlib_unix_wget" ] -condition = { files_not_exist = [ "${TARGET_DIR}/build-zlib/libz.a" ] } -script_runner="@shell" -script=''' +dependencies = ["arch_target_dir", "zlib_unix_wget"] +condition = { files_not_exist = ["${TARGET_DIR}/build-zlib/libz.a"] } +script_runner = "@shell" +script = ''' rm -rf ${TARGET_DIR}/build-zlib/ mkdir ${TARGET_DIR}/build-zlib/ @@ -148,9 +152,11 @@ windows_alias = "unsupported" [tasks.libpng_unix_wget] dependencies = ["deps_dir"] -condition = { files_not_exist = [ "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/libpng-1.6.37" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = [ + "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/libpng-1.6.37", +] } +script_runner = "@shell" +script = ''' wget \ -O "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/v1.6.37.tar.gz" \ https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz @@ -161,10 +167,10 @@ tar \ ''' [tasks.libpng_unix] -dependencies = [ "arch_target_dir", "zlib", "libpng_unix_wget" ] -condition = { files_not_exist = [ "${TARGET_DIR}/build-png/.libs/libpng16.a" ] } -script_runner="@shell" -script=''' +dependencies = ["arch_target_dir", "zlib", "libpng_unix_wget"] +condition = { files_not_exist = ["${TARGET_DIR}/build-png/.libs/libpng16.a"] } +script_runner = "@shell" +script = ''' rm -rf ${TARGET_DIR}/build-png/ mkdir ${TARGET_DIR}/build-png/ @@ -190,17 +196,19 @@ windows_alias = "unsupported" [tasks.build_unix] command = "cargo" args = [ - "build", - "--profile", - "${PROFILE}", - "--features", "${FEATURE}", - "--target-dir", "${TARGET_DIR}" + "build", + "--profile", + "${PROFILE}", + "--features", + "${FEATURE}", + "--target-dir", + "${TARGET_DIR}", ] [tasks.fuzzer] dependencies = ["build"] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ${TARGET_DIR}/${PROFILE_DIR}/qemu_coverage-${CARGO_MAKE_PROFILE} mv ${TARGET_DIR}/${PROFILE_DIR}/qemu_coverage ${TARGET_DIR}/${PROFILE_DIR}/qemu_coverage-${CARGO_MAKE_PROFILE} ''' @@ -211,8 +219,8 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.harness_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' ${CROSS_CXX} \ ./harness.cc \ $CROSS_CFLAGS \ @@ -225,7 +233,7 @@ ${CROSS_CXX} \ -lm \ -static ''' -dependencies = [ "libpng" ] +dependencies = ["libpng"] [tasks.run] linux_alias = "run_unix" @@ -235,12 +243,14 @@ windows_alias = "unsupported" [tasks.run_unix] command = "${TARGET_DIR}/${PROFILE_DIR}/qemu_coverage-${CARGO_MAKE_PROFILE}" args = [ - "--coverage-path", "${TARGET_DIR}/drcov.log", - "--input-dir", "./corpus", - "--", - "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", + "--coverage-path", + "${TARGET_DIR}/drcov.log", + "--input-dir", + "./corpus", + "--", + "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", ] -dependencies = [ "harness", "fuzzer" ] +dependencies = ["harness", "fuzzer"] [tasks.test] linux_alias = "test_unix" @@ -248,13 +258,10 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.test_unix] -dependencies = [ "lightweight" ] +dependencies = ["lightweight"] # Tidy up after we've run our tests so we don't hog all the disk space command = "cargo" -args = [ - "make", - "clean", -] +args = ["make", "clean"] [tasks.test_full] linux_alias = "test_unix_full" @@ -262,13 +269,10 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.test_unix_full] -dependencies = [ "all" ] +dependencies = ["all"] # Tidy up after we've run our tests so we don't hog all the disk space command = "cargo" -args = [ - "make", - "clean", -] +args = ["make", "clean"] [tasks.clean] linux_alias = "clean_unix" @@ -278,72 +282,38 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf ${CARGO_MAKE_CRATE_TARGET_DIRECTORY} cargo clean ''' [tasks.arm] command = "cargo" -args = [ - "make", - "-p", "arm", - "run", -] +args = ["make", "-p", "arm", "run"] [tasks.aarch64] command = "cargo" -args = [ - "make", - "-p", "aarch64", - "run", -] +args = ["make", "-p", "aarch64", "run"] [tasks.x86_64] command = "cargo" -args = [ - "make", - "-p", "x86_64", - "run", -] +args = ["make", "-p", "x86_64", "run"] [tasks.i386] command = "cargo" -args = [ - "make", - "-p", "i386", - "run", -] +args = ["make", "-p", "i386", "run"] [tasks.mips] command = "cargo" -args = [ - "make", - "-p", "mips", - "run", -] +args = ["make", "-p", "mips", "run"] [tasks.ppc] command = "cargo" -args = [ - "make", - "-p", "ppc", - "run", -] +args = ["make", "-p", "ppc", "run"] [tasks.all] -dependencies = [ - "arm", - "aarch64", - "x86_64", - "i386", - "mips", - "ppc" -] +dependencies = ["arm", "aarch64", "x86_64", "i386", "mips", "ppc"] [tasks.lightweight] -dependencies = [ - "arm", - "x86_64", -] +dependencies = ["arm", "x86_64"] diff --git a/fuzzers/qemu/qemu_launcher/Cargo.toml b/fuzzers/qemu/qemu_launcher/Cargo.toml index 42c4592f16..983a03129d 100644 --- a/fuzzers/qemu/qemu_launcher/Cargo.toml +++ b/fuzzers/qemu/qemu_launcher/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "qemu_launcher" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] @@ -33,14 +36,23 @@ opt-level = 3 debug = true [build-dependencies] -vergen = { version = "8.2", features = ["build", "cargo", "git", "gitcl", "rustc", "si"] } +vergen = { version = "8.2", features = [ + "build", + "cargo", + "git", + "gitcl", + "rustc", + "si", +] } [dependencies] -clap = { version = "4.3", features = ["derive", "string"]} +clap = { version = "4.3", features = ["derive", "string"] } libafl = { path = "../../../libafl/" } -libafl_bolts = { path = "../../../libafl_bolts/", features = ["errors_backtrace"] } +libafl_bolts = { path = "../../../libafl_bolts/", features = [ + "errors_backtrace", +] } libafl_qemu = { path = "../../../libafl_qemu/", features = ["usermode"] } -log = {version = "0.4.20" } +log = { version = "0.4.20" } nix = { version = "0.29", features = ["fs"] } rangemap = { version = "1.3" } readonly = { version = "0.2.10" } diff --git a/fuzzers/qemu/qemu_launcher/Makefile.toml b/fuzzers/qemu/qemu_launcher/Makefile.toml index 6f508eaf03..7d795cf51b 100644 --- a/fuzzers/qemu/qemu_launcher/Makefile.toml +++ b/fuzzers/qemu/qemu_launcher/Makefile.toml @@ -1,6 +1,8 @@ [env] -PROFILE = { value = "release", condition = {env_not_set = ["PROFILE"]} } -PROFILE_DIR = {value = "release", condition = {env_not_set = ["PROFILE_DIR"] }} +PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } +PROFILE_DIR = { value = "release", condition = { env_not_set = [ + "PROFILE_DIR", +] } } CROSS_CC = "x86_64-linux-gnu-gcc" CROSS_CXX = "x86_64-linux-gnu-g++" CROSS_CFLAGS = "" @@ -66,31 +68,31 @@ LIBPNG_OPTIMIZATIONS = "no" FEATURE = "ppc" [tasks.unsupported] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Qemu fuzzer not supported on windows/mac" ''' [tasks.target_dir] -condition = { files_not_exist = [ "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["${CARGO_MAKE_CRATE_TARGET_DIRECTORY}"] } +script_runner = "@shell" +script = ''' mkdir ${CARGO_MAKE_CRATE_TARGET_DIRECTORY} ''' [tasks.deps_dir] dependencies = ["target_dir"] -condition = { files_not_exist = [ "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/"] } +script_runner = "@shell" +script = ''' mkdir ${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/ ''' [tasks.arch_target_dir] dependencies = ["target_dir"] -condition = { files_not_exist = [ "${TARGET_DIR}" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["${TARGET_DIR}"] } +script_runner = "@shell" +script = ''' mkdir ${TARGET_DIR} ''' @@ -101,11 +103,13 @@ windows_alias = "unsupported" [tasks.zlib_unix_wget] dependencies = ["deps_dir"] -condition = { files_not_exist = [ "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/zlib-1.2.13" ] } -script_runner="@shell" +condition = { files_not_exist = [ + "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/zlib-1.2.13", +] } +script_runner = "@shell" # NOTE: There's no specific reason we're using an old version of zlib, # but newer versions get moved to fossils/ after a while. -script=''' +script = ''' wget \ -O "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/zlib-1.2.13.tar.gz" \ https://zlib.net/fossils/zlib-1.2.13.tar.gz @@ -116,10 +120,10 @@ tar \ ''' [tasks.zlib_unix] -dependencies = ["arch_target_dir", "zlib_unix_wget" ] -condition = { files_not_exist = [ "${TARGET_DIR}/build-zlib/libz.a" ] } -script_runner="@shell" -script=''' +dependencies = ["arch_target_dir", "zlib_unix_wget"] +condition = { files_not_exist = ["${TARGET_DIR}/build-zlib/libz.a"] } +script_runner = "@shell" +script = ''' rm -rf ${TARGET_DIR}/build-zlib/ mkdir ${TARGET_DIR}/build-zlib/ @@ -140,9 +144,11 @@ windows_alias = "unsupported" [tasks.libpng_unix_wget] dependencies = ["deps_dir"] -condition = { files_not_exist = [ "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/libpng-1.6.37" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = [ + "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/libpng-1.6.37", +] } +script_runner = "@shell" +script = ''' wget \ -O "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/deps/v1.6.37.tar.gz" \ https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz @@ -153,10 +159,10 @@ tar \ ''' [tasks.libpng_unix] -dependencies = [ "arch_target_dir", "zlib", "libpng_unix_wget" ] -condition = { files_not_exist = [ "${TARGET_DIR}/build-png/.libs/libpng16.a" ] } -script_runner="@shell" -script=''' +dependencies = ["arch_target_dir", "zlib", "libpng_unix_wget"] +condition = { files_not_exist = ["${TARGET_DIR}/build-png/.libs/libpng16.a"] } +script_runner = "@shell" +script = ''' rm -rf ${TARGET_DIR}/build-png/ mkdir ${TARGET_DIR}/build-png/ @@ -183,17 +189,19 @@ windows_alias = "unsupported" [tasks.build_unix] command = "cargo" args = [ - "build", - "--profile", - "${PROFILE}", - "--features", "${FEATURE}", - "--target-dir", "${TARGET_DIR}" + "build", + "--profile", + "${PROFILE}", + "--features", + "${FEATURE}", + "--target-dir", + "${TARGET_DIR}", ] [tasks.fuzzer] dependencies = ["build"] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ${TARGET_DIR}/${PROFILE_DIR}/qemu_launcher-${CARGO_MAKE_PROFILE} mv ${TARGET_DIR}/${PROFILE_DIR}/qemu_launcher ${TARGET_DIR}/${PROFILE_DIR}/qemu_launcher-${CARGO_MAKE_PROFILE} ''' @@ -204,8 +212,8 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.harness_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' ${CROSS_CXX} \ ./harness.cc \ $CROSS_CFLAGS \ @@ -218,7 +226,7 @@ ${CROSS_CXX} \ -o"${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}" \ -lm ''' -dependencies = [ "libpng" ] +dependencies = ["libpng"] [tasks.debug] linux_alias = "debug_unix" @@ -228,18 +236,25 @@ windows_alias = "unsupported" [tasks.debug_unix] command = "${TARGET_DIR}/${PROFILE_DIR}/qemu_launcher-${CARGO_MAKE_PROFILE}" args = [ - "--input", "./corpus", - "--output", "${TARGET_DIR}/output/", - "--log", "${TARGET_DIR}/output/log.txt", - "--cores", "0-7", - "--asan-cores", "0-3", - "--cmplog-cores", "2-5", - "--iterations", "100000", - "--verbose", - "--", - "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", + "--input", + "./corpus", + "--output", + "${TARGET_DIR}/output/", + "--log", + "${TARGET_DIR}/output/log.txt", + "--cores", + "0-7", + "--asan-cores", + "0-3", + "--cmplog-cores", + "2-5", + "--iterations", + "100000", + "--verbose", + "--", + "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", ] -dependencies = [ "harness", "fuzzer" ] +dependencies = ["harness", "fuzzer"] [tasks.run] linux_alias = "run_unix" @@ -249,18 +264,25 @@ windows_alias = "unsupported" [tasks.run_unix] command = "${TARGET_DIR}/${PROFILE_DIR}/qemu_launcher-${CARGO_MAKE_PROFILE}" args = [ - "--input", "./corpus", - "--output", "${TARGET_DIR}/output/", - "--log", "${TARGET_DIR}/output/log.txt", - "--cores", "0-7", - "--asan-cores", "0-3", - "--cmplog-cores", "2-5", - "--iterations", "1000000", - "--tui", - "--", - "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", + "--input", + "./corpus", + "--output", + "${TARGET_DIR}/output/", + "--log", + "${TARGET_DIR}/output/log.txt", + "--cores", + "0-7", + "--asan-cores", + "0-3", + "--cmplog-cores", + "2-5", + "--iterations", + "1000000", + "--tui", + "--", + "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", ] -dependencies = [ "harness", "fuzzer" ] +dependencies = ["harness", "fuzzer"] [tasks.single] linux_alias = "single_unix" @@ -270,14 +292,18 @@ windows_alias = "unsupported" [tasks.single_unix] command = "${TARGET_DIR}/${PROFILE_DIR}/qemu_launcher-${CARGO_MAKE_PROFILE}" args = [ - "--input", "./corpus", - "--output", "${TARGET_DIR}/output/", - "--log", "${TARGET_DIR}/output/log.txt", - "--cores", "0", - "--", - "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", + "--input", + "./corpus", + "--output", + "${TARGET_DIR}/output/", + "--log", + "${TARGET_DIR}/output/log.txt", + "--cores", + "0", + "--", + "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", ] -dependencies = [ "harness", "fuzzer" ] +dependencies = ["harness", "fuzzer"] [tasks.asan] linux_alias = "asan_unix" @@ -287,15 +313,20 @@ windows_alias = "unsupported" [tasks.asan_unix] command = "${TARGET_DIR}/${PROFILE_DIR}/qemu_launcher-${CARGO_MAKE_PROFILE}" args = [ - "--input", "./corpus", - "--output", "${TARGET_DIR}/output/", - "--log", "${TARGET_DIR}/output/log.txt", - "--cores", "0", - "--asan-cores", "0", - "--", - "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", + "--input", + "./corpus", + "--output", + "${TARGET_DIR}/output/", + "--log", + "${TARGET_DIR}/output/log.txt", + "--cores", + "0", + "--asan-cores", + "0", + "--", + "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", ] -dependencies = [ "harness", "fuzzer" ] +dependencies = ["harness", "fuzzer"] [tasks.asan_guest] linux_alias = "asan_guest_unix" @@ -305,15 +336,20 @@ windows_alias = "unsupported" [tasks.asan_guest_unix] command = "${TARGET_DIR}/${PROFILE_DIR}/qemu_launcher-${CARGO_MAKE_PROFILE}" args = [ - "--input", "./corpus", - "--output", "${TARGET_DIR}/output/", - "--log", "${TARGET_DIR}/output/log.txt", - "--cores", "0", - "--asan-guest-cores", "0", - "--", - "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", + "--input", + "./corpus", + "--output", + "${TARGET_DIR}/output/", + "--log", + "${TARGET_DIR}/output/log.txt", + "--cores", + "0", + "--asan-guest-cores", + "0", + "--", + "${TARGET_DIR}/libpng-harness-${CARGO_MAKE_PROFILE}", ] -dependencies = [ "harness", "fuzzer" ] +dependencies = ["harness", "fuzzer"] [tasks.test] linux_alias = "test_unix" @@ -321,8 +357,8 @@ mac_alias = "unsupported" windows_alias = "unsupported" [tasks.test_unix] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' echo "Profile: ${PROFILE}" cd injection_test || exit 1 make @@ -350,66 +386,35 @@ windows_alias = "unsupported" [tasks.clean_unix] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf ${CARGO_MAKE_CRATE_TARGET_DIRECTORY} cargo clean ''' [tasks.arm] command = "cargo" -args = [ - "make", - "-p", "arm", - "run", -] +args = ["make", "-p", "arm", "run"] [tasks.aarch64] command = "cargo" -args = [ - "make", - "-p", "aarch64", - "run", -] +args = ["make", "-p", "aarch64", "run"] [tasks.x86_64] command = "cargo" -args = [ - "make", - "-p", "x86_64", - "run", -] +args = ["make", "-p", "x86_64", "run"] [tasks.i386] command = "cargo" -args = [ - "make", - "-p", "i386", - "run", -] +args = ["make", "-p", "i386", "run"] [tasks.mips] command = "cargo" -args = [ - "make", - "-p", "mips", - "run", -] +args = ["make", "-p", "mips", "run"] [tasks.ppc] command = "cargo" -args = [ - "make", - "-p", "ppc", - "run", -] +args = ["make", "-p", "ppc", "run"] [tasks.all] -dependencies = [ - "arm", - "aarch64", - "x86_64", - "i386", - "mips", - "ppc" -] +dependencies = ["arm", "aarch64", "x86_64", "i386", "mips", "ppc"] diff --git a/fuzzers/qemu/qemu_launcher/injections.toml b/fuzzers/qemu/qemu_launcher/injections.toml index 69789e17ae..6c0fdf3ad4 100644 --- a/fuzzers/qemu/qemu_launcher/injections.toml +++ b/fuzzers/qemu/qemu_launcher/injections.toml @@ -18,32 +18,27 @@ # # 0 = first, 1 = second, ... 0-5 are supported (depending on architecture) [sql] -tokens = [ "'\"\"'\"\n", "\"1\" OR '1'=\"1\"" ] -matches = [ "'\"\"'\"", "1\" OR '1'=\"1" ] +tokens = ["'\"\"'\"\n", "\"1\" OR '1'=\"1\""] +matches = ["'\"\"'\"", "1\" OR '1'=\"1"] [sql.functions] -sqlite3_exec = {param = 1} -PQexec = {param = 1} -PQexecParams = {param = 1} -mysql_query = {param = 1} -mysql_send_query = {param = 1} +sqlite3_exec = { param = 1 } +PQexec = { param = 1 } +PQexecParams = { param = 1 } +mysql_query = { param = 1 } +mysql_send_query = { param = 1 } # Command injection. Note that for most you will need a libc with debug symbols # We do not need this as we watch the SYS_execve syscall, this is just an # example. [cmd] -tokens = [ - "'\"FUZZ\"'", - "\";FUZZ;\"", - "';FUZZ;'", - "$(FUZZ)", -] +tokens = ["'\"FUZZ\"'", "\";FUZZ;\"", "';FUZZ;'", "$(FUZZ)"] matches = ["'\"FUZZ\"'"] [cmd.functions] -popen = {param = 0} -system = {param = 0} +popen = { param = 0 } +system = { param = 0 } # LDAP injection tests [ldap] @@ -51,8 +46,8 @@ tokens = ["*)(FUZZ=*))(|"] matches = ["*)(FUZZ=*))(|"] [ldap.functions] -ldap_search_ext = {param = 3} -ldap_search_ext_s = {param = 3} +ldap_search_ext = { param = 3 } +ldap_search_ext_s = { param = 3 } # XSS injection tests # This is a minimal example that only checks for libxml2 @@ -60,4 +55,4 @@ ldap_search_ext_s = {param = 3} tokens = ["'\">", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" [features] default = ["std", "classic"] std = [] -classic = [] # The classic way to interact with LibAFL QEMU, with direct calls to QEMU's functions +classic = [ +] # The classic way to interact with LibAFL QEMU, with direct calls to QEMU's functions breakpoint = [] # Uses the command system, with breakpoints sync_exit = [] # Uses the command system, with sync exit. @@ -23,8 +27,14 @@ codegen-units = 1 [dependencies] libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_qemu = { path = "../../../libafl_qemu/", features = ["arm", "systemmode"] } -libafl_qemu_sys = { path = "../../../libafl_qemu/libafl_qemu_sys", features = ["arm", "systemmode"] } +libafl_qemu = { path = "../../../libafl_qemu/", features = [ + "arm", + "systemmode", +] } +libafl_qemu_sys = { path = "../../../libafl_qemu/libafl_qemu_sys", features = [ + "arm", + "systemmode", +] } env_logger = "*" [build-dependencies] diff --git a/fuzzers/qemu/qemu_systemmode/Makefile.toml b/fuzzers/qemu/qemu_systemmode/Makefile.toml index 2afe843b23..f7543cb358 100644 --- a/fuzzers/qemu/qemu_systemmode/Makefile.toml +++ b/fuzzers/qemu/qemu_systemmode/Makefile.toml @@ -1,5 +1,4 @@ -env_scripts = [ -''' +env_scripts = [''' #!@duckscript profile = get_env PROFILE @@ -8,8 +7,7 @@ if eq ${profile} "dev" else set_env PROFILE_DIR ${profile} end -''', -''' +''', ''' #!@duckscript runs_on_ci = get_env RUN_ON_CI @@ -18,8 +16,7 @@ if ${runs_on_ci} set_env TARGET_DIR ${cargo_target_dir} set_env KERNEL ${cargo_target_dir}/example.elf end -''' -] +'''] [env] PROFILE = { value = "release", condition = { env_not_set = ["PROFILE"] } } @@ -28,70 +25,82 @@ LIBAFL_QEMU_CLONE_DIR = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/qemu-libafl-bridge KERNEL = "${TARGET_DIR}/example.elf" [tasks.target_dir] -condition = { files_not_exist = [ "${TARGET_DIR}" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["${TARGET_DIR}"] } +script_runner = "@shell" +script = ''' mkdir -p ${TARGET_DIR} ''' [tasks.image] dependencies = ["target_dir"] -condition = { files_not_exist = [ "${TARGET_DIR}/dummy.qcow2" ] } -script_runner="@shell" -script=''' +condition = { files_not_exist = ["${TARGET_DIR}/dummy.qcow2"] } +script_runner = "@shell" +script = ''' qemu-img create -f qcow2 ${TARGET_DIR}/dummy.qcow2 32M ''' [tasks.target] dependencies = ["target_dir"] -condition = { env_set = [ "TARGET_DEFINE" ] } +condition = { env_set = ["TARGET_DEFINE"] } command = "arm-none-eabi-gcc" args = [ - "-ggdb", - "-ffreestanding", - "-nostartfiles", - "-lgcc", - "-T", "${CARGO_MAKE_WORKING_DIRECTORY}/example/mps2_m3.ld", - "-mcpu=cortex-m3", - "${CARGO_MAKE_WORKING_DIRECTORY}/example/main.c", - "${CARGO_MAKE_WORKING_DIRECTORY}/example/startup.c", - "-D", "${TARGET_DEFINE}", - "-I", "${TARGET_DIR}/${PROFILE_DIR}/include", - "-o", "${TARGET_DIR}/example.elf", + "-ggdb", + "-ffreestanding", + "-nostartfiles", + "-lgcc", + "-T", + "${CARGO_MAKE_WORKING_DIRECTORY}/example/mps2_m3.ld", + "-mcpu=cortex-m3", + "${CARGO_MAKE_WORKING_DIRECTORY}/example/main.c", + "${CARGO_MAKE_WORKING_DIRECTORY}/example/startup.c", + "-D", + "${TARGET_DEFINE}", + "-I", + "${TARGET_DIR}/${PROFILE_DIR}/include", + "-o", + "${TARGET_DIR}/example.elf", ] [tasks.build_fuzzer] -condition = { env_set = [ "FEATURE" ] } +condition = { env_set = ["FEATURE"] } command = "cargo" args = [ - "build", - "--profile", - "${PROFILE}", - "--no-default-features", - "--features", "std,${FEATURE}", - "--target-dir", "${TARGET_DIR}", + "build", + "--profile", + "${PROFILE}", + "--no-default-features", + "--features", + "std,${FEATURE}", + "--target-dir", + "${TARGET_DIR}", ] dependencies = ["image"] [tasks.run_fuzzer] command = "${TARGET_DIR}/${PROFILE_DIR}/qemu_systemmode" args = [ - "-icount", "shift=auto,align=off,sleep=off", - "-machine", "mps2-an385", - "-monitor", "null", - "-kernel", "${TARGET_DIR}/example.elf", - "-serial", "null", - "-nographic", - "-snapshot", - "-drive", "if=none,format=qcow2,file=${TARGET_DIR}/dummy.qcow2", - "-S", + "-icount", + "shift=auto,align=off,sleep=off", + "-machine", + "mps2-an385", + "-monitor", + "null", + "-kernel", + "${TARGET_DIR}/example.elf", + "-serial", + "null", + "-nographic", + "-snapshot", + "-drive", + "if=none,format=qcow2,file=${TARGET_DIR}/dummy.qcow2", + "-S", ] dependencies = ["target"] [tasks.test_fuzzer] -condition = { env_set = [ "FEATURE" ] } -script_runner="@shell" -script=''' +condition = { env_set = ["FEATURE"] } +script_runner = "@shell" +script = ''' TMP_DIR=$(mktemp -d) cargo make build_$FEATURE @@ -108,79 +117,79 @@ fi [tasks.build_classic] command = "cargo" args = [ - "make", - "-e", "FEATURE=classic", - "-e", "TARGET_DEFINE=TARGET_CLASSIC", - "build_fuzzer", + "make", + "-e", + "FEATURE=classic", + "-e", + "TARGET_DEFINE=TARGET_CLASSIC", + "build_fuzzer", ] [tasks.test_classic] command = "cargo" -args = [ - "make", - "-e", "FEATURE=classic", - "test_fuzzer", -] +args = ["make", "-e", "FEATURE=classic", "test_fuzzer"] [tasks.build_breakpoint] command = "cargo" args = [ - "make", - "-e", "FEATURE=breakpoint", - "-e", "TARGET_DEFINE=TARGET_BREAKPOINT", - "build_fuzzer", + "make", + "-e", + "FEATURE=breakpoint", + "-e", + "TARGET_DEFINE=TARGET_BREAKPOINT", + "build_fuzzer", ] [tasks.test_breakpoint] command = "cargo" -args = [ - "make", - "-e", "FEATURE=breakpoint", - "test_fuzzer", -] +args = ["make", "-e", "FEATURE=breakpoint", "test_fuzzer"] [tasks.build_sync_exit] command = "cargo" args = [ - "make", - "-e", "FEATURE=sync_exit", - "-e", "TARGET_DEFINE=TARGET_SYNC_EXIT", - "build_fuzzer", + "make", + "-e", + "FEATURE=sync_exit", + "-e", + "TARGET_DEFINE=TARGET_SYNC_EXIT", + "build_fuzzer", ] [tasks.test_sync_exit] command = "cargo" -args = [ - "make", - "-e", "FEATURE=sync_exit", - "test_fuzzer", -] +args = ["make", "-e", "FEATURE=sync_exit", "test_fuzzer"] [tasks.classic] command = "cargo" args = [ - "make", - "-e", "FEATURE=classic", - "-e", "TARGET_DEFINE=TARGET_CLASSIC", - "run_fuzzer", + "make", + "-e", + "FEATURE=classic", + "-e", + "TARGET_DEFINE=TARGET_CLASSIC", + "run_fuzzer", ] [tasks.breakpoint] command = "cargo" args = [ - "make", - "-e", "FEATURE=breakpoint", - "-e", "TARGET_DEFINE=TARGET_BREAKPOINT", - "run_fuzzer", + "make", + "-e", + "FEATURE=breakpoint", + "-e", + "TARGET_DEFINE=TARGET_BREAKPOINT", + "run_fuzzer", ] [tasks.sync_exit] command = "cargo" args = [ - "make", - "-e", "FEATURE=sync_exit", - "-e", "TARGET_DEFINE=TARGET_SYNC_EXIT", - "run_fuzzer", + "make", + "-e", + "FEATURE=sync_exit", + "-e", + "TARGET_DEFINE=TARGET_SYNC_EXIT", + "run_fuzzer", ] [tasks.test] @@ -192,12 +201,12 @@ clear = true run_task = { name = ["build_classic", "build_breakpoint", "build_sync_exit"] } [tasks.run] -alias="classic" +alias = "classic" [tasks.clean] clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -rf ${CARGO_MAKE_CRATE_TARGET_DIRECTORY} cargo clean ''' diff --git a/fuzzers/stb/libfuzzer_stb_image/Cargo.toml b/fuzzers/stb/libfuzzer_stb_image/Cargo.toml index 10e318c003..367d882332 100644 --- a/fuzzers/stb/libfuzzer_stb_image/Cargo.toml +++ b/fuzzers/stb/libfuzzer_stb_image/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "libfuzzer_stb_image" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" build = "build.rs" @@ -18,8 +21,13 @@ debug = true [dependencies] libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_edges", "sancov_cmplog", "libfuzzer", "libfuzzer_no_link_main"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_edges", + "sancov_cmplog", + "libfuzzer", + "libfuzzer_no_link_main", +] } mimalloc = { version = "*", default-features = false } [build-dependencies] -cc = { version = "1.0", features = ["parallel"] } \ No newline at end of file +cc = { version = "1.0", features = ["parallel"] } diff --git a/fuzzers/stb/libfuzzer_stb_image/Makefile.toml b/fuzzers/stb/libfuzzer_stb_image/Makefile.toml index 9c17671641..39a7908a60 100644 --- a/fuzzers/stb/libfuzzer_stb_image/Makefile.toml +++ b/fuzzers/stb/libfuzzer_stb_image/Makefile.toml @@ -1,30 +1,32 @@ # Variables [env] -FUZZER_NAME='libfuzzer_stb_image' +FUZZER_NAME = 'libfuzzer_stb_image' PROJECT_DIR = { script = ["pwd"] } -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } PROFILE = { value = "release" } -PROFILE_DIR = {value = "release" } -LIBAFL_CC = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc', mapping = {"windows" = '.\\target\\${PROFILE_DIR}\\libafl_cc.exe'} } -LIBAFL_CXX = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx', mapping = {"windows" = '.\\target\\${PROFILE_DIR}\\libafl_cxx.exe'} } -FUZZER = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libfuzzer_stb_image', mapping = {"windows" = '.\\target\\${PROFILE_DIR}\\libfuzzer_stb_image.exe'} } +PROFILE_DIR = { value = "release" } +LIBAFL_CC = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc', mapping = { "windows" = '.\\target\\${PROFILE_DIR}\\libafl_cc.exe' } } +LIBAFL_CXX = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx', mapping = { "windows" = '.\\target\\${PROFILE_DIR}\\libafl_cxx.exe' } } +FUZZER = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = '${CARGO_TARGET_DIR}/${PROFILE_DIR}/libfuzzer_stb_image', mapping = { "windows" = '.\\target\\${PROFILE_DIR}\\libfuzzer_stb_image.exe' } } # Compilers [tasks.cxx] condition = { files_not_exist = ["${LIBAFL_CXX}"] } command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] condition = { files_not_exist = ["${LIBAFL_CC}"] } command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] # Build the fuzzer [tasks.fuzzer] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cargo build --profile ${PROFILE} cp ${FUZZER} . ''' @@ -37,20 +39,20 @@ windows_alias = "run_windows" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} & sleep 0.2 ./${FUZZER_NAME} ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.run_windows] # Do nothing script_runner = "@shell" -script=''' +script = ''' echo "Not integrated into cargo-make yet." ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.test] @@ -60,7 +62,7 @@ windows_alias = "test_windows" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) & sleep 0.2 @@ -72,33 +74,33 @@ else exit 1 fi ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.test_mac] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true (timeout 31s ./${FUZZER_NAME} | tee fuzz_stdout.log 2>/dev/null || true) & sleep 0.2 timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true ''' -dependencies = [ "fuzzer"] +dependencies = ["fuzzer"] [tasks.test_windows] # Do nothing script_runner = "@shell" -script=''' +script = ''' echo "Not integrated into cargo-make yet." ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} cargo clean ''' diff --git a/fuzzers/stb/libfuzzer_stb_image_concolic/Makefile.toml b/fuzzers/stb/libfuzzer_stb_image_concolic/Makefile.toml index 64218aeb10..b9ea9e9d06 100644 --- a/fuzzers/stb/libfuzzer_stb_image_concolic/Makefile.toml +++ b/fuzzers/stb/libfuzzer_stb_image_concolic/Makefile.toml @@ -1,10 +1,12 @@ # Variables [env] PROJECT_DIR = { script = ["pwd"] } -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } PROFILE = { value = "release" } -PROFILE_DIR = {value = "release" } -FUZZER_NAME='libfuzzer_stb_image_concolic' +PROFILE_DIR = { value = "release" } +FUZZER_NAME = 'libfuzzer_stb_image_concolic' # Compilers [tasks.runtime] @@ -40,7 +42,7 @@ alias = "fuzzer" [tasks.unsupported] # Do nothing script_runner = "@shell" -script=''' +script = ''' echo "Not supported on this platform." ''' @@ -48,7 +50,7 @@ echo "Not supported on this platform." [tasks.clean] # Disable default `clean` definition clear = true -script=''' +script = ''' cd fuzzer cargo clean cd .. diff --git a/fuzzers/stb/libfuzzer_stb_image_concolic/fuzzer/Cargo.toml b/fuzzers/stb/libfuzzer_stb_image_concolic/fuzzer/Cargo.toml index 0633734e71..53d57b6e0f 100644 --- a/fuzzers/stb/libfuzzer_stb_image_concolic/fuzzer/Cargo.toml +++ b/fuzzers/stb/libfuzzer_stb_image_concolic/fuzzer/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "libfuzzer_stb_image_concolic" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier ", "Julius Hohnerlein"] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", + "Julius Hohnerlein", +] edition = "2021" build = "build.rs" @@ -18,12 +22,16 @@ debug = true [dependencies] libafl = { path = "../../../../libafl/", features = ["concolic_mutation"] } libafl_bolts = { path = "../../../../libafl_bolts/" } -libafl_targets = { path = "../../../../libafl_targets/", features = ["sancov_pcguard_edges", "sancov_cmplog", "libfuzzer"] } -clap = { version = "4.0", features = ["derive"]} +libafl_targets = { path = "../../../../libafl_targets/", features = [ + "sancov_pcguard_edges", + "sancov_cmplog", + "libfuzzer", +] } +clap = { version = "4.0", features = ["derive"] } mimalloc = { version = "*", default-features = false } [build-dependencies] cc = { version = "1.0", features = ["parallel"] } cmake = "0.1" which = "4.4" -symcc_libafl = {path = "../../../../libafl_concolic/symcc_libafl"} +symcc_libafl = { path = "../../../../libafl_concolic/symcc_libafl" } diff --git a/fuzzers/stb/libfuzzer_stb_image_concolic/runtime/Cargo.toml b/fuzzers/stb/libfuzzer_stb_image_concolic/runtime/Cargo.toml index 7865c69bb0..27b52b5e3f 100644 --- a/fuzzers/stb/libfuzzer_stb_image_concolic/runtime/Cargo.toml +++ b/fuzzers/stb/libfuzzer_stb_image_concolic/runtime/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Julius Hohnerlein "] [lib] # the runtime needs to be a shared object -> cdylib -crate-type = ["cdylib"] +crate-type = ["cdylib"] # this is necessary for SymCC to find the runtime. name = "SymRuntime" diff --git a/fuzzers/stb/libfuzzer_stb_image_sugar/Cargo.toml b/fuzzers/stb/libfuzzer_stb_image_sugar/Cargo.toml index 1550a6121c..e7a08ee222 100644 --- a/fuzzers/stb/libfuzzer_stb_image_sugar/Cargo.toml +++ b/fuzzers/stb/libfuzzer_stb_image_sugar/Cargo.toml @@ -1,10 +1,19 @@ [package] name = "libfuzzer_stb_image_sugar" version = "0.13.0" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] edition = "2021" build = "build.rs" -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] [features] default = ["std"] @@ -19,7 +28,11 @@ debug = true [dependencies] libafl = { path = "../../../libafl/" } libafl_bolts = { path = "../../../libafl_bolts/" } -libafl_targets = { path = "../../../libafl_targets/", features = ["sancov_pcguard_edges", "sancov_cmplog", "libfuzzer"] } +libafl_targets = { path = "../../../libafl_targets/", features = [ + "sancov_pcguard_edges", + "sancov_cmplog", + "libfuzzer", +] } libafl_sugar = { path = "../../../libafl_sugar/" } mimalloc = { version = "*", default-features = false } diff --git a/fuzzers/stb/libfuzzer_stb_image_sugar/Makefile.toml b/fuzzers/stb/libfuzzer_stb_image_sugar/Makefile.toml index 357a3865be..8c5e953e59 100644 --- a/fuzzers/stb/libfuzzer_stb_image_sugar/Makefile.toml +++ b/fuzzers/stb/libfuzzer_stb_image_sugar/Makefile.toml @@ -1,30 +1,32 @@ # Variables [env] -FUZZER_NAME='libfuzzer_stb_image_sugar' +FUZZER_NAME = 'libfuzzer_stb_image_sugar' PROJECT_DIR = { script = ["pwd"] } -CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = ["CARGO_TARGET_DIR"] } } +CARGO_TARGET_DIR = { value = "${PROJECT_DIR}/target", condition = { env_not_set = [ + "CARGO_TARGET_DIR", +] } } PROFILE = { value = "release" } -PROFILE_DIR = {value = "release" } -LIBAFL_CC = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc", mapping = {"windows" = '.\\target\\${PROFILE_DIR}\\libafl_cc.exe'} } -LIBAFL_CXX = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx", mapping = {"windows" = '.\\target\\${PROFILE_DIR}\\libafl_cxx.exe'} } -FUZZER = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libfuzzer_stb_image_sugar", mapping = {"windows" = '.\\target\\${PROFILE_DIR}\\libfuzzer_stb_image_sugar.exe'} } +PROFILE_DIR = { value = "release" } +LIBAFL_CC = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cc", mapping = { "windows" = '.\\target\\${PROFILE_DIR}\\libafl_cc.exe' } } +LIBAFL_CXX = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libafl_cxx", mapping = { "windows" = '.\\target\\${PROFILE_DIR}\\libafl_cxx.exe' } } +FUZZER = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "${CARGO_TARGET_DIR}/${PROFILE_DIR}/libfuzzer_stb_image_sugar", mapping = { "windows" = '.\\target\\${PROFILE_DIR}\\libfuzzer_stb_image_sugar.exe' } } # Compilers [tasks.cxx] condition = { files_not_exist = ["${LIBAFL_CXX}"] } command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] [tasks.cc] condition = { files_not_exist = ["${LIBAFL_CC}"] } command = "cargo" -args = ["build" , "--profile", "${PROFILE}"] +args = ["build", "--profile", "${PROFILE}"] # Build the fuzzer [tasks.fuzzer] -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' cargo build --profile ${PROFILE} cp ${FUZZER} . ''' @@ -37,18 +39,18 @@ windows_alias = "run_windows" [tasks.run_unix] script_runner = "@shell" -script=''' +script = ''' ./${FUZZER_NAME} & ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.run_windows] # Do nothing script_runner = "@shell" -script=''' +script = ''' echo "Not integrated into cargo-make yet." ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.test] @@ -58,28 +60,28 @@ windows_alias = "test_windows" [tasks.test_unix] script_runner = "@shell" -script=''' +script = ''' rm -rf libafl_unix_shmem_server || true timeout 31s ./${FUZZER_NAME} 2>/dev/null | tee fuzz_stdout.log || true echo "The test is skipped. See https://github.com/AFLplusplus/LibAFL/issues/1176" ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] [tasks.test_windows] # Do nothing script_runner = "@shell" -script=''' +script = ''' echo "Not integrated into cargo-make yet." ''' -dependencies = [ "fuzzer" ] +dependencies = ["fuzzer"] # Clean up [tasks.clean] # Disable default `clean` definition clear = true -script_runner="@shell" -script=''' +script_runner = "@shell" +script = ''' rm -f ./${FUZZER_NAME} cargo clean ''' diff --git a/libafl/Cargo.toml b/libafl/Cargo.toml index d31d6c264c..09e0a5f20d 100644 --- a/libafl/Cargo.toml +++ b/libafl/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "libafl" version = "0.13.2" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] description = "Slot your own fuzzers together and extend their features using Rust" documentation = "https://docs.rs/libafl" repository = "https://github.com/AFLplusplus/LibAFL/" @@ -9,7 +12,13 @@ readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing", "security"] edition = "2021" -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] [package.metadata.docs.rs] features = ["document-features"] @@ -17,14 +26,40 @@ all-features = true rustc-args = ["--cfg", "docsrs"] [features] -default = ["std", "derive", "llmp_compression", "llmp_small_maps", "llmp_broker_timeouts", "rand_trait", "fork", "prelude", "gzip", "regex", "serdeany_autoreg", "tui_monitor", "libafl_bolts/xxh3"] +default = [ + "std", + "derive", + "llmp_compression", + "llmp_small_maps", + "llmp_broker_timeouts", + "rand_trait", + "fork", + "prelude", + "gzip", + "regex", + "serdeany_autoreg", + "tui_monitor", + "libafl_bolts/xxh3", +] document-features = ["dep:document-features"] #! # Feature Flags #! ### General Features ## Enables features that need rust's `std` lib to work, like print, env, ... support -std = ["serde_json", "serde_json/std", "nix", "serde/std", "bincode", "wait-timeout", "uuid", "backtrace", "serial_test", "libafl_bolts/std", "typed-builder"] +std = [ + "serde_json", + "serde_json/std", + "nix", + "serde/std", + "bincode", + "wait-timeout", + "uuid", + "backtrace", + "serial_test", + "libafl_bolts/std", + "typed-builder", +] ## Tracks the Feedbacks and the Objectives that were interesting for a Testcase track_hit_feedbacks = ["std"] @@ -77,7 +112,13 @@ casr = ["libcasr", "std", "regex"] cmin = ["z3"] ## Enables the `PrometheusMonitor` which will monitor stats via UDP, for `Grafana` and others. -prometheus_monitor = ["std", "async-std", "prometheus-client", "tide", "futures"] +prometheus_monitor = [ + "std", + "async-std", + "prometheus-client", + "tide", + "futures", +] ## Include a simple concolic mutator based on z3 concolic_mutation = ["z3"] @@ -94,7 +135,10 @@ multipart_inputs = ["arrayvec", "rand_trait"] #! ## LibAFL-Bolts Features ## Provide the `#[derive(SerdeAny)]` macro. -derive = ["libafl_derive", "libafl_bolts/derive"] # provide `derive(SerdeAny) macro. +derive = [ + "libafl_derive", + "libafl_bolts/derive", +] # provide `derive(SerdeAny) macro. ## Expose `libafl_bolts::cli` for easy commandline parsing of common fuzzer settings cli = ["libafl_bolts/cli"] @@ -128,10 +172,19 @@ llmp_compression = ["libafl_bolts/llmp_compression"] llmp_debug = ["std", "libafl_bolts/llmp_debug"] ## Reduces the initial map size for llmp -llmp_small_maps = ["libafl_bolts/llmp_small_maps"] # reduces initial map size for llmp +llmp_small_maps = [ + "libafl_bolts/llmp_small_maps", +] # reduces initial map size for llmp ## Grammar mutator. Requires nightly. -nautilus = ["std", "serde_json/std", "pyo3", "rand_trait", "regex-syntax", "regex"] +nautilus = [ + "std", + "serde_json/std", + "pyo3", + "rand_trait", + "regex-syntax", + "regex", +] [build-dependencies] rustversion = "1.0" @@ -142,15 +195,25 @@ serde_json = { version = "1.0", default-features = false, features = ["alloc"] } bytecount = "0.6.3" [dependencies] -libafl_bolts = { version = "0.13.2", path = "../libafl_bolts", default-features = false, features = ["alloc"] } +libafl_bolts = { version = "0.13.2", path = "../libafl_bolts", default-features = false, features = [ + "alloc", +] } libafl_derive = { version = "0.13.2", path = "../libafl_derive", optional = true } rustversion = "1.0" tuple_list = { version = "0.1.3" } -hashbrown = { version = "0.14", features = ["serde", "ahash"], default-features = false } # A faster hashmap, nostd compatible +hashbrown = { version = "0.14", features = [ + "serde", + "ahash", +], default-features = false } # A faster hashmap, nostd compatible num-traits = { version = "0.2", default-features = false } -serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] } # serialization lib -postcard = { version = "1.0", features = ["alloc"], default-features = false } # no_std compatible serde serialization format +serde = { version = "1.0", default-features = false, features = [ + "alloc", + "derive", +] } # serialization lib +postcard = { version = "1.0", features = [ + "alloc", +], default-features = false } # no_std compatible serde serialization format bincode = { version = "1.3", optional = true } c2rust-bitfields = { version = "0.18", features = ["no_std"] } ahash = { version = "0.8", default-features = false } # The hash function already used in hashbrown @@ -158,12 +221,16 @@ meminterval = { version = "0.4", features = ["serde"] } backtrace = { version = "0.3", optional = true } # Used to get the stacktrace in StacktraceObserver typed-builder = { version = "0.18", optional = true } # Implement the builder pattern at compiletime -serde_json = { version = "1.0", optional = true, default-features = false, features = ["alloc"] } +serde_json = { version = "1.0", optional = true, default-features = false, features = [ + "alloc", +] } nix = { version = "0.29", optional = true } regex = { version = "1", optional = true } uuid = { version = "1.8", optional = true, features = ["serde", "v4"] } libm = "0.2" -ratatui = { version = "0.26", default-features = false, features = ['crossterm'], optional = true } # Commandline rendering, for TUI Monitor +ratatui = { version = "0.26", default-features = false, features = [ + 'crossterm', +], optional = true } # Commandline rendering, for TUI Monitor crossterm = { version = "0.27", optional = true } prometheus-client = { version = "0.22", optional = true } # For the prometheus monitor @@ -171,7 +238,15 @@ tide = { version = "0.16", optional = true } async-std = { version = "1.12", features = ["attributes"], optional = true } futures = { version = "0.3", optional = true } log = { version = "0.4" } -tokio = { version = "1.38", optional = true, features = ["sync", "net", "rt", "io-util", "macros", "rt-multi-thread", "time"] } # used for TCP Event Manager and multi-machine +tokio = { version = "1.38", optional = true, features = [ + "sync", + "net", + "rt", + "io-util", + "macros", + "rt-multi-thread", + "time", +] } # used for TCP Event Manager and multi-machine enumflags2 = { version = "0.7", optional = true } wait-timeout = { version = "0.2", optional = true } # used by CommandExecutor to wait for child process @@ -180,30 +255,42 @@ concat-idents = { version = "1.1.3", optional = true } libcasr = { version = "2.7", optional = true } -bitvec = { version = "1.0", optional = true, features = ["serde"] } # used for string range storage +bitvec = { version = "1.0", optional = true, features = [ + "serde", +] } # used for string range storage arrayvec = { version = "0.7.4", optional = true, default-features = false } # used for fixed-len collects const_format = "0.2.32" # used for providing helpful compiler output -const_panic = "0.2.8" # similarly, for formatting const panic output +const_panic = "0.2.8" # similarly, for formatting const panic output -pyo3 = { version = "0.18.3", optional = true } # For nautilus +pyo3 = { version = "0.18.3", optional = true } # For nautilus regex-syntax = { version = "0.8.3", optional = true } # For nautilus # optional-dev deps (change when target.'cfg(accessible(::std))'.test-dependencies will be stable) -serial_test = { version = "3", optional = true, default-features = false, features = ["logging"] } +serial_test = { version = "3", optional = true, default-features = false, features = [ + "logging", +] } # Document all features of this crate (for `cargo doc`) document-features = { version = "0.2", optional = true } # Optional -clap = {version = "4.5", optional = true} +clap = { version = "4.5", optional = true } [target.'cfg(unix)'.dependencies] -libc = "0.2" # For (*nix) libc +libc = "0.2" # For (*nix) libc z3 = { version = "0.12.0", optional = true } # for concolic mutation [target.'cfg(windows)'.dependencies] -windows = { version = "0.51.1", features = ["Win32_Foundation", "Win32_System_Threading", "Win32_System_Diagnostics_Debug", "Win32_System_Kernel", "Win32_System_Memory", "Win32_Security", "Win32_System_SystemInformation"] } +windows = { version = "0.51.1", features = [ + "Win32_Foundation", + "Win32_System_Threading", + "Win32_System_Diagnostics_Debug", + "Win32_System_Kernel", + "Win32_System_Memory", + "Win32_Security", + "Win32_System_SystemInformation", +] } [target.'cfg(windows)'.build-dependencies] windows = "0.51.1" diff --git a/libafl_bolts/Cargo.toml b/libafl_bolts/Cargo.toml index 3579455fbf..d738d9665a 100644 --- a/libafl_bolts/Cargo.toml +++ b/libafl_bolts/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "libafl_bolts" version = "0.13.2" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] description = "Low-level bolts to create fuzzers and so much more" documentation = "https://docs.rs/libafl" repository = "https://github.com/AFLplusplus/LibAFL/" @@ -9,7 +12,13 @@ readme = "./README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing", "security"] edition = "2021" -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] rust-version = "1.70.0" [package.metadata.docs.rs] @@ -17,14 +26,36 @@ features = ["document-features"] all-features = true [features] -default = ["std", "derive", "llmp_compression", "llmp_small_maps", "rand_trait", "prelude", "gzip", "serdeany_autoreg", "alloc", "xxh3"] +default = [ + "std", + "derive", + "llmp_compression", + "llmp_small_maps", + "rand_trait", + "prelude", + "gzip", + "serdeany_autoreg", + "alloc", + "xxh3", +] document-features = ["dep:document-features"] #! # Feature Flags #! ### General Features ## Enables features that need rust's `std` lib to work, like print, env, ... support -std = ["serde_json", "serde_json/std", "hostname", "nix", "serde/std", "uuid", "backtrace", "uds", "serial_test", "alloc"] +std = [ + "serde_json", + "serde_json/std", + "hostname", + "nix", + "serde/std", + "uuid", + "backtrace", + "uds", + "serial_test", + "alloc", +] ## Enables all features that allocate in `no_std` alloc = ["serde/alloc", "hashbrown", "postcard", "erased-serde/alloc", "ahash"] @@ -96,39 +127,68 @@ libafl_derive = { version = "0.13.2", optional = true, path = "../libafl_derive" static_assertions = "1.1.0" tuple_list = { version = "0.1.3" } -hashbrown = { version = "0.14", features = ["serde", "ahash"], default-features = false, optional = true } # A faster hashmap, nostd compatible -xxhash-rust = { version = "0.8.5", features = ["xxh3"], optional = true } # xxh3 hashing for rust -serde = { version = "1.0", default-features = false, features = ["derive"] } # serialization lib +hashbrown = { version = "0.14", features = [ + "serde", + "ahash", +], default-features = false, optional = true } # A faster hashmap, nostd compatible +xxhash-rust = { version = "0.8.5", features = [ + "xxh3", +], optional = true } # xxh3 hashing for rust +serde = { version = "1.0", default-features = false, features = [ + "derive", +] } # serialization lib erased-serde = { version = "0.4.5", default-features = false, optional = true } # erased serde -postcard = { version = "1.0", features = ["alloc"], default-features = false, optional = true } # no_std compatible serde serialization format +postcard = { version = "1.0", features = [ + "alloc", +], default-features = false, optional = true } # no_std compatible serde serialization format num_enum = { version = "0.7", default-features = false } ahash = { version = "0.8", default-features = false, optional = true } # The hash function already used in hashbrown backtrace = { version = "0.3", optional = true } # Used to get the stacktrace in StacktraceObserver ctor = { optional = true, version = "0.2" } -serde_json = { version = "1.0", optional = true, default-features = false, features = ["alloc"] } +serde_json = { version = "1.0", optional = true, default-features = false, features = [ + "alloc", +] } miniz_oxide = { version = "0.7.1", optional = true } hostname = { version = "^0.4", optional = true } # Is there really no gethostname in the stdlib? rand_core = { version = "0.6", optional = true } -nix = { version = "0.29", default-features = false, optional = true, features = ["signal", "socket", "poll"] } +nix = { version = "0.29", default-features = false, optional = true, features = [ + "signal", + "socket", + "poll", +] } uuid = { version = "1.4", optional = true, features = ["serde", "v4"] } -clap = { version = "4.5", features = ["derive", "wrap_help"], optional = true } # CLI parsing, for libafl_bolts::cli / the `cli` feature +clap = { version = "4.5", features = [ + "derive", + "wrap_help", +], optional = true } # CLI parsing, for libafl_bolts::cli / the `cli` feature log = { version = "0.4" } pyo3 = { version = "0.18", optional = true, features = ["serde", "macros"] } # optional-dev deps (change when target.'cfg(accessible(::std))'.test-dependencies will be stable) -serial_test = { version = "3", optional = true, default-features = false, features = ["logging"] } +serial_test = { version = "3", optional = true, default-features = false, features = [ + "logging", +] } # Document all features of this crate (for `cargo doc`) document-features = { version = "0.2", optional = true } [target.'cfg(unix)'.dependencies] -libc = "0.2" # For (*nix) libc +libc = "0.2" # For (*nix) libc uds = { version = "0.4", optional = true, default-features = false } [target.'cfg(windows)'.dependencies] -windows = { version = "0.51.1", features = ["Win32_Foundation", "Win32_System_Threading", "Win32_System_Diagnostics_Debug", "Win32_System_Kernel", "Win32_System_Memory", "Win32_Security", "Win32_System_SystemInformation", "Win32_System_Console"] } +windows = { version = "0.51.1", features = [ + "Win32_Foundation", + "Win32_System_Threading", + "Win32_System_Diagnostics_Debug", + "Win32_System_Kernel", + "Win32_System_Memory", + "Win32_Security", + "Win32_System_SystemInformation", + "Win32_System_Console", +] } [target.'cfg(windows)'.build-dependencies] windows = "0.51.1" diff --git a/libafl_cc/Cargo.toml b/libafl_cc/Cargo.toml index 49e05b8013..1342ce6c7a 100644 --- a/libafl_cc/Cargo.toml +++ b/libafl_cc/Cargo.toml @@ -9,12 +9,28 @@ readme = "README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing", "compiler"] edition = "2021" -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -default = ["ddg-instr", "function-logging", "cmplog-routines", "autotokens", "coverage-accounting", "cmplog-instructions", "ctx", "dump-cfg", "profiling"] +default = [ + "ddg-instr", + "function-logging", + "cmplog-routines", + "autotokens", + "coverage-accounting", + "cmplog-instructions", + "ctx", + "dump-cfg", + "profiling", +] # llvm passes ddg-instr = [] @@ -35,4 +51,7 @@ which = "6.0" glob = "0.3" [dependencies] -serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] } # serialization lib \ No newline at end of file +serde = { version = "1.0", default-features = false, features = [ + "alloc", + "derive", +] } # serialization lib diff --git a/libafl_concolic/symcc_libafl/Cargo.toml b/libafl_concolic/symcc_libafl/Cargo.toml index 438f61ab38..fd3a2b29a1 100644 --- a/libafl_concolic/symcc_libafl/Cargo.toml +++ b/libafl_concolic/symcc_libafl/Cargo.toml @@ -2,14 +2,24 @@ name = "symcc_libafl" version = "0.13.2" edition = "2021" -authors = ["Julius Hohnerlein ", "Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Julius Hohnerlein ", + "Andrea Fioraldi ", + "Dominik Maier ", +] description = "Meta package for symcc_runtime" documentation = "https://docs.rs/symcc_libafl" repository = "https://github.com/AFLplusplus/LibAFL/" readme = "README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing", "security"] -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libafl_concolic/symcc_runtime/Cargo.toml b/libafl_concolic/symcc_runtime/Cargo.toml index e7f746ffe3..506eb1b0b8 100644 --- a/libafl_concolic/symcc_runtime/Cargo.toml +++ b/libafl_concolic/symcc_runtime/Cargo.toml @@ -2,7 +2,11 @@ name = "symcc_runtime" version = "0.13.2" edition = "2021" -authors = ["Julius Hohnerlein ", "Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Julius Hohnerlein ", + "Andrea Fioraldi ", + "Dominik Maier ", +] description = "Build Concolic Tracing tools based on SymCC in Rust" documentation = "https://docs.rs/symcc_runtime" repository = "https://github.com/AFLplusplus/LibAFL/" @@ -10,7 +14,13 @@ readme = "README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing", "security"] build = "build.rs" -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -25,8 +35,14 @@ no-cpp-runtime = [] unchecked_unwrap = "4" ctor = "0.2" libc = "0.2" -libafl = { path = "../../libafl", version = "0.13.2", default-features=false, features=["std", "serdeany_autoreg"] } -libafl_bolts = { path = "../../libafl_bolts", version = "0.13.2", default-features=false, features=["std", "serdeany_autoreg"] } +libafl = { path = "../../libafl", version = "0.13.2", default-features = false, features = [ + "std", + "serdeany_autoreg", +] } +libafl_bolts = { path = "../../libafl_bolts", version = "0.13.2", default-features = false, features = [ + "std", + "serdeany_autoreg", +] } [build-dependencies] cmake = "0.1" diff --git a/libafl_concolic/test/dump_constraints/Cargo.toml b/libafl_concolic/test/dump_constraints/Cargo.toml index 5b441b6074..034d71db10 100644 --- a/libafl_concolic/test/dump_constraints/Cargo.toml +++ b/libafl_concolic/test/dump_constraints/Cargo.toml @@ -9,11 +9,17 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "libafl", "ldpreload"] -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -libafl = {path = "../../../libafl"} -libafl_bolts = {path = "../../../libafl_bolts"} +libafl = { path = "../../../libafl" } +libafl_bolts = { path = "../../../libafl_bolts" } clap = { version = "4.5", features = ["derive"] } diff --git a/libafl_concolic/test/runtime_test/Cargo.toml b/libafl_concolic/test/runtime_test/Cargo.toml index 6ef0bbb516..823c6f1f9a 100644 --- a/libafl_concolic/test/runtime_test/Cargo.toml +++ b/libafl_concolic/test/runtime_test/Cargo.toml @@ -9,10 +9,16 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "libafl", "symbolic", "symcc", "symqemu", "fuzzer"] -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] [lib] -crate-type = ["cdylib"] +crate-type = ["cdylib"] name = "SymRuntime" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libafl_derive/Cargo.toml b/libafl_derive/Cargo.toml index b6be7464b2..b3e6fb3b42 100644 --- a/libafl_derive/Cargo.toml +++ b/libafl_derive/Cargo.toml @@ -9,7 +9,13 @@ readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing"] edition = "2021" -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] [lib] proc-macro = true diff --git a/libafl_frida/Cargo.toml b/libafl_frida/Cargo.toml index 9505522e38..0b75090f39 100644 --- a/libafl_frida/Cargo.toml +++ b/libafl_frida/Cargo.toml @@ -10,17 +10,22 @@ license = "MIT OR Apache-2.0" keywords = ["fuzzing", "frida", "instrumentation"] edition = "2021" categories = [ - "development-tools::testing", - "emulators", - "embedded", - "os", - "no-std" + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", ] [package.metadata.docs.rs] no-default-features = true # We can't use auto-download inside docs.rs (no internet) all-features = false -features = ["cmplog", "serdeany_autoreg", "track_hit_feedbacks", "document-features"] +features = [ + "cmplog", + "serdeany_autoreg", + "track_hit_feedbacks", + "document-features", +] [features] default = ["serdeany_autoreg", "auto-download"] @@ -50,18 +55,18 @@ iced-x86 = { version = "1.20.0", features = ["code_asm"], optional = true } [dependencies] libafl = { path = "../libafl", default-features = false, version = "0.13.2", features = [ - "std", - "derive", - "frida_cli", + "std", + "derive", + "frida_cli", ] } libafl_bolts = { path = "../libafl_bolts", version = "0.13.2", default-features = false, features = [ - "std", - "derive", - "frida_cli" + "std", + "derive", + "frida_cli", ] } libafl_targets = { path = "../libafl_targets", version = "0.13.2", features = [ - "std", - "sancov_cmplog", + "std", + "sancov_cmplog", ] } nix = { version = "0.29", features = ["mman"] } @@ -69,13 +74,13 @@ libc = "0.2" hashbrown = "0.14" rangemap = "1.3" frida-gum-sys = { version = "0.13.6", features = [ - "event-sink", - "invocation-listener", + "event-sink", + "invocation-listener", ] } frida-gum = { version = "0.13.6", features = [ - "event-sink", - "invocation-listener", - "module-names", + "event-sink", + "invocation-listener", + "module-names", ] } dynasmrt = "2" @@ -83,8 +88,8 @@ color-backtrace = { version = "0.6", features = ["resolve-modules"] } termcolor = "1.1.3" serde = "1.0" backtrace = { version = "0.3", default-features = false, features = [ - "std", - "serde", + "std", + "serde", ] } num-traits = "0.2" ahash = "^0.8" # fetch the latest @@ -97,12 +102,14 @@ yaxpeax-arch = "0.2.7" document-features = { version = "0.2", optional = true } # Document all features of this crate (for `cargo doc`) [target.'cfg(windows)'.dependencies] -winsafe = {version = "0.0.21", features = ["kernel"]} +winsafe = { version = "0.0.21", features = ["kernel"] } [dev-dependencies] -serial_test = { version = "3", default-features = false, features = ["logging"] } -clap = {version = "4.5", features = ["derive"]} +serial_test = { version = "3", default-features = false, features = [ + "logging", +] } +clap = { version = "4.5", features = ["derive"] } libloading = "0.8" mimalloc = { version = "0.1", default-features = false } -dlmalloc ={version = "0.2.6", features = ["global"]} +dlmalloc = { version = "0.2.6", features = ["global"] } diff --git a/libafl_libfuzzer/Cargo.toml b/libafl_libfuzzer/Cargo.toml index 07f69ad5a7..f0820eb4f1 100644 --- a/libafl_libfuzzer/Cargo.toml +++ b/libafl_libfuzzer/Cargo.toml @@ -9,12 +9,7 @@ keywords = ["fuzzing", "testing", "security"] edition = "2021" categories = ["development-tools::testing"] -include = [ - "/src", - "/Cargo.toml", - "/build.rs", - "/runtime", -] +include = ["/src", "/Cargo.toml", "/build.rs", "/runtime"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libafl_libfuzzer/runtime/Cargo.toml.template b/libafl_libfuzzer/runtime/Cargo.toml.template index 5332a4432b..41320a2616 100644 --- a/libafl_libfuzzer/runtime/Cargo.toml.template +++ b/libafl_libfuzzer/runtime/Cargo.toml.template @@ -10,7 +10,10 @@ publish = false default = ["fork"] ## Enables forking mode for the LibAFL launcher (instead of starting new processes) fork = ["libafl/fork"] -track_hit_feedbacks = ["libafl/track_hit_feedbacks", "libafl_targets/track_hit_feedbacks"] +track_hit_feedbacks = [ + "libafl/track_hit_feedbacks", + "libafl_targets/track_hit_feedbacks", +] [profile.release] lto = true @@ -25,13 +28,42 @@ debug = false strip = true [lib] -name = "afl_libfuzzer_runtime" # historically, cargo-fuzz strips double-prefixes; maintain compat +name = "afl_libfuzzer_runtime" # historically, cargo-fuzz strips double-prefixes; maintain compat crate-type = ["staticlib", "rlib"] [dependencies] -libafl = { path = "../libafl", default-features = false, features = ["std", "derive", "llmp_compression", "rand_trait", "regex", "errors_backtrace", "serdeany_autoreg", "tui_monitor", "unicode"] } -libafl_bolts = { path = "../libafl_bolts", default-features = false, features = ["std", "derive", "llmp_compression", "rand_trait", "serdeany_autoreg", "errors_backtrace"] } -libafl_targets = { path = "../libafl_targets", features = ["sancov_8bit", "sancov_cmplog", "sancov_value_profile", "sancov_pcguard", "libfuzzer", "libfuzzer_oom", "libfuzzer_define_run_driver", "libfuzzer_interceptors", "sanitizers_flags", "whole_archive", "sanitizer_interfaces"] } +libafl = { path = "../libafl", default-features = false, features = [ + "std", + "derive", + "llmp_compression", + "rand_trait", + "regex", + "errors_backtrace", + "serdeany_autoreg", + "tui_monitor", + "unicode", +] } +libafl_bolts = { path = "../libafl_bolts", default-features = false, features = [ + "std", + "derive", + "llmp_compression", + "rand_trait", + "serdeany_autoreg", + "errors_backtrace", +] } +libafl_targets = { path = "../libafl_targets", features = [ + "sancov_8bit", + "sancov_cmplog", + "sancov_value_profile", + "sancov_pcguard", + "libfuzzer", + "libfuzzer_oom", + "libfuzzer_define_run_driver", + "libfuzzer_interceptors", + "sanitizers_flags", + "whole_archive", + "sanitizer_interfaces", +] } ahash = { version = "0.8.3", default-features = false } libc = "0.2.1" @@ -39,7 +71,7 @@ log = "0.4.20" mimalloc = { version = "0.1.34", default-features = false } num-traits = "0.2.15" rand = "0.8.5" -serde = { version = "1.0", features = ["derive"] } # serialization lib +serde = { version = "1.0", features = ["derive"] } # serialization lib hashbrown = "0.14" # for identifying if we can grimoire-ify diff --git a/libafl_nyx/Cargo.toml b/libafl_nyx/Cargo.toml index 7182b53b1e..75a15db66d 100644 --- a/libafl_nyx/Cargo.toml +++ b/libafl_nyx/Cargo.toml @@ -9,15 +9,32 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing", "security"] -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [target.'cfg(target_os = "linux")'.dependencies] libnyx = { git = "https://github.com/nyx-fuzz/libnyx.git", rev = "6833d236dfe785a8a23d8c8d79e74c99fa635004" } -libafl = { path = "../libafl", version = "0.13.2", features = ["std", "libafl_derive", "frida_cli" ]} -libafl_bolts = { path = "../libafl_bolts", version = "0.13.2", features = ["std", "libafl_derive", "frida_cli" ]} -libafl_targets = { path = "../libafl_targets", version = "0.13.2", features = ["std", "sancov_cmplog"] } +libafl = { path = "../libafl", version = "0.13.2", features = [ + "std", + "libafl_derive", + "frida_cli", +] } +libafl_bolts = { path = "../libafl_bolts", version = "0.13.2", features = [ + "std", + "libafl_derive", + "frida_cli", +] } +libafl_targets = { path = "../libafl_targets", version = "0.13.2", features = [ + "std", + "sancov_cmplog", +] } nix = { version = "0.29", features = ["fs"] } typed-builder = "0.18" diff --git a/libafl_qemu/Cargo.toml b/libafl_qemu/Cargo.toml index 4e37972450..6f5fafdd0c 100644 --- a/libafl_qemu/Cargo.toml +++ b/libafl_qemu/Cargo.toml @@ -9,16 +9,30 @@ readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "qemu", "instrumentation"] edition = "2021" -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] [package.metadata.docs.rs] features = ["document-features", "default", "python", "x86_64", "usermode"] rustdoc-args = ["--cfg", "docsrs"] [features] -default = ["fork", "build_libgasan", "build_libqasan", "serdeany_autoreg", "injections"] +default = [ + "fork", + "build_libgasan", + "build_libqasan", + "serdeany_autoreg", + "injections", +] document-features = ["dep:document-features"] -paranoid_debug = ["libafl_qemu_sys/paranoid_debug"] # Will perform as many checks as possible. The target will be greatly slowed down. +paranoid_debug = [ + "libafl_qemu_sys/paranoid_debug", +] # Will perform as many checks as possible. The target will be greatly slowed down. #! # Feature Flags #! ### General Features @@ -39,7 +53,9 @@ x86_64 = ["libafl_qemu_sys/x86_64"] i386 = ["libafl_qemu_sys/i386"] # build qemu for i386 arm = ["libafl_qemu_sys/arm"] # build qemu for arm aarch64 = ["libafl_qemu_sys/aarch64"] # build qemu for aarch64 -mips = ["libafl_qemu_sys/mips"] # build qemu for mips (el, use with the 'be' feature of mips be) +mips = [ + "libafl_qemu_sys/mips", +] # build qemu for mips (el, use with the 'be' feature of mips be) ppc = ["libafl_qemu_sys/ppc"] # build qemu for powerpc hexagon = ["libafl_qemu_sys/hexagon"] # build qemu for hexagon @@ -56,23 +72,37 @@ systemmode = ["libafl_qemu_sys/systemmode"] ## Automatically register all `#[derive(SerdeAny)]` types at startup. serdeany_autoreg = ["libafl_bolts/serdeany_autoreg"] -slirp = [ "systemmode", "libafl_qemu_sys/slirp" ] # build qemu with host libslirp (for user networking) +slirp = [ + "systemmode", + "libafl_qemu_sys/slirp", +] # build qemu with host libslirp (for user networking) # Requires the binary's build.rs to call `build_libafl_qemu` -shared = [ "libafl_qemu_sys/shared" ] +shared = ["libafl_qemu_sys/shared"] #! ## Internal features, don't use in normal projects ## clippy workaround clippy = ["libafl_qemu_sys/clippy"] [dependencies] -libafl = { path = "../libafl", version = "0.13.2", default-features = false, features = ["std", "derive", "regex"] } -libafl_bolts = { path = "../libafl_bolts", version = "0.13.2", default-features = false, features = ["std", "derive"] } +libafl = { path = "../libafl", version = "0.13.2", default-features = false, features = [ + "std", + "derive", + "regex", +] } +libafl_bolts = { path = "../libafl_bolts", version = "0.13.2", default-features = false, features = [ + "std", + "derive", +] } libafl_targets = { path = "../libafl_targets", version = "0.13.2" } libafl_qemu_sys = { path = "./libafl_qemu_sys", version = "0.13.2" } -serde = { version = "1.0", default-features = false, features = ["alloc"] } # serialization lib -hashbrown = { version = "0.14", features = ["serde"] } # A faster hashmap, nostd compatible +serde = { version = "1.0", default-features = false, features = [ + "alloc", +] } # serialization lib +hashbrown = { version = "0.14", features = [ + "serde", +] } # A faster hashmap, nostd compatible num-traits = "0.2" num-derive = "0.4" num_enum = "0.7" @@ -93,7 +123,7 @@ paste = "1" enum-map = "2.7" serde_yaml = { version = "0.9", optional = true } # For parsing the injections yaml file toml = { version = "0.8.13", optional = true } # For parsing the injections toml file -pyo3 = { version = "0.18", optional = true , features = ["multiple-pymethods"]} +pyo3 = { version = "0.18", optional = true, features = ["multiple-pymethods"] } bytes-utils = "0.1" typed-builder = "0.18" memmap2 = "0.9" diff --git a/libafl_qemu/libafl_qemu_build/Cargo.toml b/libafl_qemu/libafl_qemu_build/Cargo.toml index 915919e610..308f845224 100644 --- a/libafl_qemu/libafl_qemu_build/Cargo.toml +++ b/libafl_qemu/libafl_qemu_build/Cargo.toml @@ -7,14 +7,14 @@ documentation = "https://docs.rs/libafl_qemu_build" repository = "https://github.com/AFLplusplus/LibAFL/" readme = "./README.md" license = "MIT OR Apache-2.0" -keywords =["fuzzing", "qemu", "instrumentation"] +keywords = ["fuzzing", "qemu", "instrumentation"] edition = "2021" categories = [ - "development-tools::testing", - "emulators", - "embedded", - "os", - "no-std", + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", ] [package.metadata.docs.rs] @@ -22,11 +22,12 @@ all-features = true [features] shared = [] -slirp = [] # build qemu with host libslirp (for user networking) +slirp = [] # build qemu with host libslirp (for user networking) clippy = [] # special feature for clippy, don't use in normal projects§ -paranoid_debug = [] # Will perform as many checks as possible. The target will be greatly slowed down. +paranoid_debug = [ +] # Will perform as many checks as possible. The target will be greatly slowed down. [dependencies] bindgen = "0.69.4" @@ -37,4 +38,4 @@ pkg-config = "0.3.26" cc = "1.0" regex = "1" rustversion = "1.0" -rustc_version = "0.4" \ No newline at end of file +rustc_version = "0.4" diff --git a/libafl_qemu/libafl_qemu_sys/Cargo.toml b/libafl_qemu/libafl_qemu_sys/Cargo.toml index 27e0a718d2..6a337d5459 100644 --- a/libafl_qemu/libafl_qemu_sys/Cargo.toml +++ b/libafl_qemu/libafl_qemu_sys/Cargo.toml @@ -9,7 +9,13 @@ readme = "../../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "qemu", "instrumentation"] edition = "2021" -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] links = "qemu" [package.metadata.docs.rs] @@ -18,12 +24,12 @@ rustdoc-args = ["--cfg", "docsrs"] [features] # The following architecture features are mutually exclusive. -x86_64 = [] # build qemu for x86_64 (default) -i386 = [] # build qemu for i386 -arm = [] # build qemu for arm +x86_64 = [] # build qemu for x86_64 (default) +i386 = [] # build qemu for i386 +arm = [] # build qemu for arm aarch64 = [] # build qemu for aarch64 -mips = [] # build qemu for mips (el, use with the 'be' feature of mips be) -ppc = [] # build qemu for powerpc +mips = [] # build qemu for mips (el, use with the 'be' feature of mips be) +ppc = [] # build qemu for powerpc hexagon = [] # build qemu for hexagon be = [] @@ -33,12 +39,19 @@ systemmode = [] python = ["pyo3", "pyo3-build-config"] -slirp = [ "systemmode", "libafl_qemu_build/slirp" ] # build qemu with host libslirp (for user networking) -shared = [ "libafl_qemu_build/shared" ] +slirp = [ + "systemmode", + "libafl_qemu_build/slirp", +] # build qemu with host libslirp (for user networking) +shared = ["libafl_qemu_build/shared"] -clippy = [ "libafl_qemu_build/clippy" ] # special feature for clippy, don't use in normal projects +clippy = [ + "libafl_qemu_build/clippy", +] # special feature for clippy, don't use in normal projects -paranoid_debug = ["libafl_qemu_build/paranoid_debug"] # Will perform as many checks as possible. The target will be greatly slowed down. +paranoid_debug = [ + "libafl_qemu_build/paranoid_debug", +] # Will perform as many checks as possible. The target will be greatly slowed down. [dependencies] paste = "1" diff --git a/libafl_sugar/Cargo.toml b/libafl_sugar/Cargo.toml index 60817cae5e..ecc5f232a8 100644 --- a/libafl_sugar/Cargo.toml +++ b/libafl_sugar/Cargo.toml @@ -10,7 +10,13 @@ license = "MIT OR Apache-2.0" keywords = ["fuzzing"] edition = "2021" build = "build.rs" -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] [package.metadata.docs.rs] all-features = true @@ -18,7 +24,9 @@ all-features = true [features] default = [] document-features = ["dep:document-features"] -clippy = [ "libafl_qemu/clippy" ] # special feature for clippy, don't use in normal projects +clippy = [ + "libafl_qemu/clippy", +] # special feature for clippy, don't use in normal projects #! # Feature Flags #! ## General Features @@ -55,7 +63,7 @@ libafl_targets = { path = "../libafl_targets", version = "0.13.2" } # Document all features of this crate (for `cargo doc`) document-features = { version = "0.2", optional = true } -typed-builder = "0.18" # Implement the builder pattern at compiletime +typed-builder = "0.18" # Implement the builder pattern at compiletime pyo3 = { version = "0.18", optional = true } log = "0.4.20" diff --git a/libafl_targets/Cargo.toml b/libafl_targets/Cargo.toml index ab79a8b52d..759c1b6217 100644 --- a/libafl_targets/Cargo.toml +++ b/libafl_targets/Cargo.toml @@ -10,11 +10,11 @@ license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing"] edition = "2021" categories = [ - "development-tools::testing", - "emulators", - "embedded", - "os", - "no-std", + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", ] [package.metadata.docs.rs] @@ -22,13 +22,13 @@ all-features = true [features] default = [ - "std", - "sanitizers_flags", - "windows_asan", - "forkserver", - "cmplog", - "coverage", - "common", + "std", + "sanitizers_flags", + "windows_asan", + "forkserver", + "cmplog", + "coverage", + "common", ] std = ["libafl/std"] introspection = ["libafl/introspection"] @@ -46,18 +46,22 @@ sancov_8bit = [] sancov_ngram4 = ["coverage"] sancov_ngram8 = ["coverage"] sancov_ctx = ["coverage"] -sancov_cmplog = ["common"] # Defines cmp and __sanitizer_weak_hook functions. Use libfuzzer_interceptors to define interceptors (only compatible with Linux) +sancov_cmplog = [ + "common", +] # Defines cmp and __sanitizer_weak_hook functions. Use libfuzzer_interceptors to define interceptors (only compatible with Linux) sancov_pcguard = ["sancov_pcguard_hitcounts"] sanitizer_interfaces = [] clippy = [] # Ignore compiler warnings during clippy observers = ["meminterval", "ahash"] -common = [] # Compile common C code defining sanitizer options and cross-platform intrinsics +common = [ +] # Compile common C code defining sanitizer options and cross-platform intrinsics coverage = ["common"] # Compile C code definining coverage maps cmplog = ["common"] # Compile C code defining cmp log maps forkserver = ["common"] # Compile C code for forkserver support windows_asan = ["common"] # Compile C code for ASAN on Windows whole_archive = [] # use +whole-archive to ensure the presence of weak symbols -cmplog_extended_instrumentation = [] # support for aflpp cmplog map, we will remove this once aflpp and libafl cmplog shares the same LLVM passes. +cmplog_extended_instrumentation = [ +] # support for aflpp cmplog map, we will remove this once aflpp and libafl cmplog shares the same LLVM passes. function-logging = ["common"] track_hit_feedbacks = ["libafl/track_hit_feedbacks"] [build-dependencies] @@ -66,8 +70,10 @@ cc = { version = "1.0", features = ["parallel"] } rustversion = "1.0" [dependencies] -libafl = { path = "../libafl", version = "0.13.2", default-features = false, features = [] } -libafl_bolts = { path = "../libafl_bolts", version = "0.13.2", default-features = false, features = [] } +libafl = { path = "../libafl", version = "0.13.2", default-features = false, features = [ +] } +libafl_bolts = { path = "../libafl_bolts", version = "0.13.2", default-features = false, features = [ +] } libc = "0.2" hashbrown = "0.14" once_cell = "1.19" @@ -75,7 +81,9 @@ log = "0.4.20" rustversion = "1.0" rangemap = "1.3" -serde = { version = "1.0", default-features = false, features = ["alloc"] } # serialization lib +serde = { version = "1.0", default-features = false, features = [ + "alloc", +] } # serialization lib meminterval = { version = "0.4", features = ["serde"], optional = true } ahash = { version = "0.8.3", default-features = false, optional = true } # serde-big-array = "0.3.2" diff --git a/libafl_tinyinst/Cargo.toml b/libafl_tinyinst/Cargo.toml index a0fec3033b..f05c15029a 100644 --- a/libafl_tinyinst/Cargo.toml +++ b/libafl_tinyinst/Cargo.toml @@ -2,9 +2,18 @@ name = "libafl_tinyinst" version = "0.13.2" edition = "2021" -authors = ["elbiazo ", "Dongjia Zhang "] +authors = [ + "elbiazo ", + "Dongjia Zhang ", +] repository = "https://github.com/AFLplusplus/LibAFL/" -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing", "security"] description = "TinyInst backend for libafl" @@ -13,12 +22,12 @@ description = "TinyInst backend for libafl" [dependencies] libafl = { path = "../libafl", version = "0.13.2", features = [ - "std", - "libafl_derive", + "std", + "libafl_derive", ] } libafl_bolts = { path = "../libafl_bolts", version = "0.13.2", features = [ - "std", - "libafl_derive", + "std", + "libafl_derive", ] } tinyinst = { git = "https://github.com/AFLplusplus/tinyinst-rs" } # tinyinst-rs = { path = "../../tinyinst-rs" } diff --git a/utils/deexit/Cargo.toml b/utils/deexit/Cargo.toml index 28ca95cc13..7249b98edd 100644 --- a/utils/deexit/Cargo.toml +++ b/utils/deexit/Cargo.toml @@ -1,5 +1,8 @@ [package] -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] name = "deexit" version = "0.13.2" edition = "2021" @@ -9,7 +12,13 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "libafl", "ldpreload"] -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -18,4 +27,4 @@ log = "0.4.20" [lib] name = "deexit" -crate-type = ["cdylib"] \ No newline at end of file +crate-type = ["cdylib"] diff --git a/utils/desyscall/Cargo.toml b/utils/desyscall/Cargo.toml index 63bf66b8fe..c6a5bce7f4 100644 --- a/utils/desyscall/Cargo.toml +++ b/utils/desyscall/Cargo.toml @@ -5,7 +5,13 @@ edition = "2021" description = "DeSyscall: Hooks syscalls for reduces overhead during in-process fuzzing" repository = "https://github.com/AFLplusplus/LibAFL/" license = "MIT OR Apache-2.0" -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] keywords = ["fuzzing", "libafl", "ldpreload"] [dependencies] diff --git a/utils/gdb_qemu/Cargo.toml b/utils/gdb_qemu/Cargo.toml index 4f626a8850..5691c03f0e 100644 --- a/utils/gdb_qemu/Cargo.toml +++ b/utils/gdb_qemu/Cargo.toml @@ -1,6 +1,3 @@ [workspace] resolver = "2" -members = [ - "gdb_qemu", - "demo", -] +members = ["gdb_qemu", "demo"] diff --git a/utils/gdb_qemu/Makefile.toml b/utils/gdb_qemu/Makefile.toml index dbdb4bda72..313490dbda 100644 --- a/utils/gdb_qemu/Makefile.toml +++ b/utils/gdb_qemu/Makefile.toml @@ -2,16 +2,16 @@ default_to_workspace = false [env] -DEMO_TARGET="powerpc-unknown-linux-gnu" -HOST_TARGET="x86_64-unknown-linux-gnu" -PROFILE="dev" -DEMO_DIR="${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${DEMO_TARGET}/debug" -TARGET_DIR="${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${HOST_TARGET}/debug" +DEMO_TARGET = "powerpc-unknown-linux-gnu" +HOST_TARGET = "x86_64-unknown-linux-gnu" +PROFILE = "dev" +DEMO_DIR = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${DEMO_TARGET}/debug" +TARGET_DIR = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${HOST_TARGET}/debug" [env.release] -PROFILE="release" -DEMO_DIR="${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${DEMO_TARGET}/release" -TARGET_DIR="${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${HOST_TARGET}/release" +PROFILE = "release" +DEMO_DIR = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${DEMO_TARGET}/release" +TARGET_DIR = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${HOST_TARGET}/release" [tasks.clean] command = "cargo" @@ -27,55 +27,61 @@ dependencies = ["format", "clippy"] command = "cargo" args = [ "build", - "-p", "demo", - "--profile", "${PROFILE}", - "--target", "powerpc-unknown-linux-gnu", + "-p", + "demo", + "--profile", + "${PROFILE}", + "--target", + "powerpc-unknown-linux-gnu", ] [tasks.run_demo] dependencies = ["demo"] command = "cargo" -args = [ - "run", - "-p", "demo", - "--target", "powerpc-unknown-linux-gnu", -] +args = ["run", "-p", "demo", "--target", "powerpc-unknown-linux-gnu"] [tasks.build] dependencies = ["format", "clippy"] command = "cargo" -args = [ - "build", - "-p", "gdb_qemu", - "--profile", "${PROFILE}", -] +args = ["build", "-p", "gdb_qemu", "--profile", "${PROFILE}"] [tasks.run] command = "cargo" -dependencies = [ "demo" ] +dependencies = ["demo"] args = [ "run", - "-p", "gdb_qemu", - "--profile", "${PROFILE}", + "-p", + "gdb_qemu", + "--profile", + "${PROFILE}", "--", - "-p", "1234", - "-L", "trace", - "--", - "qemu-ppc", - "-L", "/usr/powerpc-linux-gnu", - "-g", "1234", - "${DEMO_DIR}/demo" + "-p", + "1234", + "-L", + "trace", + "--", + "qemu-ppc", + "-L", + "/usr/powerpc-linux-gnu", + "-g", + "1234", + "${DEMO_DIR}/demo", ] [tasks.gdb] command = "gdb-multiarch" dependencies = ["demo", "build"] args = [ - "-ex", "set architecture powerpc:MPC8XX", - "-ex", "set pagination off", - "-ex", "set confirm off", - "-ex", "file ${DEMO_DIR}/demo", - "-ex", "target remote | ${TARGET_DIR}/gdb_qemu -p 1234 -L trace qemu-ppc -- -L /usr/powerpc-linux-gnu -g 1234 ${DEMO_DIR}/demo" + "-ex", + "set architecture powerpc:MPC8XX", + "-ex", + "set pagination off", + "-ex", + "set confirm off", + "-ex", + "file ${DEMO_DIR}/demo", + "-ex", + "target remote | ${TARGET_DIR}/gdb_qemu -p 1234 -L trace qemu-ppc -- -L /usr/powerpc-linux-gnu -g 1234 ${DEMO_DIR}/demo", ] [tasks.all] diff --git a/utils/gdb_qemu/demo/Cargo.toml b/utils/gdb_qemu/demo/Cargo.toml index 92288c530a..48f4035c43 100644 --- a/utils/gdb_qemu/demo/Cargo.toml +++ b/utils/gdb_qemu/demo/Cargo.toml @@ -4,8 +4,20 @@ version = "0.13.2" edition = "2021" [build-dependencies] -vergen = { version = "8.1.1", features = ["build", "cargo", "git", "gitcl", "rustc", "si"] } +vergen = { version = "8.1.1", features = [ + "build", + "cargo", + "git", + "gitcl", + "rustc", + "si", +] } [dependencies] anyhow = { version = "1.0", default-features = false } -clap = { version = "4.5", default-features = false, features = ["derive", "string", "std", "help"] } +clap = { version = "4.5", default-features = false, features = [ + "derive", + "string", + "std", + "help", +] } diff --git a/utils/gdb_qemu/gdb_qemu/Cargo.toml b/utils/gdb_qemu/gdb_qemu/Cargo.toml index 6fa89cbfbe..0755ac5f21 100644 --- a/utils/gdb_qemu/gdb_qemu/Cargo.toml +++ b/utils/gdb_qemu/gdb_qemu/Cargo.toml @@ -4,13 +4,31 @@ version = "0.13.2" edition = "2021" [build-dependencies] -vergen = { version = "8.1.1", features = ["build", "cargo", "git", "gitcl", "rustc", "si"] } +vergen = { version = "8.1.1", features = [ + "build", + "cargo", + "git", + "gitcl", + "rustc", + "si", +] } [dependencies] anyhow = { version = "1.0", default-features = false } -clap = { version = "4.5", default-features = false, features = ["derive", "string", "std", "help", "derive", "error-context", "usage"] } -libc = {version = "0.2", default-features = false } +clap = { version = "4.5", default-features = false, features = [ + "derive", + "string", + "std", + "help", + "derive", + "error-context", + "usage", +] } +libc = { version = "0.2", default-features = false } log = { version = "0.4", default-features = false } -nix = { version = "0.29", default-features = false, features = ["signal", "fs"] } +nix = { version = "0.29", default-features = false, features = [ + "signal", + "fs", +] } readonly = { version = "0.2.8", default-features = false } simplelog = { version = "0.12.1", default-features = false } diff --git a/utils/gramatron/construct_automata/Cargo.toml b/utils/gramatron/construct_automata/Cargo.toml index cd9818fee2..418b9900eb 100644 --- a/utils/gramatron/construct_automata/Cargo.toml +++ b/utils/gramatron/construct_automata/Cargo.toml @@ -2,14 +2,23 @@ name = "construct_automata" version = "0.13.2" edition = "2021" -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] description = "LibAFL Gramatron Gramar Construction" documentation = "https://docs.rs/libafl" repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "libafl", "gramatron", "grammar"] -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -18,6 +27,8 @@ categories = ["development-tools::testing", "emulators", "embedded", "os", "no-s libafl = { path = "../../../libafl", default-features = false } serde_json = "1.0" regex = "1" -postcard = { version = "1.0", features = ["alloc"], default-features = false } # no_std compatible serde serialization format +postcard = { version = "1.0", features = [ + "alloc", +], default-features = false } # no_std compatible serde serialization format clap = { version = "4.5", features = ["derive"] } # log = "0.4.20" diff --git a/utils/libafl_benches/Cargo.toml b/utils/libafl_benches/Cargo.toml index 77c6dfb595..eb0d3af99d 100644 --- a/utils/libafl_benches/Cargo.toml +++ b/utils/libafl_benches/Cargo.toml @@ -1,5 +1,8 @@ [package] -authors = ["Andrea Fioraldi ", "Dominik Maier "] +authors = [ + "Andrea Fioraldi ", + "Dominik Maier ", +] name = "libafl_benches" version = "0.13.2" edition = "2021" @@ -9,14 +12,23 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "libafl", "benchmarks"] -categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] +categories = [ + "development-tools::testing", + "emulators", + "embedded", + "os", + "no-std", +] [dev-dependencies] criterion = "0.5" # Benchmarking -ahash = { version = "0.8", default-features=false } # The hash function already used in hashbrown -rustc-hash = { version = "1.1", default-features=false } # yet another hash +ahash = { version = "0.8", default-features = false } # The hash function already used in hashbrown +rustc-hash = { version = "1.1", default-features = false } # yet another hash xxhash-rust = { version = "0.8.5", features = ["xxh3"] } # xxh3 hashing for rust -libafl_bolts = { path = "../../libafl_bolts", default-features=false, features = ["xxh3", "alloc"] } # libafl_bolts +libafl_bolts = { path = "../../libafl_bolts", default-features = false, features = [ + "xxh3", + "alloc", +] } # libafl_bolts [[bench]] name = "rand_speeds" @@ -25,4 +37,3 @@ harness = false [[bench]] name = "hash_speeds" harness = false - diff --git a/utils/libafl_fmt/Cargo.toml b/utils/libafl_fmt/Cargo.toml index 63c2de7d49..3b774ca07d 100644 --- a/utils/libafl_fmt/Cargo.toml +++ b/utils/libafl_fmt/Cargo.toml @@ -11,7 +11,12 @@ repository = "https://github.com/AFLplusplus/LibAFL.git" project-root = "0.2" walkdir = "2.5" regex = "1.10" -tokio = { version = "1.38", features = ["process", "rt", "rt-multi-thread", "macros"] } +tokio = { version = "1.38", features = [ + "process", + "rt", + "rt-multi-thread", + "macros", +] } clap = { version = "4.5", features = ["derive"] } exitcode = "1.1" -which = "6.0" \ No newline at end of file +which = "6.0" diff --git a/utils/multi_machine_generator/Cargo.toml b/utils/multi_machine_generator/Cargo.toml index 4f74b845a1..3821b7616c 100644 --- a/utils/multi_machine_generator/Cargo.toml +++ b/utils/multi_machine_generator/Cargo.toml @@ -8,4 +8,4 @@ keywords = ["fuzzing", "testing", "security"] edition = "2021" [dependencies] -petgraph = "0.6" \ No newline at end of file +petgraph = "0.6" diff --git a/utils/noaslr/Cargo.toml b/utils/noaslr/Cargo.toml index ad6c5a6587..93487d48fa 100644 --- a/utils/noaslr/Cargo.toml +++ b/utils/noaslr/Cargo.toml @@ -1,7 +1,3 @@ [workspace] resolver = "2" -members = [ - "noaslr", - "demo", - "libnoaslr" -] +members = ["noaslr", "demo", "libnoaslr"] diff --git a/utils/noaslr/Makefile.toml b/utils/noaslr/Makefile.toml index 25f7859eaa..ce1fed9b66 100644 --- a/utils/noaslr/Makefile.toml +++ b/utils/noaslr/Makefile.toml @@ -2,12 +2,12 @@ default_to_workspace = false [env] -PROFILE="dev" -BUILD_DIR="${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/debug" +PROFILE = "dev" +BUILD_DIR = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/debug" [env.release] -PROFILE="release" -BUILD_DIR="${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/release" +PROFILE = "release" +BUILD_DIR = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/release" [tasks.clean] command = "cargo" @@ -21,68 +21,57 @@ args = ["fmt", "--", "--emit=files"] [tasks.demo] dependencies = ["format", "clippy"] command = "cargo" -args = [ - "build", - "-p", "demo", - "--profile", "${PROFILE}", -] +args = ["build", "-p", "demo", "--profile", "${PROFILE}"] [tasks.run_demo] dependencies = ["demo"] command = "cargo" -args = [ - "run", - "-p", "demo", -] +args = ["run", "-p", "demo"] [tasks.build] dependencies = ["format", "clippy"] command = "cargo" -args = [ - "build", - "-p", "noaslr", - "--profile", "${PROFILE}", -] +args = ["build", "-p", "noaslr", "--profile", "${PROFILE}"] [tasks.buildlib] dependencies = ["format", "clippy"] command = "cargo" -args = [ - "build", - "-p", "libnoaslr", - "--profile", "${PROFILE}", -] +args = ["build", "-p", "libnoaslr", "--profile", "${PROFILE}"] [tasks.run] command = "cargo" -dependencies = [ "demo" ] -env = { "ZZZ_TEST_ZZZ" = "ZZZ TEST ZZZ"} +dependencies = ["demo"] +env = { "ZZZ_TEST_ZZZ" = "ZZZ TEST ZZZ" } args = [ "run", - "-p", "noaslr", - "--profile", "${PROFILE}", + "-p", + "noaslr", + "--profile", + "${PROFILE}", "--", - "${BUILD_DIR}/demo", - "--", - "-f", - "/proc/self/maps", - "--", - "test" + "${BUILD_DIR}/demo", + "--", + "-f", + "/proc/self/maps", + "--", + "test", ] [tasks.runlib] command = "cargo" -dependencies = [ "demo", "buildlib" ] -env = { "LD_PRELOAD" = "${BUILD_DIR}/libnoaslr.so", "ZZZ_TEST_ZZZ" = "ZZZ TEST ZZZ"} +dependencies = ["demo", "buildlib"] +env = { "LD_PRELOAD" = "${BUILD_DIR}/libnoaslr.so", "ZZZ_TEST_ZZZ" = "ZZZ TEST ZZZ" } args = [ "run", - "-p", "demo", - "--profile", "${PROFILE}", + "-p", + "demo", + "--profile", + "${PROFILE}", "--", - "-f", - "/proc/self/maps", - "--", - "test" + "-f", + "/proc/self/maps", + "--", + "test", ] [tasks.all] diff --git a/utils/noaslr/demo/Cargo.toml b/utils/noaslr/demo/Cargo.toml index 53e616afb2..e8ad7e1ca6 100644 --- a/utils/noaslr/demo/Cargo.toml +++ b/utils/noaslr/demo/Cargo.toml @@ -4,9 +4,21 @@ version = "0.13.2" edition = "2021" [build-dependencies] -vergen = { version = "8.1.1", features = ["build", "cargo", "git", "gitcl", "rustc", "si"] } +vergen = { version = "8.1.1", features = [ + "build", + "cargo", + "git", + "gitcl", + "rustc", + "si", +] } [dependencies] anyhow = { version = "1.0", default-features = false } -clap = { version = "4.5", default-features = false, features = ["derive", "string", "std", "help"] } +clap = { version = "4.5", default-features = false, features = [ + "derive", + "string", + "std", + "help", +] } readonly = { version = "0.2.8", default-features = false } diff --git a/utils/noaslr/libnoaslr/Cargo.toml b/utils/noaslr/libnoaslr/Cargo.toml index 31012c96c4..ad39b272ca 100644 --- a/utils/noaslr/libnoaslr/Cargo.toml +++ b/utils/noaslr/libnoaslr/Cargo.toml @@ -13,7 +13,10 @@ crate-type = ["dylib"] [dependencies] anyhow = { version = "1.0", default-features = false } ctor = { version = "0.2", default-features = false } -nix = { version = "0.29", default-features = false, features = ["process", "personality"] } +nix = { version = "0.29", default-features = false, features = [ + "process", + "personality", +] } [target.'cfg(any(target_os = "freebsd", target_os = "netbsd"))'.dependencies] -libc = "0.2" +libc = "0.2" diff --git a/utils/noaslr/noaslr/Cargo.toml b/utils/noaslr/noaslr/Cargo.toml index 6373d58e41..5d93a77f5c 100644 --- a/utils/noaslr/noaslr/Cargo.toml +++ b/utils/noaslr/noaslr/Cargo.toml @@ -4,13 +4,31 @@ version = "0.13.2" edition = "2021" [build-dependencies] -vergen = { version = "8.1.1", features = ["build", "cargo", "git", "gitcl", "rustc", "si"] } +vergen = { version = "8.1.1", features = [ + "build", + "cargo", + "git", + "gitcl", + "rustc", + "si", +] } [dependencies] anyhow = { version = "1.0", default-features = false } -clap = { version = "4.5", default-features = false, features = ["derive", "string", "std", "help", "derive", "error-context", "usage"] } +clap = { version = "4.5", default-features = false, features = [ + "derive", + "string", + "std", + "help", + "derive", + "error-context", + "usage", +] } log = { version = "0.4", default-features = false } -nix = { version = "0.29", default-features = false, features = ["process", "personality"] } +nix = { version = "0.29", default-features = false, features = [ + "process", + "personality", +] } readonly = { version = "0.2.8", default-features = false } simplelog = { version = "0.12.1", default-features = false }