From 93eb6024f41e00aec2535c4e6056e83902088305 Mon Sep 17 00:00:00 2001 From: Abhishek Arya Date: Sun, 31 Jan 2021 10:48:04 -0800 Subject: Add AFL_MAP_SIZE in run_fuzzer Otherwise get errors like these for libsass. [+] All right - fork server is up.  [-] PROGRAM ABORT : AFL_MAP_SIZE is not set and fuzzing target reports that the required size is very large. Solution: Run the fuzzing target stand-alone with the environment variable AFL_DEBUG=1 set and set the value for __afl_final_loc in the AFL_MAP_SIZE environment variable for afl-fuzz. Location : report_error_and_exit(), src/afl-forkserver.c:321 --- infra/base-images/base-runner/run_fuzzer | 1 + 1 file changed, 1 insertion(+) (limited to 'infra/base-images') diff --git a/infra/base-images/base-runner/run_fuzzer b/infra/base-images/base-runner/run_fuzzer index 2b791aab..d61c299b 100755 --- a/infra/base-images/base-runner/run_fuzzer +++ b/infra/base-images/base-runner/run_fuzzer @@ -103,6 +103,7 @@ if [[ "$FUZZING_ENGINE" = afl ]]; then export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 export AFL_SKIP_CPUFREQ=1 export AFL_NO_AFFINITY=1 + export AFL_MAP_SIZE=4194304 # AFL expects at least 1 file in the input dir. echo input > ${CORPUS_DIR}/input CMD_LINE="$OUT/afl-fuzz $AFL_FUZZER_ARGS -i $CORPUS_DIR -o $FUZZER_OUT $(get_dictionary) $* $OUT/$FUZZER" -- cgit v1.2.3