Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suricata: adds quadfuzz #11034

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions projects/suricata/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ADD https://www.tcpdump.org/release/libpcap-1.9.1.tar.gz libpcap-1.9.1.tar.gz
ADD http://www.digip.org/jansson/releases/jansson-2.12.tar.gz jansson-2.12.tar.gz
RUN git clone --depth=1 https://github.com/yaml/libyaml
ADD https://github.com/lz4/lz4/archive/v1.9.2.tar.gz lz4-1.9.2.tar.gz
RUN git clone --depth 1 https://github.com/catenacyber/quadfuzz.git
RUN git clone --depth 1 -b develop https://github.com/madler/zlib.git
RUN git clone --depth=1 https://github.com/catenacyber/fuzzpcap

Expand Down
8 changes: 8 additions & 0 deletions projects/suricata/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ then
fuzz_branches+=("6")
fi

if [[ `shuf -i 0-9 -n 1` -eq 0 ]]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a better way such as an environment variable ? cc @alan32liu

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe try CFLAGS and CXXFLAGS?
Here is a similar example.

Adding it to LIB_FUZZING_ENGINE is indeed too hacky.

then
# adds quadratic complexity custom mutator one random build out of 10
clang -fPIE -I. -c $SRC/quadfuzz/quadfuzz.c -o $SRC/quadfuzz/quadfuzz.o
export LIB_FUZZING_ENGINE="-fsanitize=fuzzer $SRC/quadfuzz/quadfuzz.o"
echo "Using quadfuzz"
fi

for branch in "${fuzz_branches[@]}"; do
#we did not put libhtp there before so that cifuzz does not remove it
cp -r libhtp suricata$branch/
Expand Down
Loading