Skip to content

Commit

Permalink
Add continuous fuzzing script
Browse files Browse the repository at this point in the history
closes #73
  • Loading branch information
PaulGrandperrin committed Apr 24, 2018
1 parent 73b4e0d commit 384f25a
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 62 deletions.
3 changes: 2 additions & 1 deletion common/src/bin/gen-target-src.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fn main() {

for target in BufReader::new(targets_file).lines() {
let target = target.unwrap();
let target = target.split_whitespace().next().unwrap();
let path = format!("{}/{}.rs", out_path, target);
let mut file = OpenOptions::new()
.write(true)
Expand All @@ -39,4 +40,4 @@ fn main() {
let source = template.replace("###TARGET###", &target);
file.write_all(source.as_bytes()).unwrap();
}
}
}
19 changes: 19 additions & 0 deletions continuous-fuzzing.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
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
end

2 changes: 1 addition & 1 deletion fuzz-with-honggfuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
cd fuzzer-honggfuzz

if [ -d "../common/seeds/$1" ]; then
export HFUZZ_RUN_ARGS="-f ../common/seeds/$1 --covdir_all hfuzz_workspace/$1/input"
export HFUZZ_RUN_ARGS="-f ../common/seeds/$1 --covdir_all hfuzz_workspace/$1/input $HFUZZ_RUN_ARGS"
fi

cargo hfuzz run $1
120 changes: 60 additions & 60 deletions targets.txt
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
brotli_read
bson_read
chrono_read
crypto_hashes_blake2b
crypto_hashes_blake2s
crypto_hashes_gost94
crypto_hashes_md2
crypto_hashes_md4
crypto_hashes_md5
crypto_hashes_ripemd160
crypto_hashes_sha1
crypto_hashes_sha2_256
crypto_hashes_sha2_512
crypto_hashes_sha3_512
crypto_hashes_sha3_keccak512
crypto_hashes_sha3_shake256
crypto_hashes_streebog_256
crypto_hashes_streebog_512
crypto_hashes_whirlpool
css_parser_read
css_parser_read_write_read
deflate_compress
dns_parser_read_paquet
flac_read
gif_read
html5ever_read
httparse_request
httparse_response
humantime_read
image_read
iso8601_read
jpeg_decoder_read
minidump_read
mp4parse_read
patch_read
pikkr_read
png_read
png_read_write_read
proc_macro2_read
pulldown_cmark_read
quick_xml_read
regex_is_match
ring_digest_sha1
ring_digest_sha256
ring_digest_sha384
ring_digest_sha512
semver_read_write_read
semver_req_read_write_read
serde_json_read
serde_json_read_write_read
serde_yaml_read
serde_yaml_read_write_read
tar_read
tar_roundtrip
toml_roundtrip
url_read
uuid_read
xml_read
zip_read
zopfli_compress
brotli_read 1
bson_read 1
chrono_read 1
crypto_hashes_blake2b 1
crypto_hashes_blake2s 1
crypto_hashes_gost94 1
crypto_hashes_md2 1
crypto_hashes_md4 1
crypto_hashes_md5 1
crypto_hashes_ripemd160 1
crypto_hashes_sha1 1
crypto_hashes_sha2_256 1
crypto_hashes_sha2_512 1
crypto_hashes_sha3_512 1
crypto_hashes_sha3_keccak512 1
crypto_hashes_sha3_shake256 1
crypto_hashes_streebog_256 1
crypto_hashes_streebog_512 1
crypto_hashes_whirlpool 1
css_parser_read 1
css_parser_read_write_read 1
deflate_compress 1
dns_parser_read_paquet 1
flac_read 1
gif_read 1
html5ever_read 1
httparse_request 1
httparse_response 1
humantime_read 1
image_read 1
iso8601_read 1
jpeg_decoder_read 1
minidump_read 1
mp4parse_read 1
patch_read 1
pikkr_read 1
png_read 1
png_read_write_read 1
proc_macro2_read 1
pulldown_cmark_read 1
quick_xml_read 1
regex_is_match 1
ring_digest_sha1 1
ring_digest_sha256 1
ring_digest_sha384 1
ring_digest_sha512 1
semver_read_write_read 1
semver_req_read_write_read 1
serde_json_read 1
serde_json_read_write_read 1
serde_yaml_read 1
serde_yaml_read_write_read 1
tar_read 1
tar_roundtrip 1
toml_roundtrip 1
url_read 1
uuid_read 1
xml_read 1
zip_read 1
zopfli_compress 1

0 comments on commit 384f25a

Please sign in to comment.