Sleeping allocation M_WAITOK inside critical section in fw_get_tlabel -> panic under memory pressure
Summary
fw_get_tlabel at firewire.c:1647 crit_enter() then :1657 kmalloc(sizeof(struct tlabel),M_FW,M_WAITOK). M_WAITOK may sleep; sleeping with td_critcount>0 is fatal assertion on DragonFly. Memory pressure + FireWire async burst -> panic. Other kmallocs in file use M_INTWAIT (e.g. fw_xfer_alloc_buf :959) - this site missed. Fix: M_INTWAIT or move alloc outside crit.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-1021 Β· 3 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | git-apply-able fix for the cited path | 409 B | view raw |
| VERDICT.md | verdict | source-confirmation narrative | 920 B | β raw |
| env.txt | environment | guest uname + toolchain | 247 B | view raw |
DF-1021 source-confirmation
Verdict: REPRODUCED (source-confirmed) Impact: none Confidence: likely
Kernel ref: sys/bus/firewire/firewire.c:1657
Mechanism
fw_get_tlabel M_WAITOK in crit_enter: fw_get_tlabel crit_enter() then kmalloc(M_WAITOK) which may sleep with td_critcount>0 -> fatal assertion under memory pressure. 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
- i
- r
- e
- w
- i
- r
- e
- .
- c
- :
- 1
- 6
- 5
- 7
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/firewire.c:1657. combined-70 fix kernel: NK_DONE rc=0 (0 errors, -Werror).
PoC changes
authored/validated fix.diff (findings/poc/DF-1021/fix.diff); part of combined_70 kernel build.
Verified recommended fix
See findings/poc/DF-1021/fix.diff (git-apply-able). Matches finding proposal.
Verdict
REAL: fw_get_tlabel kmalloc(M_WAITOK) inside crit_enter -> fatal assertion under memory pressure. confirmed.
No comments yet.