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

sys/netgraph7/ng_device.c is non-compilable, unwired FreeBSD-port rot (all defects latent)

Summary

Guest-verified: an out-of-tree kmod build of the unmodified file produces 64 errors (struct cdevsw members, D_VERSION/MTX_DEF undeclared, ifq_mtx, msleep, m_uiotombuf etc.). It is absent from sys/netgraph7/Makefile SUBDIR, gated by 'optional netgraph7_device' which no kernel config defines, and /boot/kernel/ng_device.ko does not exist. The v1 twin is likewise unwired. Every defect in this file (DF-3547, DF-3548) is unreachable until the port is completed - or the file deleted. Platform fact recorded; it silently accumulates CVE-able patterns that activate the moment someone completes the port without the lifetime fix.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-3549 Β· 2 files
FileTypeDescriptionSize
README.md file 1.5 KB ↓ raw
verdict.json file 1.6 KB view raw
README.md file
↓ download raw

DF-3549 β€” sys/netgraph7/ng_device.c is non-compilable, unwired FreeBSD-port rot

Info-level finding documenting why DF-3547/DF-3548 (and any future bug in this file) are latent only:

  1. Does not compile. Guest-verified out-of-tree kmod build: 64 errors β€” struct cdevsw has no member d_open/d_close/d_read/d_write/d_poll/d_name, unknown type name 'd_poll_t', D_VERSION undeclared, MTX_DEF undeclared, struct ifqueue has no member 'ifq_mtx', implicit declaration of IF_LOCK, _IF_QFULL, IFQ_SET_MAXLEN, IFQ_IS_EMPTY, msleep, unit2minor, m_uiotombuf (full log: ../DF-3547/build.log). None of these FreeBSD primitives exist anywhere in DragonFly headers.
  2. Wired into no build. sys/netgraph7/Makefile SUBDIR has no device entry; sys/conf/files:1699 gates it behind optional netgraph7_device; no kernel config in the tree defines NETGRAPH7_DEVICE (sys/conf/options:302 is the only reference).
  3. The v1 twin sys/netgraph/ng_device.c is likewise absent from sys/conf/files and sys/netgraph/Makefile (both variants dead since their respective imports).

Recommendation: either complete the DragonFly port (struct dev_ops-based cdevsw, DF sleep/queue primitives, plus the DF-3547 lifetime fix) and wire it into the module Makefile, or delete the file. As it stands it silently rots and gathers unverifiable CVE-able patterns.

Phase V: skipped (Info; the "verification" of this finding is the compile log in ../DF-3547/build.log plus env.txt).

Fix verification

not_testable
baseline no→ patch + rebuild →patched clean

not_applicable β€” Info documentation finding

n/a
per-fix-DF-3549

Confirmed kernel references

Detail

Evidence (decisive lines)

../DF-3547/build.log (compile failure), ../DF-3547/env.txt (module absence, config grep)

PoC changes

n/a

Verified recommended fix

Complete the FreeBSD->DragonFly port (dev_ops cdevsw, DF sleep/queue primitives, DF-3547 lifetime fix) and add 'device' to sys/netgraph7/Makefile SUBDIR β€” or remove the file.

Verdict

SKIPPED per contract (Info). Fact verified directly on the guest and host: sys/netgraph7/ng_device.c cannot compile against DragonFly headers (64-error kmod build log in ../DF-3547/build.log) and is wired into no build (no SUBDIR in sys/netgraph7/Makefile; optional netgraph7_device never enabled in any kernel config; /boot/kernel/ng_device.ko absent). All defects in this file (DF-3547, DF-3548) are therefore latent until the port is completed or the file deleted.