Skip to content

OSS-Fuzz: Move fuzzers to upstream repository - #1343

Open
arthurscchan wants to merge 2 commits into
google:masterfrom
arthurscchan:fuzz/upstream-harness
Open

arthurscchan wants to merge 2 commits into
google:masterfrom
arthurscchan:fuzz/upstream-harness

Conversation

@arthurscchan

Copy link
Copy Markdown

This PR moves all the OSS-Fuzz fuzzers to the upstream storage for easier management. This PR works together with OSS-Fuzz (google/oss-fuzz#16312) to accommodate the moving of fuzzers upstream.

Of course, this is only a suggestion. If the maintainers would prefer the fuzzers to remain in OSS-Fuzz, I am happy to keep the current setup and to ping the relevant maintainers for review whenever I add new fuzzers later in the process.

Thank you for considering this, and I would welcome any feedback on the preferred approach.

Remark: After this PR is accepted and merged, there will be additional PRs for adding new fuzzers for this project later.

Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces libFuzzer-based fuzz targets for the C API of libjsonnet, including CMake configuration updates and documentation. The feedback highlights a potential CMake configuration error when building fuzzers without other binary targets, and recommends adding an explicit compiler check for Clang to prevent build failures with other compilers. Additionally, the reviewer points out that setting *buf = NULL on import failure in the fuzzers violates the JsonnetImportCallback contract and suggests allocating a dummy error message using jsonnet_realloc to avoid undefined behavior or false-positive crashes.

Comment thread CMakeLists.txt Resolved
Comment thread fuzz/convert_jsonnet_fuzzer_multi.cc Resolved
Comment thread fuzz/convert_jsonnet_fuzzer_regular.cc Resolved
Comment thread fuzz/convert_jsonnet_fuzzer_stream.cc Resolved
Comment thread fuzz/CMakeLists.txt Resolved
- ImportCallback: return an allocated error message (via jsonnet_realloc)
  on failure, as required by the JsonnetImportCallback contract, instead
  of a NULL buffer.
- CMake: build the jsonnet library targets when only BUILD_FUZZERS is
  enabled, so jsonnet_lib_for_binaries resolves.
- CMake: fail with a clear error when the fuzzers are built without
  Clang.

Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant