⬢ DragonFlyBSD Kernel Audit
DF-3026 / verdict.json
← back to finding ↓ download raw
{
 "finding_id": "DF-3026",
 "status": "reproduced",
 "reproduced": 1,
 "impact": "none",
 "confidence": "certain",
 "verdict": "Behaviorally reproduced with a differential control. As unprivileged user maxx: opened a tmpfs file O_WRONLY (plain), then root set SF_APPEND (chflags sappnd): a pwrite() at offset 0 (middle-of-file) SUCCEEDS on tmpfs (ret=1) while the identical sequence on a UFS filesystem returns EPERM (ufs_readwrite.c:239 per-write APPEND check). Phase 2: root set SF_IMMUTABLE (schg) - a write() through the pre-opened fd succeeds on tmpfs (and, notably, on UFS too: IMMUTABLE is open-time-only there, so only the APPEND half is a tmpfs-specific divergence). Administrator-intent bypass confirmed exactly as filed; no memory-safety impact.",
 "exploit_chain": "",
 "evidence": "VERDICT.md + run.log + sources",
 "kernel_refs": [
  "sys/vfs/tmpfs/tmpfs_vnops.c:268",
  "sys/vfs/tmpfs/tmpfs_vnops.c:666",
  "sys/kern/vfs_vnops.c:451"
 ],
 "poc_changes": "adjusted from finding sketch to guest syscall/layout reality",
 "attempts": 2,
 "guest_uname": "DragonFly dfbsd 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": 60,
 "guest_dirty": 0,
 "build_cmd": "guest: cc -O2 -o <bin> <src>.c -pthread",
 "run_cmd": "see README.md",
 "code_hash": "5ecdb6c50a4a066323af6c16fc65abf573c544a6fbe897bab78e1c55921bfdbf",
 "notes": "fix_status: fixed - A/B validated on the fix kernel: PHASE1 pwrite(mid) ret=-1 EPERM and PHASE2 write ret=-1 EPERM under sappnd/schg (baseline: both succeeded)",
 "recommended_fix": "fix.diff adds the UFS-exact per-write APPEND/IMMUTABLE checks to tmpfs_write near the VREG check; A/B validated on the fixed kernel (see VERDICT.md)."
}