diff options
author | Fabian Meumertzheim <meumertzheim@code-intelligence.com> | 2021-01-29 16:20:19 +0100 |
---|---|---|
committer | Fabian Meumertzheim <meumertzheim@code-intelligence.com> | 2021-02-09 17:20:51 +0100 |
commit | 5246e52be3bf4427791000355cbef86626b43eca (patch) | |
tree | e0683ad15664f2c3deecf3a6ce8c56f2a9597d85 /examples/BUILD.bazel | |
download | jazzer-api-5246e52be3bf4427791000355cbef86626b43eca.tar.gz |
Initial commit
Diffstat (limited to 'examples/BUILD.bazel')
-rw-r--r-- | examples/BUILD.bazel | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/examples/BUILD.bazel b/examples/BUILD.bazel new file mode 100644 index 00000000..d417e352 --- /dev/null +++ b/examples/BUILD.bazel @@ -0,0 +1,149 @@ +load("//bazel:fuzz_target.bzl", "java_fuzz_target_test") + +java_fuzz_target_test( + name = "ExampleFuzzer", + srcs = [ + "src/main/java/com/example/ExampleFuzzer.java", + "src/main/java/com/example/ExampleFuzzerHooks.java", + ], + # Comment out the next line to keep the fuzzer running indefinitely. + hook_classes = ["com.example.ExampleFuzzerHooks"], + target_class = "com.example.ExampleFuzzer", + deps = [ + "//agent/src/main/java/com/code_intelligence/jazzer/api", + ], +) + +java_fuzz_target_test( + name = "ExampleFuzzerWithNative", + srcs = [ + "src/main/java/com/example/ExampleFuzzerWithNative.java", + ], + native_libs = ["//examples/src/main/native"], + target_class = "com.example.ExampleFuzzerWithNative", + use_asan = True, + deps = [ + "//agent:jazzer_api_deploy.jar", + ], +) + +java_fuzz_target_test( + name = "ExampleValueProfileFuzzer", + srcs = [ + "src/main/java/com/example/ExampleValueProfileFuzzer.java", + ], + # Comment out the next line to keep the fuzzer running indefinitely. + fuzzer_args = ["-use_value_profile=1"], + target_class = "com.example.ExampleValueProfileFuzzer", + deps = [ + "//agent/src/main/java/com/code_intelligence/jazzer/api", + ], +) + +java_fuzz_target_test( + name = "JpegImageParserFuzzer", + srcs = [ + "src/main/java/com/example/JpegImageParserFuzzer.java", + ], + target_class = "com.example.JpegImageParserFuzzer", + deps = [ + "@maven//:org_apache_commons_commons_imaging", + ], +) + +java_fuzz_target_test( + name = "GifImageParserFuzzer", + srcs = [ + "src/main/java/com/example/GifImageParserFuzzer.java", + ], + target_class = "com.example.GifImageParserFuzzer", + deps = [ + "@maven//:org_apache_commons_commons_imaging", + ], +) + +java_fuzz_target_test( + name = "TiffImageParserFuzzer", + srcs = [ + "src/main/java/com/example/TiffImageParserFuzzer.java", + ], + tags = ["manual"], + target_class = "com.example.TiffImageParserFuzzer", + deps = [ + "@maven//:org_apache_commons_commons_imaging", + ], +) + +java_fuzz_target_test( + name = "JsonSanitizerFuzzer", + srcs = [ + "src/main/java/com/example/JsonSanitizerFuzzer.java", + ], + target_class = "com.example.JsonSanitizerFuzzer", + deps = [ + "//agent/src/main/java/com/code_intelligence/jazzer/api", + "@maven//:com_google_code_gson_gson", + "@maven//:com_mikesamuel_json_sanitizer", + ], +) + +java_fuzz_target_test( + name = "JacksonCborFuzzer", + srcs = [ + "src/main/java/com/example/JacksonCborFuzzer.java", + ], + target_class = "com.example.JacksonCborFuzzer", + deps = [ + "@maven//:com_fasterxml_jackson_core_jackson_core", + "@maven//:com_fasterxml_jackson_core_jackson_databind", + "@maven//:com_fasterxml_jackson_dataformat_jackson_dataformat_cbor", + ], +) + +java_fuzz_target_test( + name = "FastJsonFuzzer", + srcs = [ + "src/main/java/com/example/FastJsonFuzzer.java", + ], + target_class = "com.example.FastJsonFuzzer", + deps = [ + "//agent/src/main/java/com/code_intelligence/jazzer/api", + "@maven//:com_alibaba_fastjson", + ], +) + +java_fuzz_target_test( + name = "TurboJpegFuzzer", + srcs = [ + "src/main/java/com/example/TurboJpegFuzzer.java", + ], + fuzzer_args = [ + "-rss_limit_mb=8196", + ], + native_libs = [ + "@libjpeg_turbo//:turbojpeg_native", + ], + tags = ["manual"], + target_class = "com.example.TurboJpegFuzzer", + use_asan = True, + deps = [ + "//agent/src/main/java/com/code_intelligence/jazzer/api", + "@libjpeg_turbo//:turbojpeg_java", + ], +) + +java_binary( + name = "examples", + create_executable = False, + resource_jars = [ + ":ExampleFuzzer_target_deploy.jar", + ":ExampleValueProfileFuzzer_target_deploy.jar", + ":FastJsonFuzzer_target_deploy.jar", + ":GifImageParserFuzzer_target_deploy.jar", + ":JacksonCborFuzzer_target_deploy.jar", + ":JpegImageParserFuzzer_target_deploy.jar", + ":JsonSanitizerFuzzer_target_deploy.jar", + ":TiffImageParserFuzzer_target_deploy.jar", + ], + visibility = ["//visibility:public"], +) |