mt7601_set_chan unbounded linear search over mt7601_rf_chan[14] reads OOB for chan outside 1..14
Summary
mt7601_set_chan at if_mtw.c:3699-3700: for(i=0; mt7601_rf_chan[i].chan != chan; i++); NO upper bound. mt7601_rf_chan has 14 entries (channels 1..14). mtw_set_chan :3742 only rejects chan==0 and chan==IEEE80211_CHAN_ANY, accepts chan>14. chan=36 -> loop scans .rodata/.data past array end -> panic on unmapped page or OOB read of mt7601_rf_chan[i].r17/r18/r19/r20 -> garbage to RF registers + sc->txpow1[i] OOB. Default config registers only 2GHz channels 1..14 so unreachable today; triggerable if driver extended to 5GHz or ioctl bypasses rate caps. Fix: for(i=0;i<nitems(mt7601_rf_chan);i++) if(match) break; if(i==nitems) return;.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0986 Β· 2 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able fix for the cited path | 534 B | view raw |
| VERDICT.md | verdict | source-confirmation narrative | 987 B | β raw |
DF-0986 source-confirmation
Verdict: REPRODUCED (source-confirmed)
Impact: panic Confidence: likely
Kernel ref: sys/bus/u4b/wlan/if_mtw.c:3699
Mechanism
mt7601_set_chan unbounded linear scan past mt7601_rf_chan[] -> OOB
Confirmation method
Source-trace confirmed the cited code path matches the finding (exact line/condition
verified against sys/). Runtime PoC not exercised for this source-only Low-severity
item; confirmation is by code inspection.
Recommended fix
See fix.diff in this folder (git-apply-able unified diff).
Phase 8 (combined build)
All 70 fixes were batched into one combined patch
(../_batch70/combined_70.patch) and applied to in-guest /usr/src. A single
make -j6 nativekernel KERNCONF=X86_64_GENERIC completed rc=0 with 0 errors under
-Werror (../_batch70/../_batch70/fix_build.log, 35374 lines). The GENERIC kernel + all modules
(drm, firewire, usb, netgraph, smbfs, fuse, crypto, vm, pmap) compiled clean.
Fix verification
fixedVALIDATED via combined build: fix in combined_70.patch; single make -j6 nativekernel built rc=0, 0 errors under -Werror (../_batch70/fix_build.log). Cited line corrected. Source-only -> validation = clean -Werror compile.
'>>> Kernel build for X86_64_GENERIC completed' + 'NK_DONE rc=0'; grep -cE 'error:|undefined reference' fix_build.log = 0
Confirmed kernel references
- s
- y
- s
- /
- b
- u
- s
- /
- u
- 4
- b
- /
- w
- l
- a
- n
- /
- i
- f
- _
- m
- t
- w
- .
- c
- :
- 3
- 6
- 9
- 9
Detail
Exploit chain
none (source-only Low finding, not memory-corruption driven to runtime; no escalation chain)
Evidence (decisive lines)
baseline (with-src #0): bug at sys/bus/u4b/wlan/if_mtw.c:3699. combined-70 fix kernel: NK_DONE rc=0 (0 errors, -Werror).
PoC changes
authored/validated fix.diff (findings/poc/DF-0986/fix.diff); part of combined_70 kernel build.
Verified recommended fix
See findings/poc/DF-0986/fix.diff (git-apply-able). Matches finding proposal.
Verdict
REAL: mt7601_set_chan unbounded linear scan over 14-entry rf_chan table for chan outside 1..14 -> OOB. default-config-unreachable today. confirmed.
No comments yet.