diff options
author | matt-kwong <mattkwong@google.com> | 2017-02-15 10:49:23 -0800 |
---|---|---|
committer | Abhishek Arya <inferno@chromium.org> | 2017-02-15 10:49:23 -0800 |
commit | 2d1135523aaa90b654da608b8ab52757449c177d (patch) | |
tree | 68d385c6c9ab8a155fb06fe61ac65bfb73e71291 /projects/grpc | |
parent | 69b9b7033f6d0ecbeed387580419d8b270105e8e (diff) |
Add options, dictionaries, and seed corpuses to gRPC (#390)
* Add seed corpuses to gRPC project
* Add options for gRPC fuzzers
Diffstat (limited to 'projects/grpc')
-rw-r--r-- | projects/grpc/Dockerfile | 2 | ||||
-rw-r--r-- | projects/grpc/api_fuzzer.options | 3 | ||||
-rwxr-xr-x | projects/grpc/build.sh | 34 | ||||
-rw-r--r-- | projects/grpc/client_fuzzer.options | 3 | ||||
-rw-r--r-- | projects/grpc/fuzzer.options | 2 | ||||
-rw-r--r-- | projects/grpc/fuzzer_response.options | 2 | ||||
-rw-r--r-- | projects/grpc/fuzzer_serverlist.options | 2 | ||||
-rw-r--r-- | projects/grpc/hpack_parser_fuzzer_test.options | 3 | ||||
-rw-r--r-- | projects/grpc/percent_decode_fuzzer.options | 2 | ||||
-rw-r--r-- | projects/grpc/percent_encode_fuzzer.options | 2 | ||||
-rw-r--r-- | projects/grpc/request_fuzzer.options | 3 | ||||
-rw-r--r-- | projects/grpc/response_fuzzer.options | 3 | ||||
-rw-r--r-- | projects/grpc/server_fuzzer.options | 3 | ||||
-rw-r--r-- | projects/grpc/ssl_server_fuzzer.options | 2 | ||||
-rw-r--r-- | projects/grpc/uri_fuzzer_test.options | 2 |
15 files changed, 65 insertions, 3 deletions
diff --git a/projects/grpc/Dockerfile b/projects/grpc/Dockerfile index bf9eba4d..274f0df2 100644 --- a/projects/grpc/Dockerfile +++ b/projects/grpc/Dockerfile @@ -36,4 +36,4 @@ RUN apt-get update && apt-get install -y bazel RUN git clone --recursive https://github.com/grpc/grpc grpc WORKDIR /src/grpc/ -COPY build.sh $SRC/ +COPY build.sh *.options $SRC/ diff --git a/projects/grpc/api_fuzzer.options b/projects/grpc/api_fuzzer.options new file mode 100644 index 00000000..8871ae21 --- /dev/null +++ b/projects/grpc/api_fuzzer.options @@ -0,0 +1,3 @@ +[libfuzzer] +max_len = 2048 +dict = api_fuzzer.dictionary diff --git a/projects/grpc/build.sh b/projects/grpc/build.sh index b7ffe78d..69f9489b 100755 --- a/projects/grpc/build.sh +++ b/projects/grpc/build.sh @@ -16,7 +16,6 @@ ################################################################################ FUZZER_FILES="\ -test/core/end2end/fuzzers/api_fuzzer.c \ test/core/json/fuzzer.c \ test/core/client_channel/uri_fuzzer_test.c \ test/core/http/request_fuzzer.c \ @@ -26,9 +25,16 @@ test/core/nanopb/fuzzer_serverlist.c \ test/core/slice/percent_decode_fuzzer.c \ test/core/slice/percent_encode_fuzzer.c \ test/core/transport/chttp2/hpack_parser_fuzzer_test.c \ +test/core/end2end/fuzzers/api_fuzzer.c \ test/core/end2end/fuzzers/client_fuzzer.c \ test/core/end2end/fuzzers/server_fuzzer.c \ -test/core/security/ssl_server_fuzzer.c \ +" +# TODO: enable ssl server corpus after Bazel fuzzer rules written +# test/core/security/ssl_server_fuzzer.c \ + +FUZZER_DICTIONARIES="\ +test/core/end2end/fuzzers/api_fuzzer.dictionary \ +test/core/end2end/fuzzers/hpack.dictionary \ " FUZZER_LIBRARIES="\ @@ -64,3 +70,27 @@ for file in $FUZZER_FILES; do $fuzzer_object -o $OUT/$fuzzer_name \ -lFuzzingEngine ${FUZZER_LIBRARIES} done + +# Copy dictionaries and options files to $OUT/ +for dict in $FUZZER_DICTIONARIES; do + cp $dict $OUT/ +done + +cp $SRC/*.options $OUT/ + +# We don't have a consistent naming convention between fuzzer files and corpus +# directories so we resort to hard coding zipping corpuses +zip $OUT/fuzzer_seed_corpus.zip test/core/json/corpus +zip $OUT/uri_fuzzer_test_seed_corpus.zip test/core/client_channel/uri_corpus +zip $OUT/request_fuzzer_seed_corpus.zip test/core/http/request_corpus +zip $OUT/response_fuzzer_seed_corpus.zip test/core/http/response_corpus +zip $OUT/fuzzer_response_seed_corpus.zip test/core/nanopb/corpus_response +zip $OUT/fuzzer_serverlist_seed_corpus.zip test/core/nanopb/corpus_serverlist +zip $OUT/percent_decode_fuzzer_seed_corpus.zip test/core/slice/percent_decode_corpus +zip $OUT/percent_encode_fuzzer_seed_corpus.zip test/core/slice/percent_encode_corpus +zip $OUT/hpack_parser_fuzzer_test_seed_corpus.zip test/core/transport/chttp2/hpack_parser_corpus +zip $OUT/api_fuzzer_seed_corpus.zip test/core/end2end/fuzzers/api_fuzzer_corpus +zip $OUT/client_fuzzer_seed_corpus.zip test/core/end2end/fuzzers/client_fuzzer_corpus +zip $OUT/server_fuzzer_seed_corpus.zip test/core/end2end/fuzzers/server_fuzzer_corpus +# TODO: zip ssl server corpus after Bazel fuzzer rules written +# test/core/security/corpus/ssl_server_corpus diff --git a/projects/grpc/client_fuzzer.options b/projects/grpc/client_fuzzer.options new file mode 100644 index 00000000..fd2eebf7 --- /dev/null +++ b/projects/grpc/client_fuzzer.options @@ -0,0 +1,3 @@ +[libfuzzer] +max_len = 2048 +dict = hpack.dictionary diff --git a/projects/grpc/fuzzer.options b/projects/grpc/fuzzer.options new file mode 100644 index 00000000..5d468bc6 --- /dev/null +++ b/projects/grpc/fuzzer.options @@ -0,0 +1,2 @@ +[libfuzzer] +max_len = 512 diff --git a/projects/grpc/fuzzer_response.options b/projects/grpc/fuzzer_response.options new file mode 100644 index 00000000..5dcdfac7 --- /dev/null +++ b/projects/grpc/fuzzer_response.options @@ -0,0 +1,2 @@ +[libfuzzer] +max_len = 128 diff --git a/projects/grpc/fuzzer_serverlist.options b/projects/grpc/fuzzer_serverlist.options new file mode 100644 index 00000000..5dcdfac7 --- /dev/null +++ b/projects/grpc/fuzzer_serverlist.options @@ -0,0 +1,2 @@ +[libfuzzer] +max_len = 128 diff --git a/projects/grpc/hpack_parser_fuzzer_test.options b/projects/grpc/hpack_parser_fuzzer_test.options new file mode 100644 index 00000000..584487fa --- /dev/null +++ b/projects/grpc/hpack_parser_fuzzer_test.options @@ -0,0 +1,3 @@ +[libfuzzer] +max_len = 512 +dict = hpack.dictionary diff --git a/projects/grpc/percent_decode_fuzzer.options b/projects/grpc/percent_decode_fuzzer.options new file mode 100644 index 00000000..ea2785e1 --- /dev/null +++ b/projects/grpc/percent_decode_fuzzer.options @@ -0,0 +1,2 @@ +[libfuzzer] +max_len = 32 diff --git a/projects/grpc/percent_encode_fuzzer.options b/projects/grpc/percent_encode_fuzzer.options new file mode 100644 index 00000000..ea2785e1 --- /dev/null +++ b/projects/grpc/percent_encode_fuzzer.options @@ -0,0 +1,2 @@ +[libfuzzer] +max_len = 32 diff --git a/projects/grpc/request_fuzzer.options b/projects/grpc/request_fuzzer.options new file mode 100644 index 00000000..fd32ac16 --- /dev/null +++ b/projects/grpc/request_fuzzer.options @@ -0,0 +1,3 @@ +[libfuzzer] +max_len = 2048 + diff --git a/projects/grpc/response_fuzzer.options b/projects/grpc/response_fuzzer.options new file mode 100644 index 00000000..fd32ac16 --- /dev/null +++ b/projects/grpc/response_fuzzer.options @@ -0,0 +1,3 @@ +[libfuzzer] +max_len = 2048 + diff --git a/projects/grpc/server_fuzzer.options b/projects/grpc/server_fuzzer.options new file mode 100644 index 00000000..fd2eebf7 --- /dev/null +++ b/projects/grpc/server_fuzzer.options @@ -0,0 +1,3 @@ +[libfuzzer] +max_len = 2048 +dict = hpack.dictionary diff --git a/projects/grpc/ssl_server_fuzzer.options b/projects/grpc/ssl_server_fuzzer.options new file mode 100644 index 00000000..60bd9b0b --- /dev/null +++ b/projects/grpc/ssl_server_fuzzer.options @@ -0,0 +1,2 @@ +[libfuzzer] +max_len = 2048 diff --git a/projects/grpc/uri_fuzzer_test.options b/projects/grpc/uri_fuzzer_test.options new file mode 100644 index 00000000..5dcdfac7 --- /dev/null +++ b/projects/grpc/uri_fuzzer_test.options @@ -0,0 +1,2 @@ +[libfuzzer] +max_len = 128 |