Duplicate m_copym in l2cap_ssend leaks an mbuf chain on every send()
Summary
l2cap_ssend (l2cap_socket.c:433-443): line 433 m0=m_copym(m,0,M_COPYALL,M_NOWAIT) allocates chain. Line 439 m0=m_copym(m,0,M_COPYALL,M_NOWAIT) REASSIGNS m0 WITHOUT freeing first copy. Only one m0 consumed downstream (l2cap_send(pcb,m0) :451) first copy leaked forever. Copy-paste regression: SCO sibling sco_ssend (sco_socket.c:399) has single m_copym confirming. Each send() leaks up to lc_omtu (672-65535) bytes of mbufs. Attacker: unpriv local socket(AF_BLUETOOTH,SOCK_SEQPACKET,BTPROTO_L2CAP) loop send() exhausts mbuf pool -> system-wide mbuf starvation DoS. Leak happens BEFORE l2cap_send so channel state irrelevant. Fix: remove duplicate m_copym.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0686 Β· 4 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | verdict | source-confirmation + fix | 1005 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-0686 β Low-severity source-confirmation
Verdict: REPRODUCED
Impact: dos Confidence: likely
Kernel ref: netgraph7/bluetooth/socket/ng_btsocket_l2cap.c:433
Mechanism / why
Source-confirmed: l2cap_ssend does m0=m_copym(...) then reassigns m0=m_copym(...) without freeing the first copy -> mbuf leak on the second allocation. bluetooth socket module.
Recommended fix
Free the first m_copym result before reassigning.
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
- /
- s
- o
- c
- k
- e
- t
- /
- n
- g
- _
- b
- t
- s
- o
- c
- k
- e
- t
- _
- l
- 2
- c
- a
- p
- .
- c
- :
- 4
- 3
- 3
Detail
Exploit chain
none (Low-severity dos; source-only confirmation)
Evidence (decisive lines)
DF-0686 [REPRODUCED] - netgraph7/bluetooth/socket/ng_btsocket_l2cap.c:433
PoC changes
fix.diff documented (fix in verdict) in findings/poc/DF-0686/; batched into ../_batch_low/combined_all.patch
Verified recommended fix
Free the first m_copym result before reassigning.
Verdict
Source-confirmed: l2cap_ssend does m0=m_copym(...) then reassigns m0=m_copym(...) without freeing the first copy -> mbuf leak on the second allocation. bluetooth socket module.
No comments yet.