From d5db2c0e3fa7e109a8ea42211e2d5cb861952c28 Mon Sep 17 00:00:00 2001 From: "Dongjia \"toka\" Zhang" Date: Wed, 13 Nov 2024 02:55:02 +0100 Subject: [PATCH] LibAFL: Remove `tui_monitor` from default features (#2685) * No Usermode default * no tui * gg * try fix CI * fmt --------- Co-authored-by: Dominik Maier --- fuzzers/baby/baby_fuzzer/Cargo.toml | 2 +- fuzzers/baby/baby_fuzzer_swap_differential/Cargo.toml | 2 +- fuzzers/baby/baby_fuzzer_unicode/Cargo.toml | 2 +- fuzzers/binary_only/qemu_launcher/Cargo.toml | 2 +- fuzzers/full_system/nyx_libxml2_standalone/Cargo.toml | 2 +- fuzzers/structure_aware/baby_fuzzer_multi/Cargo.toml | 5 ++++- libafl/Cargo.toml | 1 - libafl_nyx/src/helper.rs | 8 +++++++- utils/cfg_builder/build.py | 1 - utils/gramatron/construct_automata.py | 2 -- 10 files changed, 16 insertions(+), 11 deletions(-) diff --git a/fuzzers/baby/baby_fuzzer/Cargo.toml b/fuzzers/baby/baby_fuzzer/Cargo.toml index ca3931fed3..f67c2c3ac0 100644 --- a/fuzzers/baby/baby_fuzzer/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer/Cargo.toml @@ -23,6 +23,6 @@ opt-level = 3 debug = true [dependencies] -libafl = { path = "../../../libafl" } +libafl = { path = "../../../libafl", features = ["tui_monitor"] } libafl_bolts = { path = "../../../libafl_bolts" } log = { version = "0.4.22", features = ["release_max_level_info"] } diff --git a/fuzzers/baby/baby_fuzzer_swap_differential/Cargo.toml b/fuzzers/baby/baby_fuzzer_swap_differential/Cargo.toml index a9f50b37b5..564ce6a315 100644 --- a/fuzzers/baby/baby_fuzzer_swap_differential/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer_swap_differential/Cargo.toml @@ -25,7 +25,7 @@ bindgen = "0.70.1" cc = "1.1.21" [dependencies] -libafl = { path = "../../../libafl" } +libafl = { path = "../../../libafl", features = ["tui_monitor"] } libafl_bolts = { path = "../../../libafl_bolts" } libafl_targets = { path = "../../../libafl_targets", features = [ "sancov_pcguard_hitcounts", diff --git a/fuzzers/baby/baby_fuzzer_unicode/Cargo.toml b/fuzzers/baby/baby_fuzzer_unicode/Cargo.toml index 2a7df6f019..61a1366659 100644 --- a/fuzzers/baby/baby_fuzzer_unicode/Cargo.toml +++ b/fuzzers/baby/baby_fuzzer_unicode/Cargo.toml @@ -23,6 +23,6 @@ opt-level = 3 debug = true [dependencies] -libafl = { path = "../../../libafl", features = ["unicode"] } +libafl = { path = "../../../libafl", features = ["unicode", "tui_monitor"] } libafl_bolts = { path = "../../../libafl_bolts" } log = { version = "0.4.22", features = ["release_max_level_info"] } diff --git a/fuzzers/binary_only/qemu_launcher/Cargo.toml b/fuzzers/binary_only/qemu_launcher/Cargo.toml index e49f9d227a..2e466a0f8c 100644 --- a/fuzzers/binary_only/qemu_launcher/Cargo.toml +++ b/fuzzers/binary_only/qemu_launcher/Cargo.toml @@ -42,7 +42,7 @@ vergen-git2 = "1.0.1" [dependencies] clap = { version = "4.5.18", features = ["derive", "string"] } -libafl = { path = "../../../libafl" } +libafl = { path = "../../../libafl", features = ["tui_monitor"] } libafl_bolts = { path = "../../../libafl_bolts", features = [ "errors_backtrace", ] } diff --git a/fuzzers/full_system/nyx_libxml2_standalone/Cargo.toml b/fuzzers/full_system/nyx_libxml2_standalone/Cargo.toml index e09c4e39bf..6a8716c134 100644 --- a/fuzzers/full_system/nyx_libxml2_standalone/Cargo.toml +++ b/fuzzers/full_system/nyx_libxml2_standalone/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" default-run = "nyx_libxml2_standalone" [dependencies] -libafl = { path = "../../../libafl" } +libafl = { path = "../../../libafl", features = ["tui_monitor"] } libafl_bolts = { path = "../../../libafl_bolts" } libafl_cc = { path = "../../../libafl_cc" } libafl_nyx = { path = "../../../libafl_nyx" } diff --git a/fuzzers/structure_aware/baby_fuzzer_multi/Cargo.toml b/fuzzers/structure_aware/baby_fuzzer_multi/Cargo.toml index b51ebf91bb..c349257686 100644 --- a/fuzzers/structure_aware/baby_fuzzer_multi/Cargo.toml +++ b/fuzzers/structure_aware/baby_fuzzer_multi/Cargo.toml @@ -24,6 +24,9 @@ opt-level = 3 debug = true [dependencies] -libafl = { path = "../../../libafl", features = ["multipart_inputs"] } +libafl = { path = "../../../libafl", features = [ + "multipart_inputs", + "tui_monitor", +] } libafl_bolts = { path = "../../../libafl_bolts" } log = { version = "0.4.22", features = ["release_max_level_info"] } diff --git a/libafl/Cargo.toml b/libafl/Cargo.toml index 4ac7f1a17f..f9498a3423 100644 --- a/libafl/Cargo.toml +++ b/libafl/Cargo.toml @@ -37,7 +37,6 @@ default = [ "gzip", "regex", "serdeany_autoreg", - "tui_monitor", "libafl_bolts/xxh3", ] document-features = ["dep:document-features"] diff --git a/libafl_nyx/src/helper.rs b/libafl_nyx/src/helper.rs index 40dd454d99..46673725be 100644 --- a/libafl_nyx/src/helper.rs +++ b/libafl_nyx/src/helper.rs @@ -71,7 +71,13 @@ impl NyxHelper { let mut timeout = Duration::from_secs(u64::from(settings.timeout_secs)); timeout += Duration::from_micros(u64::from(settings.timeout_micro_secs)); - Ok(Self { nyx_process, nyx_stdout, timeout, bitmap_size, bitmap_buffer }) + Ok(Self { + nyx_process, + nyx_stdout, + timeout, + bitmap_size, + bitmap_buffer, + }) } /// Set a timeout for Nyx. diff --git a/utils/cfg_builder/build.py b/utils/cfg_builder/build.py index 0d60fb6a55..e4664549e4 100644 --- a/utils/cfg_builder/build.py +++ b/utils/cfg_builder/build.py @@ -32,7 +32,6 @@ for mname, module in cfg.items(): # First, add all the intra-procedural edges for fname, v in module["edges"].items(): - if fname not in fname2id: GG.add_node(f_ids, label=fname) fname2id[fname] = f_ids diff --git a/utils/gramatron/construct_automata.py b/utils/gramatron/construct_automata.py index 126b3f84e8..9f8441b47c 100644 --- a/utils/gramatron/construct_automata.py +++ b/utils/gramatron/construct_automata.py @@ -219,7 +219,6 @@ def postprocess1(): # Cull transitions to states which were not expanded owing to the stack limit if stack_limit: - blocklist = [] for final_state in final: for transition in pda: @@ -287,7 +286,6 @@ def postprocess(): # Cull transitions to states which were not expanded owing to the stack limit if stack_limit: - blocklist = [] for final_state in final: for transition in pda: