Skip to content

Commit

Permalink
Add continuous fuzzing script for libFuzzer
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulGrandperrin committed Apr 24, 2018
1 parent 384f25a commit acbdac8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
end

loop do
system 'cd fuzzer-honggfuzz; cargo update'

File.open("targets.txt").each do |line|
target, weight = line.split
time = weight.to_i * time_mul.to_i

system "HFUZZ_RUN_ARGS=\"--run_time #{time} $HFUZZ_RUN_ARGS\" ./fuzz-with-honggfuzz.sh #{target}"
end

system 'cd fuzzer-honggfuzz; cargo update'
end

19 changes: 19 additions & 0 deletions continuous-fuzzing-with-libfuzzer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env ruby

if ARGV.size >= 1
time_mul = ARGV[0]
else
time_mul = 10
end

loop do
File.open("targets.txt").each do |line|
target, weight = line.split
time = weight.to_i * time_mul.to_i

system "LIBFUZZER_ARGS=\"-max_total_time=#{time} $LIBFUZZER_ARGS\" ./fuzz-with-libfuzzer.sh #{target}"
end

system 'cd fuzzer-libfuzzer; cargo update'
end

2 changes: 1 addition & 1 deletion fuzz-with-libfuzzer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ else
fi

mkdir -p "corpus-$1"
cargo run --target $TARGET --bin "$1" -- "corpus-$1" $SEEDS
cargo run --target $TARGET --bin "$1" -- "corpus-$1" $SEEDS $LIBFUZZER_ARGS

0 comments on commit acbdac8

Please sign in to comment.