Fuzzing: catch the app's own caught panics as the app does

libFuzzer's panic hook aborts at once, even inside the app's own
catch_unwind (pack::pdf::copies around the PDF reader), so the third run
stopped on the replayed PDF case after 8 inputs although the app handles
it. The targets' init (fuzzing::init) sets a hook that prints the first
ten panics and lets them unwind as in the app; a panic nothing catches
still reaches libfuzzer-sys's own catch_unwind, which aborts and saves
the input. Checked in a container: the PDF case passes in 8 ms, 60 s a
target finds nothing. PLAN lists the two findings.
This commit is contained in:
grabowski committed 2026-11-23 11:03:39 +07:00
1 parent c0ef994b26
commit 422ee2ec2c
5 files changed
+44 -6

No files matched your search

+4 -1
View File
@@ -1,3 +1,6 @@
#![no_main]
libfuzzer_sys::fuzz_target!(|data: &[u8]| visa::fuzzing::text(data));
libfuzzer_sys::fuzz_target!(
init: visa::fuzzing::init(),
|data: &[u8]| visa::fuzzing::text(data)
);