Skip to content

Conversation

@00xc
Copy link

@00xc 00xc commented Jan 9, 2026

Add a fuzzer for the netboot code, which focuses on its two public APIs: parseNetbootinfo() and FetchNetbootimage(). It stubs out the global PXE protocol handle to feed in bytes from libfuzzer into the netboot code, which means that this variable cannot be static when building the fuzzer. On top of that, the full_path static is allocated once and never freed, which is not problematic in normal operation, but triggers address sanitizer's leak detector, so expose it as well so that the harness can free the memory after each run.

Add as well a dictionary with some magic strings and bytes that help get coverage faster.

After a couple hours running and getting practically full coverage (verified with llvm-cov) the fuzzer luckily found no issues.

The name passed to parseNetbootinfo() is never modified, since all
changes are made in a separate copy of the string, so mark the parameter
as const.

Signed-off-by: Carlos López <carlos.lopezr4096@gmail.com>
@00xc 00xc changed the title Fuzz/netboot netboot: add fuzzer for TFTP network boot Jan 9, 2026
Add a fuzzer for the netboot code, which focuses on its two public APIs:
`parseNetbootinfo()` and `FetchNetbootimage()`. It stubs out the global
PXE protocol handle to feed in bytes from libfuzzer into the netboot
code, which means that this variable cannot be static when building
the fuzzer. On top of that, the full_path static is allocated once and
never freed, which is not problematic in normal operation, but triggers
address sanitizer's leak detector, so expose it as well so that the
harness can free the memory after each run.

Add as well a dictionary with some magic strings and bytes that help get
coverage faster.

After a couple hours running and getting practically full coverage
(verified with llvm-cov) the fuzzer luckily found no issues.

Signed-off-by: Carlos López <carlos.lopezr4096@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant