Skip to content

Commit

Permalink
Update guided-fuzzing-daemon args
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwartzentruber committed Aug 29, 2024
1 parent 02ddcf7 commit 083fff8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions services/libfuzzer/libfuzzer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,26 +190,26 @@ then
# into a new corpus.

# Generic parameters for S3
S3_PROJECT_ARGS+=(--s3-bucket mozilla-aflfuzz --project "$S3_PROJECT")
S3_PROJECT_ARGS+=(--bucket mozilla-aflfuzz --project "$S3_PROJECT")

# This option ensures that we synchronize local finds from/to S3 queues.
# When generating coverage, it does not make sense to use this.
if [[ -z "$COVERAGE" ]]
then
S3_QUEUE_UPLOAD_ARGS+=(--s3-queue-upload)
S3_QUEUE_UPLOAD_ARGS+=(--queue-upload)
fi

# This can be used to download only a subset of corpus files for fuzzing
CORPUS_DOWNLOAD_ARGS=()
if [[ -n "$S3_CORPUS_SUBSET_SIZE" ]]
then
CORPUS_DOWNLOAD_ARGS+=(--s3-corpus-download-size "$S3_CORPUS_SUBSET_SIZE")
CORPUS_DOWNLOAD_ARGS+=(--corpus-download-size "$S3_CORPUS_SUBSET_SIZE")
fi

if [[ -z "$S3_CORPUS_REFRESH" ]]
then
# Download the corpus from S3
run-afl-libfuzzer-daemon "${CORPUS_DOWNLOAD_ARGS[@]}" "${S3_PROJECT_ARGS[@]}" --s3-corpus-download corpora/
run-afl-libfuzzer-daemon "${CORPUS_DOWNLOAD_ARGS[@]}" "${S3_PROJECT_ARGS[@]}" --corpus-download corpora/
fi
elif [[ -n "$OSSFUZZ_PROJECT" ]]
then
Expand Down Expand Up @@ -335,9 +335,9 @@ then
"${HARNESS_EXT_ARGS[@]}" \
--cmd "$HOME/$TARGET_BIN" "${TARGET_ARGS[@]}" "${LIBFUZZER_ARGS[@]}"
else
update-ec2-status "Starting afl-libfuzzer-daemon with --s3-corpus-refresh" || true
update-ec2-status "Starting afl-libfuzzer-daemon with --corpus-refresh" || true
run-afl-libfuzzer-daemon "${S3_PROJECT_ARGS[@]}" \
--s3-corpus-refresh "$HOME/workspace" \
--corpus-refresh "$HOME/workspace" \
--stats "./stats" \
--libfuzzer \
--build "$(dirname "$HOME/$TARGET_BIN")"
Expand Down
16 changes: 8 additions & 8 deletions services/nyx/launch-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,25 +228,25 @@ DAEMON_ARGS=(
)

S3_PROJECT="${S3_PROJECT-Nyx-$NYX_FUZZER}"
S3_PROJECT_ARGS=(--s3-bucket mozilla-aflfuzz --project "$S3_PROJECT")
S3_PROJECT_ARGS=(--bucket mozilla-aflfuzz --project "$S3_PROJECT")

if [[ -n "$S3_CORPUS_REFRESH" ]]
then
update-status "starting corpus refresh"
if [[ "$NYX_FUZZER" = "IPC_SingleMessage" ]]
then
guided-fuzzing-daemon --s3-list-projects "${S3_PROJECT_ARGS[@]}" | while read -r project
guided-fuzzing-daemon --list-projects "${S3_PROJECT_ARGS[@]}" | while read -r project
do
time guided-fuzzing-daemon \
--s3-bucket mozilla-aflfuzz --project "$project" \
--bucket mozilla-aflfuzz --project "$project" \
--build ./sharedir/firefox \
--s3-corpus-refresh ./corpus \
--corpus-refresh ./corpus \
"${DAEMON_ARGS[@]}"
done
else
time guided-fuzzing-daemon "${S3_PROJECT_ARGS[@]}" \
--build ./sharedir/firefox \
--s3-corpus-refresh ./corpus \
--corpus-refresh ./corpus \
"${DAEMON_ARGS[@]}"
fi
else
Expand All @@ -258,7 +258,7 @@ else
--afl-add-corpus ./corpus.out/workdir/dump/seeds
)
source ./sharedir/config.sh
S3_PROJECT_ARGS=(--s3-bucket mozilla-aflfuzz --project "$S3_PROJECT-${MOZ_FUZZ_IPC_TRIGGER//:/_}")
S3_PROJECT_ARGS=(--bucket mozilla-aflfuzz --project "$S3_PROJECT-${MOZ_FUZZ_IPC_TRIGGER//:/_}")
elif [[ "$NYX_FUZZER" = "IPC_Generic" ]]
then
nyx-ipc-manager --generic --sharedir ./sharedir --file "$NYX_PAGE_HTMLNAME" --file-zip "$NYX_PAGE"
Expand All @@ -279,7 +279,7 @@ else
then
# Download the corpus from S3
update-status "downloading corpus"
time guided-fuzzing-daemon "${S3_PROJECT_ARGS[@]}" --s3-corpus-download ./corpus
time guided-fuzzing-daemon "${S3_PROJECT_ARGS[@]}" --corpus-download ./corpus
else
mkdir -p corpus
fi
Expand All @@ -299,7 +299,7 @@ else
--instances "$NYX_INSTANCES" \
--nyx-log-pattern /logs/nyx%d.log \
--env-percent 75 AFL_CUSTOM_MUTATOR_LIBRARY=/srv/repos/AFLplusplus/custom_mutators/honggfuzz/honggfuzz-2b-chunked-mutator.so \
--s3-queue-upload \
--queue-upload \
--tool "$S3_PROJECT" \
"${DAEMON_ARGS[@]}" \
-i ./corpus \
Expand Down

0 comments on commit 083fff8

Please sign in to comment.