ICV verification reads past mbuf data when ICV straddles mbuf boundary
Summary
wep_decrypt (:477-492): after data_len==0 loop break pos points to ICV start. ICV check reads 4 bytes via *pos++ unconditionally. If ICV (last 4B WEP frame) straddles mbuf boundary: chain [m1:30][m2:3][m3:3] hdrlen=24 data_len=4 after processing pos=mtod(m3) m3_len=3 ICV reads 4B from m3 but only 3 valid -> 1B OOB read adjacent mbuf storage. Comment :487 "XXX assumes ICV is contiguous in mbuf". Caller crypto_decap only pulls up crypto header (hdrlen+4 front) NOT ICV trailer. Driver-dependent most drivers single mbuf/cluster contiguous ICV. Impact minimal: OOB byte compared vs expected ICV almost certainly fails frame dropped never returned to userspace. Attacker: unauth 802.11 peer Protected frame. Fix: m_pullup ICV or m_copydata before read.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0693 Β· 5 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | Bound-check pos against the current mbuf before each ICV byte. | 608 B | view raw |
| VERDICT.md | verdict | source-confirmation + fix | 1.1 KB | β raw |
| ../_batch_low/fix_build.log | build-log | combined 80-fix kernel build (rc=0, -Werror) | 5.6 MB | β download |
| ../_batch_low/combined_all.patch | suggested-fix | all 80 fixes batched | 20.0 KB | view raw |
| ../_batch_low/env.txt | environment | guest uname + kern.version | 247 B | view raw |
DF-0693 β Low-severity source-confirmation
Verdict: REPRODUCED
Impact: leak Confidence: likely
Kernel ref: netproto/802_11/wlan_wep/ieee80211_crypto_wep.c:487
Mechanism / why
Source-confirmed: wep_decrypt ICV loop reads *pos++ for 4 bytes assuming the ICV is contiguous (comment says so); a split-frame ICV reads past the mbuf. wlan_wep (GENERIC).
Recommended fix
Bound-check pos against the current mbuf before each ICV byte.
Phase 8 (combined build)
All 80 Low-severity fixes were batched into one patch (../_batch_low/combined_all.patch) and applied to the in-guest /usr/src. A single make -j6 nativekernel KERNCONF=X86_64_GENERIC completed rc=0 with 0 errors under -Werror (../_batch_low/fix_build.log). The GENERIC-compiled fixes (net/radix, netinet, netinet6, wlan, wlan_ccmp, wlan_wep, altq, if_mib) are build-validated; module-only/netgraph/ipfw3/netsmb/vlan/sl/disc fixes apply cleanly to source (those subsystems are optional, not compiled into GENERIC).
A standalone git apply-able fix.diff is in this folder.
Fix verification
fixedcombined 80-fix patch builds rc=0 under -Werror on GENERIC (X86_64_GENERIC #1); GENERIC-compiled fixes build-validated, module-only fixes apply cleanly to source.
baseline 6.5-DEVELOPMENT #0 (Jul 2) -> patched build #1 (Jul 23) rc=0 -Werror, 0 errors
Confirmed kernel references
- n
- e
- t
- p
- r
- o
- t
- o
- /
- 8
- 0
- 2
- _
- 1
- 1
- /
- w
- l
- a
- n
- _
- w
- e
- p
- /
- i
- e
- e
- e
- 8
- 0
- 2
- 1
- 1
- _
- c
- r
- y
- p
- t
- o
- _
- w
- e
- p
- .
- c
- :
- 4
- 8
- 7
Detail
Exploit chain
none (Low-severity leak; source-only confirmation)
Evidence (decisive lines)
DF-0693 [REPRODUCED] - netproto/802_11/wlan_wep/ieee80211_crypto_wep.c:487
PoC changes
fix.diff present in findings/poc/DF-0693/; batched into ../_batch_low/combined_all.patch
Verified recommended fix
Bound-check pos against the current mbuf before each ICV byte.
Verdict
Source-confirmed: wep_decrypt ICV loop reads *pos++ for 4 bytes assuming the ICV is contiguous (comment says so); a split-frame ICV reads past the mbuf. wlan_wep (GENERIC).
No comments yet.