diff options
author | Fabian Meumertzheim <meumertzheim@code-intelligence.com> | 2021-03-22 14:48:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-22 14:48:58 +0100 |
commit | 71ac55c6fc9d808bcc8a8e8d895f7f20141bec86 (patch) | |
tree | dfa557a023d1413799c24dbd1373d8c42c2ee8bb /examples | |
parent | 20d72b43a58f5ffcb807245a854d7eb178c4b8b6 (diff) | |
download | jazzer-api-71ac55c6fc9d808bcc8a8e8d895f7f20141bec86.tar.gz |
Do not intercept JVM-internal C stdlib calls (#45)
* Replace uses of quick_exit and at_quick_exit
quick_exit is not supported on macOS, but can easily replaced by a call
to _Exit after running our cleanup manually.
* Run buildifier --lint=fix -r .
* Build libFuzzer from source
Building libFuzzer from source is easy and has multiple advantages:
* The clang distributed with XCode on macOS does not include libFuzzer.
* Applying a small patch to libFuzzer will allow us to replace the
--wrap linker feature, which is not supported on platforms other than
Linux.
* Replace -Wl,--wrap with a source code patch
* Pin non-native rules_python
* Print exit code on test failure
* Do not intercept JVM-internal C stdlib calls
The JVM frequently calls strcmp/memcmp/..., which fills up the table of
recent compares with entries that are either duplicates of values
already reported by the bytecode instrumentation or JDK-internal strings
that are not relevant for fuzzing.
This commit adds an ignorelist to the C stdlib interceptors that filters
out calls from known JVM libraries. If the fuzz target has not yet
loaded a native library, all such callbacks are ignored, which greatly
improves fuzzer performance for string-heavy targets. E.g.,
JsonSanitizerDenylistFuzzer takes < 1 million runs now when it used to
take over 3 million.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/BUILD.bazel | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/BUILD.bazel b/examples/BUILD.bazel index 9b5951a0..4bc7deb8 100644 --- a/examples/BUILD.bazel +++ b/examples/BUILD.bazel @@ -1,3 +1,4 @@ +load("@rules_java//java:defs.bzl", "java_binary") load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library") load("//bazel:fuzz_target.bzl", "java_fuzz_target_test") |