[FuzzMutate] Reject invalid inputs in the IR fuzzers#202348
Conversation
In llvm-isel-fuzzer and llvm-opt-fuzzer return -1 from LLVMFuzzerTestOneInput to ignore an invalid input. This will remove it from in-memory corpus and prevent sending it to the custom mutators (useless and crashes llvm-isel-fuzzer). libfuzzer truncates with -max_len so inputs above the limit are automatically invalid.
|
I see that ignoring broken inputs can be useful, but also depending on the objective allowing invalid inputs is not necessarily wrong. Invalid inputs can still find crashes in the parser or verifier. Would it be possible to put this change behind a flag? |
|
I agree that we should put the change under a flag but under a different reasoning: Re to @mgcarrasco I don't see the value in invalid inputs here on the files being changed ( On the change itself, I can't speak for the effect on libFuzzer, but on AFL, IIUC, it does little:
So from AFL's perspective, this is a slight regression, not totally unacceptable if its guarded under a flag and justifies your usage. I would like to see in which use case do you find |
In llvm-isel-fuzzer and llvm-opt-fuzzer return -1 from LLVMFuzzerTestOneInput to ignore an invalid input. This will remove it from in-memory corpus and prevent sending it to the custom mutators (useless and crashes llvm-isel-fuzzer). libfuzzer truncates with -max_len so inputs above the limit are automatically invalid.