You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
driver: Add support for native fuzzing without launcher
Fuzzing native libraries with ASan and UBSan using the Java driver is
made possible by the generated launcher script, which this commit
uses to preload the Jazzer hooks and native sanitizer runtime libraries
into a JVM running Jazzer started as a subprocess.
Since the sanitizer instrumentation applied at compile time and the
runtime libraries must be kept in sync, the preload approach allows
users to fuzz native libraries without building the Jazzer launcher from
source for the first time. Jazzer will automatically pick the libraries
corresponding to `CC` (if set) or `clang` in `PATH`.
While the existing native_fuzzer_hooks.c can be reused almost unchanged
for this purpose on Linux, macOS requires mimicking the interposing
logic used by ASan to hook libc funtions at runtime. This commit
extracts these platform-specific hooking techniques into preprocessor
macros.
Further complications arise because macOS codesigning prevents library
insertion into `/bin/sh` via `DYLD_INSERT_LIBRARIES` and generally
requires all libraries to be preloaded into the `java` process to be
codesigned - users may have to click through Gatekeeper warnings to
allow this. This requires removing the signatures in CI, where we can't
simulate these clicks.
Tests fail on macOS 11 for unclear reasons, so we raise the minimum
version to 12, which hase been out for almost a year by now. They also
fail with JDK 8, which can't be reproduced locally - these tests are
skipped in CI.
Copy file name to clipboardExpand all lines: .github/workflows/oss-fuzz.yml
+2-2
Original file line number
Diff line number
Diff line change
@@ -23,8 +23,8 @@ jobs:
23
23
24
24
- name: Build Jazzer
25
25
# Keep in sync with https://github.com/google/oss-fuzz/blob/221b39181a372ff16c0c813c5963a08aa58f19e2/infra/base-images/base-builder/install_java.sh#L33.
# Keep in sync with https://github.com/google/oss-fuzz/blob/221b39181a372ff16c0c813c5963a08aa58f19e2/infra/base-images/base-builder/install_java.sh#L35-L36.
30
-
run: "test -f bazel-bin/agent/jazzer_agent_deploy.jar && test -f bazel-bin/launcher/jazzer && test -f bazel-bin/launcher/jazzer_asan && test -f bazel-bin/launcher/jazzer_ubsan && test -f bazel-bin/agent/jazzer_api_deploy.jar"
30
+
run: "test -f bazel-bin/agent/jazzer_agent_deploy.jar && test -f bazel-bin/launcher/jazzer && test -f bazel-bin/agent/jazzer_api_deploy.jar"
0 commit comments