Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
b44c41b to
6e20db3
Compare
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
6e20db3 to
f34b7ff
Compare
f34b7ff to
3f6be48
Compare
|
Rebased |
| // Leave room to grow, so keydata of other lengths can be reached. | ||
| const size_t old_size{rec.key.size()}; | ||
| rec.key.resize(old_size + 16); | ||
| rec.key.resize(FuzzDefaultMutate(rec.key.data(), old_size, rec.key.size())); |
There was a problem hiding this comment.
The key gets erased if FuzzDefaultMutate returns 0 (which is the case for LLVMFuzzerMutate in afl++) . Is that expected to happen in this branch for key mutations?
There was a problem hiding this comment.
this would only happen with AFL++'s weak stub when PROVIDE_FUZZ_CUSTOM_MUTATOR is defined, isn't it?
There was a problem hiding this comment.
Ah yes, that is my understanding as well after seeing #if defined(PROVIDE_FUZZ_CUSTOM_MUTATOR) at fuzz.cpp:224.
3f6be48 to
7e7cbba
Compare
ekzyis
left a comment
There was a problem hiding this comment.
Partial review. Left some nits and a remark wrt honggfuzz + suggestion from Claude. Will look into mutator effectiveness next.
Add an optional `mutator` field to FuzzTargetOptions. When the fuzz binary is linked against libFuzzer, LLVMFuzzerCustomMutator dispatches to the selected target's mutator, falling back to LLVMFuzzerMutate for targets that don't set one. Custom mutators can call FuzzDefaultMutate() to apply libFuzzer's default mutations to parts of the input. libFuzzer disables -len_control by default whenever LLVMFuzzerCustomMutator is linked in, which would otherwise affect every target. Targets without a custom mutator get -len_control=100 restored, unless it was set explicitly. This is only enabled when the real libFuzzer runtime is linked, detected at configure time, so other engines are unaffected.
Add a custom mutator for raw PSBTs, ported from bitcoinfuzz, and use it for the partially_signed_transaction_deserialize target.
7e7cbba to
93dc3cf
Compare
|
Force-pushed:
|

The
partially_signed_transaction_deserializetarget feeds raw bytes to the PSBT parser. Byte-level mutations rarely produce well-formed key-value maps with valid keydata (pubkeys, xpubs, control blocks, DER signatures, etc), so most inputs are rejected early and the deeper per-field parsing is rarely reached.This PR adds a custom mutator for PSBT which is ported from bitcoinfuzz (with some changes). The mutator splits the input into global/input/output maps of key-value records, applies the mutations and serializes the result again. The first commit is a preparation to allow targets to provide a custom mutator by adding an optional
mutatorfield toFuzzTargetOptions.note: LLM assisted on porting the custom mutator.