{
  "finding_id": "DF-5764",
  "status": "reproduced",
  "reproduced": true,
  "impact": "dos",
  "confidence": "certain",
  "verdict": "l2cap_start() (sys/netbt/l2cap_lower.c:203-204) increments chan->lc_pending before the fallible hci_acl_send(); on failure (production ENETDOWN branch hci_link.c:546-549 or ENOMEM hci_link.c:551-599) the mbuf is freed and NO l2cap_pdu is created, and lc_pending is only ever decremented for a PDU found on hl_txq with lp_chan==chan (hci_link.c:730-742) -- so the counter is permanently inflated and COMPOUNDS on every later l2cap_start() caller. All three lc_pending==0 gates then never fire: l2cap_send() (l2cap_upper.c:398) silently accepts every further send(2) into lc_txq (permanent TX blackhole), l2cap_disconnect(linger) (l2cap_upper.c:244) never starts the graceful disconnect handshake, and the L2CAP_SHUTDOWN flush (l2cap_lower.c:173-179) is unreachable. Proven with a KLD rig compiling VERBATIM production l2cap_upper.c/l2cap_lower.c/l2cap_misc.c/l2cap_signal.c/hci_link.c: wedge round asserts every stage (W1 phantom count, W2 64 blackholed SDUs, W3 dead handshake, W4 compounding to 2), control round proves the healthy 1->0 round-trip works. fix.diff (increment only on success) flips wedge_proven 1->0 with ctl_ok unchanged. Severity Low: no memory corruption, stuck mbufs bounded by so_snd (l2cap_ssend keeps the original in the socket send buffer), recovery via close(2).",
  "exploit_chain": "established (L2CAP_OPEN) channel + any single hci_acl_send failure while OPEN -- ENOMEM under memory pressure, or ENETDOWN in the link-teardown window (co-fires with DF-5737s race) -> lc_pending permanently > 0 -> silent send(2) blackhole for the connection + graceful disconnect disabled until force-close(2). No escalation path (no corruption primitive).",
  "evidence": "findings/poc/DF-5764/run.log decisive lines: W1 send#1 ret=50 (ENETDOWN=50) lc_pending=1 link_txq_empty=1 lc_txq_len=0, W2 64 more sends: ret==0 all, lc_txq_len=64 (blackholed) lc_pending=1, W3 l2cap_disconnect(linger) ret=0 state=5 (OPEN=5) reqs_empty=1, W4 l2cap_start ret=50 lc_txq_len=63 lc_pending=2, WEDGE ROUND PROVEN (assertion failures: 0), CONTROL ROUND OK. fix_run.log: W1 lc_pending=0, W2 lc_txq_len=0, W3 state=0 (CLOSED), WEDGE ROUND NOT proven, CONTROL ROUND OK, hw.l2pw_wedge_proven=0 / hw.l2pw_ctl_ok=1.",
  "kernel_refs": [
    "sys/netbt/l2cap_lower.c:195",
    "sys/netbt/l2cap_lower.c:203",
    "sys/netbt/l2cap_lower.c:204",
    "sys/netbt/l2cap_upper.c:398",
    "sys/netbt/l2cap_upper.c:244",
    "sys/netbt/hci_link.c:546",
    "sys/netbt/hci_link.c:730"
  ],
  "poc_changes": "Authored from scratch (no seed): KLD rig per the proven DF-5749 pattern, extended to compile hci_link.c VERBATIM so the hci_acl_send ENETDOWN failure branch under test is production code. Iterations during bring-up: added symbol-only stubs (sco_detach, hci_unit_lookup, hci_route_lookup, hci_memo_find, hci_memo_new, bluetooth_debug, sco_pcb list), flat _hw SYSCTL_PROC names (DF KLDs), and recalibrated W4 to assert the compounding behavior (retry raises pending 1->2, burns another SDU) which the first run revealed is worse than the initial prediction.",
  "attempts": 7,
  "guest_uname": "DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026     root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64",
  "runtime_sec": 480,
  "guest_dirty": 0,
  "build_cmd": "cd /root/l2pw && ./build.sh",
  "run_cmd": "cd /root/l2pw && ./run.sh",
  "code_hash": "4f6ce8ac3fcf9d0cccc0ca7fccde17afcec048766d01aa555c81e999d3a433bd",
  "notes": "Fix validated by patching the guests /usr/src/sys/netbt/l2cap_lower.c with fix.diff, rebuilding the module from the re-copied verbatim source, and re-running the exact PoC. Guest restored via vm.sh reset with-src afterwards (source md5 verified pristine 8747127e5589a0195e13a289ba16b9cb, rig gone). Trigger framing: the ENETDOWN-teardown-race WINDOW itself is DF-5737s (not re-reported); this finding is the error-path accounting defect that makes ANY hci_acl_send failure permanent for the channel.",
  "recommended_fix": "In l2cap_start(), only count the PDU when one was created: assign err = hci_acl_send(...) and increment chan->lc_pending only when err == 0 (see fix.diff).",
  "fix_status": "fixed",
  "fix_baseline_reproduced": true,
  "fix_patched_reproduced": false,
  "fix_verdict": "fix.diff applied to guest /usr/src/sys/netbt/l2cap_lower.c, module rebuilt from re-copied verbatim source, exact PoC re-run: every wedge behavior is GONE (lc_pending stays 0 after the failed send; further sends return honest ENETDOWN with lc_txq empty; l2cap_disconnect(linger) now reaches the handshake and the channel closes; retry no longer compounds) while the control round still passes (healthy 1->0 round-trip intact, no regression). hw.l2pw_wedge_proven: 1 -> 0; hw.l2pw_ctl_ok: 1 -> 1.",
  "fix_evidence": "findings/poc/DF-5764/fix_run.log: W1 send#1 ret=50 (ENETDOWN=50) lc_pending=0, W2 64 more sends: ret==0 all, lc_txq_len=0, W3 l2cap_disconnect(linger) ret=50 state=0 (OPEN=5), WEDGE ROUND NOT proven (assertion failures: 5), CONTROL ROUND OK (assertion failures: 0), wedge_proven = 0 / ctl_ok = 1."
}