Skip to content

finding: use gofuzz build tag to select probe definition source - #5423

Open
Aastha-spec-tech wants to merge 1 commit into
ossf:mainfrom
Aastha-spec-tech:fuzz-tag
Open

Aastha-spec-tech wants to merge 1 commit into
ossf:mainfrom
Aastha-spec-tech:fuzz-tag

Conversation

@Aastha-spec-tech

Copy link
Copy Markdown

What does this PR do?

Fixes #5193

currently, OSS-Fuzz uses sed in build.sh to modify finding/probe.go so that probe definitions are read from /tmp/probedefinitions instead of the embedded filesystem.

this works, but it means the build depends on modifying source code before compilation. If the function changes during a refactor, the replacement could break without being noticed.

this pr handles the difference using go build tags instead:

  • finding/probe_def.go handles normal builds and reads definitions from the embedded embed.FS.
  • finding/probe_def_gofuzz.go is used for OSS-Fuzz builds and reads definitions from /tmp/probedefinitions/<probeID>/def.yml.

both files implement the same readProbeDefinition helper, which is called from finding/probe.go. this removes the need for the sed workaround in build.sh.

I also added a check-fuzz-build Makefile target and a CI step to make sure the gofuzz-specific files are compiled and checked on every PR.

Testing

  • make check-fuzz-build passes.
  • make unit-test passes (90 packages).
  • golangci-lint reports no new issues with both normal and --build-tags gofuzz builds.
  • Tested with OSS-Fuzz's build_fuzzers, check_build, and run_fuzzer. All passed, with 54,818 runs and no crashes.

Introduces probe_def.go (normal builds) and probe_def_gofuzz.go
(OSS-Fuzz builds) so that the probe definition path is selected at
compile time via the gofuzz build constraint, rather than rewriting
source with sed.

Adds a check-fuzz-build Makefile target and CI step to keep the
gofuzz-only files from silently breaking.

Fixes ossf#5193

Signed-off-by: Aastha-spec-tech <explorething12345@gmail.com>
@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.11%. Comparing base (353ed60) to head (ea9f26f).
⚠️ Report is 462 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5423       +/-   ##
===========================================
+ Coverage   66.80%   79.11%   +12.30%     
===========================================
  Files         230      262       +32     
  Lines       16602    14823     -1779     
===========================================
+ Hits        11091    11727      +636     
+ Misses       4808     3095     -1713     
+ Partials      703        1      -702     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch was previously deployed

2 inactive deployments
integration-test — ea9f26f8 Deployed Nov 6, 2026 by Aastha-spec-tech via integration-trusted #12938
gitlab — ea9f26f8 Deployed Nov 6, 2026 by Aastha-spec-tech via gitlab-integration-trusted #5630
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Go fuzz build fails with GOMODCACHE overlay

1 participant