-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c1e496
commit 7962c61
Showing
3 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,14 +32,34 @@ RUN apt-get update && \ | |
# for QEMU mode | ||
ninja-build \ | ||
gcc-$(gcc --version|head -n1|sed 's/\..*//'|sed 's/.* //')-plugin-dev \ | ||
libstdc++-$(gcc --version|head -n1|sed 's/\..*//'|sed 's/.* //')-dev | ||
libstdc++-$(gcc --version|head -n1|sed 's/\..*//'|sed 's/.* //')-dev \ | ||
lsb-release \ | ||
software-properties-common \ | ||
gnupg | ||
|
||
# Download afl++. | ||
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 15 | ||
RUN apt install llvm-15 | ||
|
||
RUN for llvmbin in $(find $(dirname $(which llvm-link-15)) | grep -- '-15$'); do \ | ||
ln -s "$llvmbin" /usr/local/bin/$(basename "$llvmbin" | rev | cut -d'-' -f2- | rev); \ | ||
done && \ | ||
which llvm-link llvm-dis | ||
|
||
RUN curl -L https://go.dev/dl/go1.23.2.linux-amd64.tar.gz | \ | ||
tar -C /usr/local -xz | ||
|
||
ENV PATH="$PATH:/usr/local/go/bin:/root/go/bin" | ||
|
||
RUN go install github.com/SRI-CSL/gllvm/cmd/[email protected] | ||
|
||
# Download FOX. | ||
RUN git clone -b dev https://github.com/FOX-Fuzz/FOX /afl && \ | ||
cd /afl && \ | ||
git checkout 5265de4e3762c9424127d7278ac55c42dada82ce || \ | ||
true | ||
|
||
COPY --chmod=755 second_stage.sh /second_stage.sh | ||
|
||
# Build without Python support as we don't need it. | ||
# Set AFL_NO_X86 to skip flaky tests. | ||
RUN cd /afl && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# based on targets/mbedtls/build_aflpp.sh from adamstorek/fox: https://github.com/FOX-Fuzz/FOX/blob/main/README_StandAlone.md | ||
|
||
get-bc $FUZZ_TARGET | ||
llvm-dis $FUZZ_TARGET.bc | ||
python /afl/fix_long_fun_name.py $FUZZ_TARGET.ll | ||
mkdir -p cfg_out_$FUZZ_TARGET | ||
cd cfg_out_$FUZZ_TARGET | ||
opt -dot-cfg ../$FUZZ_TARGET\_fix.ll | ||
for f in $(ls -a | grep '^\.*'|grep dot);do mv $f ${f:1};done | ||
cd .. | ||
|
||
python /afl/gen_graph_dev_refactor.py $FUZZ_TARGET\_fix.ll cfg_out_$FUZZ_TARGET $PWD/$FUZZ_TARGET instrument_meta_data |