⬢ DragonFlyBSD Kernel Audit
DF-3226 / verdict.json
← back to finding ↓ download raw
{
  "finding_id": "DF-3226",
  "status": "reproduced",
  "reproduced": 1,
  "impact": "none",
  "confidence": "certain",
  "verdict": "REPRODUCED on DragonFly 6.5-DEVELOPMENT #0, two boots. procfs_control() exempts DETACH from ALL authorization (procfs_ctl.c:122), so any process that can open /proc/<victim>/ctl (any same-euid bystander; mode 0200 owner=target euid) can, without ever being the tracer, clear P_TRACED, delete the pending SIGTRAP, reparent the victim to p_oppid, clear P_WAITED and unstop it \u2014 silently terminating an active tracers session (demonstrated: bystander Ds detach accepted; tracer Ts subsequent ctl step/run fail EBUSY). Secondary: wakeup((caddr_t) curp) at :223 wakes the detachers pointer while a blocked CTL_WAIT tracer sleeps on (caddr_t) p (:258), so third-party detaches never wake it. Impact is same-euid interference with debugging/monitoring (sandbox-style) sessions; same-uid kill(2) already allows coarser damage, hence Low/impact none among the standard classes. Fix validated: with DETACH restricted to the current tracer (mirroring PT_DETACH), the bystander gets EPERM and the tracers session survives.",
  "exploit_chain": "",
  "evidence": "run.log/run.2.log: [D 1102] bystander writes detach to /proc/1100/ctl, [D] DETACH ACCEPTED with no authorization, [T] ctl step V #1 after interference: failed: Device busy, [T] ctl run V: failed: Device busy. run.fixed2.log (patched): [D] detach failed: Operation not permitted, [T] ctl step V #1 ... ok.",
  "kernel_refs": [
    "sys/vfs/procfs/procfs_ctl.c:122",
    "sys/vfs/procfs/procfs_ctl.c:197",
    "sys/vfs/procfs/procfs_ctl.c:199",
    "sys/vfs/procfs/procfs_ctl.c:203",
    "sys/vfs/procfs/procfs_ctl.c:206",
    "sys/vfs/procfs/procfs_ctl.c:211",
    "sys/vfs/procfs/procfs_ctl.c:223",
    "sys/vfs/procfs/procfs_ctl.c:258",
    "sys/kern/sys_process.c:250"
  ],
  "poc_changes": "PoC written fresh (tracer T, victim V, bystander D, all uid 1001).",
  "attempts": 2,
  "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": 180,
  "guest_dirty": 0,
  "build_cmd": "cc -O -o df3226 df3226.c",
  "run_cmd": "./df3226",
  "code_hash": "d676c8d5d97d6a907d9544cfe13617c9885866d6682a5dc821f40b0ad2769e35",
  "notes": "Fix iteration matters here: v1 (apply CHECKIO/p_trespass to non-tracer DETACH) was insufficient \u2014 CHECKIO legitimately passes for same-uid bystanders, and run.fixed.log still showed DETACH ACCEPTED. v2 restricts DETACH of a traced process to the current tracer (p->p_pptr == curp), mirroring PT_DETACH at sys_process.c:250-262, and keeps the no-op path for untraced targets; validated on the second patched kernel (run.fixed2.log).",
  "recommended_fix": "Restrict DETACH of a P_TRACED process to the current tracer (p->p_pptr == curp), mirroring PT_DETACH; wakeup((caddr_t) p) instead of curp for CTL_WAIT.",
  "fix_status": "fixed",
  "fix_kernel_uname": "DragonFly dfbsd 6.5-DEVELOPMENT #1: Tue Sep  8 20:08:46 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64",
  "fix_baseline_reproduced": 1,
  "fix_patched_reproduced": 0,
  "fix_verdict": "Baseline: bystander detach accepted, tracer session destroyed (EBUSY afterwards). Patched v2: bystander detach refused EPERM, tracers step succeeds (run.fixed2.log).",
  "fix_evidence": "findings/poc/DF-3226/run.fixed2.log (v2 pass); run.fixed.log kept as the documented v1-insufficient iteration"
}