From 5df130188a1595d92309fff264f2158894189dec Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Tue, 29 Mar 2022 14:57:38 +0200 Subject: [PATCH] Fixing CI from #559 (#580) * updated ref * update symcc * updated symcc * CI for symcc * updated symcc * enabling git * add runtime deps to makefile * only linux Co-authored-by: tokatoka --- .../Makefile.toml | 52 +++++++++++++++++++ .../fuzzer/src/main.rs | 14 ++--- fuzzers/qemu_launcher/.gitignore | 3 +- libafl_concolic/symcc_libafl/README.md | 4 +- libafl_concolic/symcc_libafl/src/lib.rs | 2 +- libafl_concolic/symcc_runtime/symcc | 2 +- libafl_concolic/test/smoke_test.sh | 2 +- scripts/test_all_fuzzers.sh | 8 ++- 8 files changed, 69 insertions(+), 18 deletions(-) create mode 100644 fuzzers/libfuzzer_stb_image_concolic/Makefile.toml diff --git a/fuzzers/libfuzzer_stb_image_concolic/Makefile.toml b/fuzzers/libfuzzer_stb_image_concolic/Makefile.toml new file mode 100644 index 0000000000..a595a325b0 --- /dev/null +++ b/fuzzers/libfuzzer_stb_image_concolic/Makefile.toml @@ -0,0 +1,52 @@ +# Variables +[env] +FUZZER_NAME='libfuzzer_stb_image_concolic' + +# Compilers +[tasks.runtime] +linux_alias = "runtime_unix" +mac_alias = "unsupported" +windows_alias = "unsupported" + +[tasks.runtime_unix] +condition = { files_not_exist = ["runtime/target/libSymRuntime.so"] } +script_runner = "@shell" +script = ''' +cd runtime +cargo build --release +''' + +# Build the fuzzer +[tasks.fuzzer] +linux_alias = "fuzzer_unix" +mac_alias = "unsupported" +windows_alias = "unsupported" + +[tasks.fuzzer_unix] +dependencies = ["runtime"] +script_runner = "@shell" +script = ''' +cd fuzzer +cargo build --release +''' + +[tasks.test] +alias = "fuzzer" + +[tasks.unsupported] +# Do nothing +script_runner = "@shell" +script=''' +echo "Not supported on this platform." +''' + +# Clean up +[tasks.clean] +# Disable default `clean` definition +clear = true +script=''' +cd fuzzer +cargo clean +cd ../runtime +cargo clean +''' \ No newline at end of file diff --git a/fuzzers/libfuzzer_stb_image_concolic/fuzzer/src/main.rs b/fuzzers/libfuzzer_stb_image_concolic/fuzzer/src/main.rs index b542fddba6..5bee33261e 100644 --- a/fuzzers/libfuzzer_stb_image_concolic/fuzzer/src/main.rs +++ b/fuzzers/libfuzzer_stb_image_concolic/fuzzer/src/main.rs @@ -5,7 +5,11 @@ use mimalloc::MiMalloc; static GLOBAL: MiMalloc = MiMalloc; use clap::{self, StructOpt}; -use std::{env, path::PathBuf}; +use std::{ + env, + path::PathBuf, + process::{Child, Command, Stdio}, +}; use libafl::{ bolts::{ @@ -146,7 +150,7 @@ fn fuzz( println!("We're a client, let's fuzz :)"); // A minimization+queue policy to get testcasess from the corpus - let scheduler = IndexesLenTimeMinimizerScheduler::new(QueueScheduler::new()); + let scheduler = IndexesLenTimeMinimizerScheduler::new(PowerQueueScheduler::new()); // A fuzzer with feedbacks and a corpus scheduler let mut fuzzer = StdFuzzer::new(scheduler, feedback, objective); @@ -240,12 +244,8 @@ fn fuzz( Ok(()) } -use std::process::{Child, Command, Stdio}; - #[derive(Default, Debug)] -pub struct MyCommandConfigurator { - command: Option, -} +pub struct MyCommandConfigurator; impl CommandConfigurator for MyCommandConfigurator { fn spawn_child(&mut self, input: &I) -> Result { diff --git a/fuzzers/qemu_launcher/.gitignore b/fuzzers/qemu_launcher/.gitignore index a977a2ca5b..3a41173162 100644 --- a/fuzzers/qemu_launcher/.gitignore +++ b/fuzzers/qemu_launcher/.gitignore @@ -1 +1,2 @@ -libpng-* \ No newline at end of file +libpng-* +libpng_harness diff --git a/libafl_concolic/symcc_libafl/README.md b/libafl_concolic/symcc_libafl/README.md index b791118803..997785d68f 100644 --- a/libafl_concolic/symcc_libafl/README.md +++ b/libafl_concolic/symcc_libafl/README.md @@ -1,5 +1,5 @@ This is a support crate for [symcc_runtime](https://crates.io/crates/symcc_runtime). -It defines a stable URL and commit hash for th [LibAFL](https://github.com/AFLplusplus/LibAFL) [fork](https://github.com/AFLplusplus/symcc) of [SymCC](https://github.com/eurecom-s3/symcc). -It also provides convenient methods to clone and build SymCC to be used in build scripts in LibAFL based fuzzers. +It defines a stable URL and commit hash for the [LibAFL](https://github.com/AFLplusplus/LibAFL) [fork](https://github.com/AFLplusplus/symcc) of [SymCC](https://github.com/eurecom-s3/symcc). +It also provides convenient methods to clone and build SymCC to be used in build scripts in LibAFL-based fuzzers. [Documentation](https://docs.rs/symcc_libafl) \ No newline at end of file diff --git a/libafl_concolic/symcc_libafl/src/lib.rs b/libafl_concolic/symcc_libafl/src/lib.rs index 697fba0ced..b29be4f93e 100644 --- a/libafl_concolic/symcc_libafl/src/lib.rs +++ b/libafl_concolic/symcc_libafl/src/lib.rs @@ -4,7 +4,7 @@ /// The URL of the `LibAFL` `SymCC` fork. pub const SYMCC_REPO_URL: &str = "https://github.com/AFLplusplus/symcc.git"; /// The commit of the `LibAFL` `SymCC` fork. -pub const SYMCC_REPO_COMMIT: &str = "45cde0269ae22aef4cca2e1fb98c3b24f7bb2984"; +pub const SYMCC_REPO_COMMIT: &str = "5cccc33456c48ad83008eb618e7da5d005c72d89"; #[cfg(feature = "clone")] mod clone { diff --git a/libafl_concolic/symcc_runtime/symcc b/libafl_concolic/symcc_runtime/symcc index 45cde0269a..5cccc33456 160000 --- a/libafl_concolic/symcc_runtime/symcc +++ b/libafl_concolic/symcc_runtime/symcc @@ -1 +1 @@ -Subproject commit 45cde0269ae22aef4cca2e1fb98c3b24f7bb2984 +Subproject commit 5cccc33456c48ad83008eb618e7da5d005c72d89 diff --git a/libafl_concolic/test/smoke_test.sh b/libafl_concolic/test/smoke_test.sh index 999d1688df..1d4eb08977 100755 --- a/libafl_concolic/test/smoke_test.sh +++ b/libafl_concolic/test/smoke_test.sh @@ -16,7 +16,7 @@ if [ ! -d "symcc" ]; then echo "cloning symcc" git clone https://github.com/AFLplusplus/symcc.git symcc cd symcc - git checkout 45cde0269ae22aef4cca2e1fb98c3b24f7bb2984 + git checkout 5cccc33456c48ad83008eb618e7da5d005c72d89 cd .. fi diff --git a/scripts/test_all_fuzzers.sh b/scripts/test_all_fuzzers.sh index 1ef1160733..b7e361e94a 100755 --- a/scripts/test_all_fuzzers.sh +++ b/scripts/test_all_fuzzers.sh @@ -7,14 +7,12 @@ cd "$SCRIPT_DIR/.." fuzzers=$(find ./fuzzers -maxdepth 1 -type d) backtrace_fuzzers=$(find ./fuzzers/backtrace_baby_fuzzers -maxdepth 1 -type d) -extra_fuzzer_and_runtime=" -./fuzzers/libfuzzer_stb_image_concolic/runtime -./fuzzers/libfuzzer_stb_image_concolic/fuzzer -" libafl=$(pwd) -for fuzzer in $(echo $fuzzers $backtrace_fuzzers $extra_fuzzer_and_runtime); +git submodule init && git submodule update + +for fuzzer in $(echo $fuzzers $backtrace_fuzzers); do cd $fuzzer # Clippy checks