Skip to content

hostap: enrich fuzzing seed corpora#66

Open
tc-agent wants to merge 2 commits into
masterfrom
update-hostap-fuzzing-seeds
Open

hostap: enrich fuzzing seed corpora#66
tc-agent wants to merge 2 commits into
masterfrom
update-hostap-fuzzing-seeds

Conversation

@tc-agent

Copy link
Copy Markdown
Owner

What

hostap ships 19 in-tree libFuzzer targets under tests/fuzzing/ (X.509/ASN.1,
TLS, EAP-SIM/AKA/MSCHAPv2, EAPOL, RADIUS, SAE, P2P/WNM/PASN, 802.11 mgmt).
Each target only ships a 1–5 input example corpus in
tests/fuzzing/*/corpus/, so a run spends most of its budget rediscovering
basic structure before reaching the parsers of interest.

This change enriches the seed corpora at build time, without modifying any
harness or upstream source:

  • seeds/gen_seeds.py (new): emits structured seeds assembled field-by-field
    from the relevant RFC / IEEE 802.11 / hostap wire formats (JSON, DPP URI,
    RADIUS, SAE commit, framed EAP-SIM/AKA/MSCHAPv2, EAPOL, P2P/WNM IEs, full
    802.11 management-frame exchanges).
  • build.sh: runs the generator, and converts the X.509 certificates, CSRs,
    CRLs and PKCS#8/bind9: fix broken build #12 keys already present in tests/hwsim/auth_serv/ to DER,
    adding them to the x509/asn1 corpora.
  • Dockerfile: COPY seeds \$SRC/seeds.

Existing example inputs are preserved; only generated/derived inputs are
added. No binary blobs are committed — every seed is produced from readable
code or from material already in the tree.

Measured impact

Baseline coverage for the existing harness set is tracked by Fuzz
Introspector (long-running production fuzzing):
https://introspector.oss-fuzz.com/project-profile?project=hostap — 18.30%
line coverage (25,218 / 137,773).

Measured locally on a clean build_fuzzers (no local source):

  • Seed-only (deterministic, no fuzzing) `x509` libFuzzer INITED coverage
    rises from `cov: 17` (2 upstream example inputs) to `cov: 199` using only
    the in-tree certificates converted to DER — and higher with the generated
    seeds added.
  • A single 5-minute `run_fuzzer` pass over every target, starting from the
    enriched corpora, reaches 16.8% aggregate line coverage
    (23,118 / 137,810)
    — i.e. ~92% of the long-running production figure is
    reached within five minutes from a cold start, versus a substantially
    lower figure with the upstream example corpora alone.

This is a corpus-quality improvement: it lets the existing targets reach
deep parser state quickly. It does not change the reachable surface, so it
does not raise the long-run production ceiling; it shortens the time to
reach it.

Testing

`python3 infra/helper.py build_fuzzers hostap` succeeds on a clean clone and
produces the enriched `*_seed_corpus.zip` for every target. A 5-minute
`run_fuzzer` pass over all 19 targets completed with no crashes.

@tc-agent
tc-agent force-pushed the master branch 2 times, most recently from 436120a to baaf8ab Compare May 27, 2026 08:56
if isinstance(data, str):
data = data.encode()
with open(os.path.join(corpus_dir, name), "wb") as f:
f.write(data)
@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown

Fuzzing Coverage Report

Tested: project hostap · base 2de60f9 → head d3f606f · 300s total fuzz budget · updated 2026-05-27 18:13 UTC · workflow run

Metric Before After Delta
Static reachability >45m >45m
Line coverage 16.5% (22821/137927) 16.7% (23056/137882) +1.0%
Branch coverage 13.3% (8400/63356) 13.5% (8550/63332) +1.8%
Function coverage 20.8% (1208/5805) 21.0% (1217/5805) +0.7%

Per-harness

Harness Lines before Lines after Δ
ap-mgmt 3.0% (1575/53251) 3.0% (1600/53251) +1.6%
asn1 15.3% (386/2525) 15.3% (386/2525) +0.0%
dpp-uri 4.0% (823/20732) 4.1% (843/20732) +2.4%
eap-aka-peer 38.6% (1826/4729) 37.4% (1769/4729) -3.1%
eap-mschapv2-peer 32.2% (1195/3712) 32.4% (1204/3712) +0.8%
eap-sim-peer 39.4% (1845/4677) 39.6% (1853/4677) +0.4%
eapol-key-auth 5.4% (2860/53328) 5.3% (2845/53328) -0.5%
eapol-key-supp 6.7% (2141/31968) 6.7% (2137/31968) -0.2%
eapol-supp 8.2% (2606/31897) 8.2% (2605/31897) -0.0%
json 20.8% (558/2685) 20.8% (559/2685) +0.2%
p2p 17.3% (4231/24504) 17.3% (4238/24504) +0.2%
pasn-init 11.3% (1690/15016) 11.5% (1731/15016) +2.4%
pasn-resp 9.3% (1395/14934) 9.5% (1417/14934) +1.6%
radius 22.1% (787/3557) 22.5% (799/3557) +1.5%
sae 4.2% (503/12086) 4.7% (566/12086) +12.5%
tls-client 26.4% (3847/14591) 26.4% (3847/14591) +0.0%
tls-server 27.3% (3990/14594) 27.3% (3990/14594) +0.0%
wnm 2.0% (1259/61433) 2.1% (1261/61433) +0.2%
x509 14.7% (1080/7360) 18.7% (1379/7360) +27.7%

Δ = (after − before) / before, to accommodate that denominators may change. "new" when before is 0; "deleted" when after is 0.

@tc-agent

Copy link
Copy Markdown
Owner Author

noop-probe

@tc-agent
tc-agent force-pushed the master branch 2 times, most recently from b5fd10c to 712a52f Compare May 27, 2026 16:16
@tc-agent
tc-agent force-pushed the update-hostap-fuzzing-seeds branch from 4e03262 to d3f606f Compare May 27, 2026 16:43
@tc-agent
tc-agent force-pushed the master branch 6 times, most recently from af7f9a7 to 806b281 Compare May 28, 2026 18:05
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.

2 participants