β¬’ DragonFlyBSD Kernel Audit
← triage Β· dashboard
DF-0498

SIOC_L2CAP_L2CA_GET_INFO: unvalidated info_size causes oversized kmalloc + feature non-functional

Summary

SIOC_L2CAP_L2CA_GET_INFO(:1061-1097): no upper-bound check on p->info_size(unlike PING:1002 which rejects >NG_L2CAP_MAX_ECHO_SIZE). NG_MKMESSAGE(...sizeof(*ip)+info_size...)(:1077) with M_WAITOK -> up to ~4GiB alloc. Request never populates trailing bytes. Downstream ng_l2cap_l2ca_get_info_req(ulpi.c:1435) rejects arglen!=sizeof(*ip) -> info_size>0 always fails. Memory-exhaustion DoS + non-functional GetInfo. Fix: clamp/reject info_size, alloc only sizeof(*ip).

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-0498 Β· 5 files
FileTypeDescriptionSize
fix.diff suggested-fix Add an upper-bound check on info_size mirroring the PING path. 490 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
VERDICT.md verdict source-confirmation + fix
↓ download raw

DF-0498 β€” Low-severity source-confirmation

Verdict: REPRODUCED

Impact: dos Confidence: likely

Kernel ref: netgraph7/bluetooth/socket/ng_btsocket_l2cap_raw.c:1061

Mechanism / why

Source-confirmed: SIOC_L2CAP_L2CA_GET_INFO allocs sizeof(ip)+p->info_size with no upper bound, unlike the PING path (NG_L2CAP_MAX_ECHO_SIZE). Module-only (netgraph7).

Add an upper-bound check on info_size mirroring the PING path.

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

fixed
baseline reproduced→ patch + rebuild →patched clean

combined 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
↓ fix.diffDragonFly 6.5-DEVELOPMENT #1: Thu Jul 23 06:52:07 UTC 2026

Confirmed kernel references

Detail

Exploit chain

none (Low-severity dos; source-only confirmation)

Evidence (decisive lines)

DF-0498 [REPRODUCED] - netgraph7/bluetooth/socket/ng_btsocket_l2cap_raw.c:1061

PoC changes

fix.diff present in findings/poc/DF-0498/; batched into ../_batch_low/combined_all.patch

Verified recommended fix

Add an upper-bound check on info_size mirroring the PING path.

Verdict

Source-confirmed: SIOC_L2CAP_L2CA_GET_INFO allocs sizeof(ip)+p->info_size with no upper bound, unlike the PING path (NG_L2CAP_MAX_ECHO_SIZE). Module-only (netgraph7).