fix: gate generate_minibsod behind LIBAFL_MINIBSOD env var#3826
fix: gate generate_minibsod behind LIBAFL_MINIBSOD env var#3826kx7m2qd wants to merge 3 commits into
Conversation
Calling generate_minibsod() unconditionally in inproc_crash_handler produces megabytes of output (backtrace, registers, memory maps) that doesn't appear in standard libFuzzer. This is especially noisy in libafl_libfuzzer_runtime compatibility mode where ASan already provides the relevant stack trace. Gate the minibsod output behind the LIBAFL_MINIBSOD environment variable so it is opt-in. Users who want the full diagnostic output can set LIBAFL_MINIBSOD=1. Fixes AFLplusplus#3792
|
So I think the env shouldn't be part of LibAFL, that's against the "Lib" part, right? IMHO it should be a simple variable that we set when creating the executor (builder/..) and then the libfuzzer shim just sets this to false, other fuzzers can chose what they want (or read an env). |
|
Thanks for the feedback @domenukk! That makes sense keeping it as a library-level config rather than an env var is cleaner. So the idea would be to add something like with_minibsod(bool) on the executor builder, defaulting to true, and have libafl_libfuzzer_runtime explicitly set it to false? Happy to rework the PR along those lines if that's the right direction |
|
At this point it's probably time to add a builder if you want to do that? It's a bit more work but would be better since we already have |
|
Thanks @domenukk! So the plan would be to add |
Well or just |
Description
generate_minibsod()was being called unconditionally ininproc_crash_handler, producing megabytes of output (Rust backtrace, register dump,/proc/self/maps) on every target crash. This output doesn't appear in standard libFuzzer and is particularly noisy inlibafl_libfuzzer_runtimecompatibility mode, where ASan already provides the relevant stack trace. The Rust backtrace is especially problematic sinceBacktrace::force_capture()ignoresRUST_BACKTRACE=0, giving users no way to suppress it.This PR gates the
generate_minibsod()calls inunix.rsandinprocess.rsbehind theLIBAFL_MINIBSODenvironment variable, making the full diagnostic output opt-in:LIBAFL_MINIBSOD=1: full minibsod output (registers, backtrace, memory maps) for debugging fuzzer internalsThe crash handler in
libafl_qemu/src/executor.rswas intentionally left ungated — that path fires when the fuzzer itself crashes (not the target), where the diagnostic info is genuinely useful.Fixes #3792
Checklist
./scripts/precommit.shand addressed all comments