From 9a269fa26f216bcbb1bb89f73b7c8b56806d492f Mon Sep 17 00:00:00 2001 From: Kevin Valerio Date: Fri, 30 Aug 2024 16:22:39 +0200 Subject: [PATCH] Dockerfile & Github Action fix for AFL --- .github/workflows/rust.yml | 4 +++- Dockerfile | 6 ++++-- tests/cli_fuzz_integration_test.rs | 1 + tests/shared/mod.rs | 1 - 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1b5e136..83c696b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -37,7 +37,9 @@ jobs: cargo install --force ziggy cargo-afl honggfuzz grcov cargo-contract - name: Run afl-system-config - run: sudo cargo-afl afl system-config + run: | + curl https://raw.githubusercontent.com/AFLplusplus/AFLplusplus/stable/afl-system-config > afl-system-config.sh + chmod +x afl-system-config.sh && bash afl-system-config.sh - name: Run rustfmt checks run: cargo fmt -- --check diff --git a/Dockerfile b/Dockerfile index 67be115..e2121a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,10 +31,12 @@ RUN rustup default nightly-2024-08-13 \ WORKDIR /phink RUN git clone https://github.com/srlabs/phink . \ && cargo update \ - && cargo afl config --build --plugins --verbose --force \ && cargo build --release -RUN cargo afl system-config +RUN cargo afl config --build --plugins --verbose --force + +RUN curl https://raw.githubusercontent.com/AFLplusplus/AFLplusplus/stable/afl-system-config > afl-system-config.sh +RUN chmod +x afl-system-config.sh && bash afl-system-config.sh ENTRYPOINT ["phink"] diff --git a/tests/cli_fuzz_integration_test.rs b/tests/cli_fuzz_integration_test.rs index 65781e4..8e0c35a 100644 --- a/tests/cli_fuzz_integration_test.rs +++ b/tests/cli_fuzz_integration_test.rs @@ -74,6 +74,7 @@ mod tests { afl_log_didnt_fail(&config), "'logs/afl.log' didn't return a successfull backlog " ); + // We don't use allowlist for macos if cfg!(not(target_os = "macos")) { ensure!( diff --git a/tests/shared/mod.rs b/tests/shared/mod.rs index 159e952..d44fc14 100644 --- a/tests/shared/mod.rs +++ b/tests/shared/mod.rs @@ -16,7 +16,6 @@ use std::{ collections::HashSet, ffi::OsStr, fs, - io, io::Read, path::{ Path,