From 9eca3c58c512211cfa14182b5a2a45929c6d303f Mon Sep 17 00:00:00 2001 From: Riccardo Casatta Date: Fri, 7 Oct 2022 11:56:09 +0200 Subject: [PATCH] Add script to launch fuzzing continuosly --- fuzz/cycle.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 fuzz/cycle.sh diff --git a/fuzz/cycle.sh b/fuzz/cycle.sh new file mode 100755 index 00000000..80bdddf6 --- /dev/null +++ b/fuzz/cycle.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Continuosly cycle over fuzz targets running each for 1 hour. +# It uses chrt SCHED_IDLE so that other process takes priority. +# +# For hfuzz options see https://github.com/google/honggfuzz/blob/master/docs/USAGE.md + +export HFUZZ_BUILD_ARGS='--features honggfuzz_fuzz' + +while : +do + for FILE in fuzz_targets/*; + do + TARGET=$(echo $FILE | cut -c 14- | cut -f 1 -d '.') + + # fuzz for one hour + HFUZZ_RUN_ARGS='--run_time 3600' chrt -i 0 cargo hfuzz run $TARGET + + # minimize the corpus + HFUZZ_RUN_ARGS="-i hfuzz_workspace/$TARGET/input/ -P -M" chrt -i 0 cargo hfuzz run $TARGET + done +done +