diff --git a/common/src/bin/gen-target-src.rs b/common/src/bin/gen-target-src.rs index 96cb391..7b58c44 100644 --- a/common/src/bin/gen-target-src.rs +++ b/common/src/bin/gen-target-src.rs @@ -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) @@ -39,4 +40,4 @@ fn main() { let source = template.replace("###TARGET###", &target); file.write_all(source.as_bytes()).unwrap(); } -} \ No newline at end of file +} diff --git a/continuous-fuzzing.rb b/continuous-fuzzing.rb new file mode 100755 index 0000000..fbf3fc9 --- /dev/null +++ b/continuous-fuzzing.rb @@ -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 + diff --git a/fuzz-with-honggfuzz.sh b/fuzz-with-honggfuzz.sh index d33c62e..6e7a3bc 100755 --- a/fuzz-with-honggfuzz.sh +++ b/fuzz-with-honggfuzz.sh @@ -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 diff --git a/targets.txt b/targets.txt index ea5093f..07ec4b5 100644 --- a/targets.txt +++ b/targets.txt @@ -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