fwohci_rx_enable ignores fwohci_add_rx_buf allocation failure -> db[-1] OOB write
Summary
fwohci_rx_enable at fwohci.c:1406 calls fwohci_add_rx_buf return value UNUSED. fwohci_add_rx_buf :2544-2547 returns ENOMEM BEFORE setting db_tr->dbcnt=1 (stays 0). :1410 ldesc=db_tr->dbcnt-1=-1. :1411 db[ldesc].db.desc.depend writes db[-1] 8 bytes before descriptor array. If at start of DMA segment (page-aligned) -> page fault panic. Memory pressure + FireWire bus reset (device PHY RST) triggers. Same pattern in fwohci_tx_enable :1337-1345. Fix: check return value, abort channel setup on failure.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-1007 Β· 3 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able fix for the cited path | 733 B | view raw |
| VERDICT.md | verdict | source-confirmation narrative | 961 B | β raw |
| env.txt | environment | guest uname + toolchain | 247 B | view raw |
DF-1007 source-confirmation
Verdict: REPRODUCED (source-confirmed) Impact: none Confidence: likely
Kernel ref: sys/bus/firewire/fwohci.c:1406
Mechanism
fwohci db[-1] OOB write on add_rx_buf ENOMEM: fwohci_rx_enable/tx_enable ignore fwohci_add_rx_buf return; on ENOMEM dbcnt stays 0 so ldesc=dbcnt-1=-1 indexes db[-1] (8-byte OOB write before descriptor array). confirmed.
Confirmation method
source-only Low-severity; confirmation by code inspection. Runtime PoC not exercised for this Low-severity item; confirmation is by code inspection against sys/.
Recommended fix
See fix.diff in this folder (git-apply-able unified diff).
Phase 8 (combined build)
This fix is part of the batched 70-finding combined patch
(../_batch70/combined_70.patch) applied to in-guest /usr/src. A single
make -j6 nativekernel KERNCONF=X86_64_GENERIC build is validated rc=0 with 0
errors under -Werror (../_batch70/fix_build.log).
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
- /
- f
- i
- r
- e
- w
- i
- r
- e
- /
- f
- w
- o
- h
- c
- i
- .
- c
- :
- 1
- 4
- 0
- 6
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/firewire/fwohci.c:1406. combined-70 fix kernel: NK_DONE rc=0 (0 errors, -Werror).
PoC changes
authored/validated fix.diff (findings/poc/DF-1007/fix.diff); part of combined_70 kernel build.
Verified recommended fix
See findings/poc/DF-1007/fix.diff (git-apply-able). Matches finding proposal.
Verdict
REAL: fwohci_rx_enable/tx_enable ignore fwohci_add_rx/tx_buf ENOMEM; dbcnt stays 0 -> db[-1] OOB write. confirmed.
No comments yet.