Skip to content

Fix crash-looping fuzzers: nullptr, FF constructor, deserialization#22602

Draft
randyquaye wants to merge 1 commit intonextfrom
rq/claude-suggested-fuzz-fixes
Draft

Fix crash-looping fuzzers: nullptr, FF constructor, deserialization#22602
randyquaye wants to merge 1 commit intonextfrom
rq/claude-suggested-fuzz-fixes

Conversation

@randyquaye
Copy link
Copy Markdown
Collaborator

Summary

  • Fix 5 crash-looping fuzzer harnesses that were failing on startup due to constructor misuse or unhandled deserialization errors
  • These are source-level fixes in barretenberg that both the fuzzing-container and avm-fuzzing-container depend on

Fixes

File Issue Fix
byte_array.fuzzer.hpp nullptr builder causes null deref Static dummy_builder()
calldata.fuzzer.cpp FF(u64,u64,u64,u64) — no such constructor FF(uint256_t(...))
memory.fuzzer.cpp Same FF constructor issue FF(uint256_t(...))
emit_public_log.fuzzer.cpp Same FF constructor issue (2 places) FF(uint256_t(...))
ecc.fuzzer.cpp Fq(u64,u64,u64,u64) + off-curve point deser crash Fq(uint256_t(...)) + try-catch around from_buffer()

Test plan

  • cmake --preset fuzzing-avm && cmake --build build-fuzzing-avm --target harness_ecc_fuzzer compiles
  • cmake --preset fuzzing && cmake --build build-fuzzing compiles (byte_array fix)
  • Run each fixed fuzzer for 30s to verify no immediate crash loop

- byte_array.fuzzer.hpp: replace nullptr builder with static
  dummy_builder() to avoid null dereference on construction
- calldata.fuzzer.cpp: wrap 4-limb FF constructor in uint256_t() to
  use the correct overload (FF has no 4x uint64_t constructor)
- memory.fuzzer.cpp: same uint256_t() fix for FF construction
- emit_public_log.fuzzer.cpp: same fix in two places (contract address
  and log value mutation)
- ecc.fuzzer.cpp: uint256_t() fix for Fq constructor, plus try-catch
  guards around from_buffer() in both LLVMFuzzerCustomMutator and
  LLVMFuzzerTestOneInput to handle off-curve point deserialization
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