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:
1 parent
c0ef994b26
commit
422ee2ec2c
5 files changed
+44
-6
No files matched your search
+13
-3
@@ -748,9 +748,19 @@ cases in the tests.
|
||||
`tests/fuzz_cases/<target>/` with its fix, which `cargo test` replays on
|
||||
every push. The multipart reading itself is axum's (multer), so no
|
||||
target of ours.
|
||||
- [ ] The nightly job runs on runner02 on cnx01 (Alex, Nov 23, 2026), by
|
||||
its own label `cnx01` (cnx-network-clan PR), at 03:00 and at the lowest
|
||||
CPU priority (`nice`), so the app keeps first call on the CPU.
|
||||
- [x] The nightly job runs on runner02 on cnx01 (Alex, Nov 23, 2026), by
|
||||
its own label `cnx01` (cnx-network-clan PR #170), at 03:00 and at the
|
||||
lowest CPU priority (`nice`), so the app keeps first call on the CPU.
|
||||
Its first two runs found two bugs, both fixed and replayed from
|
||||
`tests/fuzz_cases/`:
|
||||
- a drawn signature of 798 bytes whose PNG header claimed 300 x
|
||||
738,197,594 pixels made the app ask for 885 GB, and the failed
|
||||
allocation ended the whole app. Pictures are now sized from their
|
||||
header before krilla decodes them (`papers::picture`, at most 50
|
||||
megapixels);
|
||||
- a broken PDF upload made the PDF reader panic, so that person's pack
|
||||
failed every time. Such a file now prints as a note page
|
||||
(`pack::pdf::copies`).
|
||||
|
||||
## Open questions
|
||||
|
||||
|
||||
Reference in new issue
Block a user