hardware_error and data_buffer_overflow: missing NG_HCI_M_PULLUP + length check on 1-byte body
Summary
hardware_error(:826-837) and data_buffer_overflow(:976-987) never call NG_HCI_M_PULLUP never check mbuf contains the single byte they dereference. *mtod(event,u_int8_t*)(:832/:982) on 0-length body -> m_adj zeroed m_len but m_data still valid -> reads stale/uninit leftover mbuf buffer byte. Fed into kprintf format(:832)/ternary log label(:982). No crash (m_adj leaves m_data valid) but unvalidated attacker-influenced content as kernel value. Inconsistent with all sibling handlers which use NG_HCI_M_PULLUP. Fix: NG_HCI_M_PULLUP(event,sizeof(u_int8_t)).
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0544 Β· 5 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | Length-check the event mbuf before the single-byte dereference. | 759 B | view raw |
| VERDICT.md | verdict | source-confirmation + fix | 1.0 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-0544 β Low-severity source-confirmation
Verdict: REPRODUCED
Impact: panic Confidence: likely
Kernel ref: netgraph7/bluetooth/hci/ng_hci_evnt.c:826
Mechanism / why
Source-confirmed: hci hardware_error/data_buffer_overflow deref *mtod(event) for one byte with no length check -> OOB on a short event mbuf. Module-only.
Recommended fix
Length-check the event mbuf before the single-byte dereference.
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
- g
- r
- a
- p
- h
- 7
- /
- b
- l
- u
- e
- t
- o
- o
- t
- h
- /
- h
- c
- i
- /
- n
- g
- _
- h
- c
- i
- _
- e
- v
- n
- t
- .
- c
- :
- 8
- 2
- 6
Detail
Exploit chain
none (Low-severity panic; source-only confirmation)
Evidence (decisive lines)
DF-0544 [REPRODUCED] - netgraph7/bluetooth/hci/ng_hci_evnt.c:826
PoC changes
fix.diff present in findings/poc/DF-0544/; batched into ../_batch_low/combined_all.patch
Verified recommended fix
Length-check the event mbuf before the single-byte dereference.
Verdict
Source-confirmed: hci hardware_error/data_buffer_overflow deref *mtod(event) for one byte with no length check -> OOB on a short event mbuf. Module-only.
No comments yet.