dnsmasq: add option-parsing + DNS-reply harnesses#60
Open
tc-agent wants to merge 2 commits into
Open
Conversation
tc-agent
force-pushed
the
master
branch
2 times, most recently
from
May 11, 2026 19:27
c053f96 to
3fe38a2
Compare
Fuzzing Coverage ReportTested: project
Per-harness
Δ = (after − before) / before, to accommodate that denominators may change. "new" when before is 0; "deleted" when after is 0. |
tc-agent
force-pushed
the
dnsmasq-add-option-and-dns-reply-harnesses
branch
from
May 11, 2026 19:45
a209413 to
b5aa1ef
Compare
tc-agent
force-pushed
the
master
branch
21 times, most recently
from
May 17, 2026 09:45
a7386df to
5573df7
Compare
tc-agent
force-pushed
the
master
branch
3 times, most recently
from
May 26, 2026 21:21
6a4a93d to
86bef1c
Compare
tc-agent
force-pushed
the
master
branch
2 times, most recently
from
May 27, 2026 06:33
6125235 to
e512e7e
Compare
tc-agent
force-pushed
the
dnsmasq-add-option-and-dns-reply-harnesses
branch
from
May 27, 2026 07:26
b5aa1ef to
8f6b0aa
Compare
tc-agent
force-pushed
the
master
branch
5 times, most recently
from
May 27, 2026 16:16
b5fd10c to
712a52f
Compare
tc-agent
force-pushed
the
dnsmasq-add-option-and-dns-reply-harnesses
branch
from
May 27, 2026 23:48
8f6b0aa to
76d9f77
Compare
tc-agent
force-pushed
the
master
branch
6 times, most recently
from
May 28, 2026 18:05
af7f9a7 to
806b281
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #59 (which enabled the four legacy C harnesses) and
supersedes the abandoned google/oss-fuzz#11779 once #59 lands. Adds two
new harnesses covering code paths the existing ones can't reach:
fuzz_optiondrivesoption.c::one_opt()directly to fuzzconfig-line parsing.
fuzz_dns_replydrivesforward.c::process_replyanddnssec.c::dnssec_validate_reply/_by_ds/_dsagainstsynthesized upstream DNS responses. Enables
-DHAVE_DNSSECsodnssec.c gets linked in.
Both target attacker-controlled inputs:
one_opt()parses every config line — anyone able to write thednsmasq config (or exploit a config-injection bug) controls those
bytes.
process_reply/dnssec_validate_replywalk the bytes returned bythe upstream resolver, which can be spoofed on the wire.
Baseline:
https://introspector.oss-fuzz.com/project-profile?project=dnsmasq
(
fuzz_utilis the only running harness today; 1.65% / 418 lines).Keeping the two new harnesses in one PR because both need the same
build glue (
die()longjmp override,COPTS=-DHAVE_DNSSEC, nettle/gmplink). Splitting would force two near-identical build.sh diffs.
Build-side glue
sedun-staticsone_opt(option.c) andprocess_reply(forward.c).sedrenamesdie()->die_orig()in log.c; a fuzz-awaredie()appended to dnsmasq.c that
longjmps back to the harness when armed(so bad-config paths inside
one_optdon't terminate the fuzzer).nettle-dev,libgmp-devfor DNSSEC crypto.fuzz_dns_reply.optionssetsdetect_leaks=0—dnssec_validate_replylazily allocates
daemon->rr_status; the harness frees it per call.Coverage
Local 5-minute
fuzz_for_pr:13.7x the Fuzz Introspector baseline in absolute lines (5,732 vs
418). The percentage looks close to the no-DNSSEC build because
enabling HAVE_DNSSEC also grew the denominator by ~2,900 lines.