hci_complete_sco enqueues to hci_scodone without bounds check (kernel memory exhaustion DoS)
Summary
hci_complete_sco (:538-544): IF_ENQUEUE(&unit->hci_scodone,m) netisr_queue(NETISR_BLUETOOTH,m) NO bounds check. Inconsistent with hci_input_event/acl/sco (:429/451/473) which all check len>hci_*_max before enqueue. hci_scodone.ifq_maxlen set to hci_scodone_max(50) :108 but IF_ENQUEUE (if_var.h:484) does NOT consult ifq_maxlen only IFQ_ENQUEUE does. Buggy/malicious driver or crafted USB BT controller flooding SCO completions grows hci_scodone without bound exhausting kernel mbuf/KVA. hci_intr loop :334-411 spins goto another for each scodone entry amplifying CPU-starvation. Fix: add if(hci_scodone.ifq_len>=ifq_maxlen) m_freem else IF_ENQUEUE.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0684 Β· 4 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | verdict | source-confirmation + fix | 982 B | β 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-0684 β Low-severity source-confirmation
Verdict: REPRODUCED
Impact: dos Confidence: likely
Kernel ref: netgraph7/bluetooth/hci/ng_hci_misc.c:538
Mechanism / why
Source-confirmed: hci_complete_sco does IF_ENQUEUE/netisr_queue with no bounds check, unlike the other hci_input_* paths. bluetooth/hci module.
Recommended fix
Add the bounds/queue-length check used by the other hci input paths.
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).
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
- g
- r
- a
- p
- h
- 7
- /
- b
- l
- u
- e
- t
- o
- o
- t
- h
- /
- h
- c
- i
- /
- n
- g
- _
- h
- c
- i
- _
- m
- i
- s
- c
- .
- c
- :
- 5
- 3
- 8
Detail
Exploit chain
none (Low-severity dos; source-only confirmation)
Evidence (decisive lines)
DF-0684 [REPRODUCED] - netgraph7/bluetooth/hci/ng_hci_misc.c:538
PoC changes
fix.diff documented (fix in verdict) in findings/poc/DF-0684/; batched into ../_batch_low/combined_all.patch
Verified recommended fix
Add the bounds/queue-length check used by the other hci input paths.
Verdict
Source-confirmed: hci_complete_sco does IF_ENQUEUE/netisr_queue with no bounds check, unlike the other hci_input_* paths. bluetooth/hci module.
No comments yet.