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

dirfs_setattr chtimes ignores the requested va_atime/va_mtime entirely β€” lutimes(path, NULL) always stamps 'now' (utimensat/UTIME_OMIT semantics unimplemented)

Summary

The chtimes branch of dirfs_setattr (:556-568) passes the vnode to dirfs_node_chtimes, which calls lutimes(tmp, NULL) (dirfs_subr.c:661) - the times the caller supplied in vap are never read. Every utimes/utimensat/futimens on a dirfs file silently degrades to a 'touch'. Permission checking happens correctly at the syscall layer (NLC_OWN|NLC_WRITE), so this is a contract/integrity bug - the inverse-direction sibling of tmpfs DF-3024. Timestamp-sensitive tooling silently misbehaves on dirfs (tar -m/rsync -t restores, make -t, incremental backups - mtimes forged to 'now', defeating mtime-based change detection). Fix: pass the requested times through (tv[2] from vap, VA_UTIMES_NULL -> NULL) or fail EOPNOTSUPP on explicit times. [VERIFIED pass2: dead code same as DF-3058; chtimes contract breach code-certain]

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-3059 Β· 7 files
FileTypeDescriptionSize
README.md β€” 287 B ↓ raw
VERDICT.md β€” 916 B ↓ raw
env.txt β€” 248 B view raw
fix.diff β€” 144 B view raw
manifest.json β€” 593 B view raw
run.log β€” 197 B view raw
verdict.json β€” 1.1 KB view raw

DF-3059 - dirfs_setattr chtimes ignores requested atime/mtime (always stamps now)

Severity Low | verdict: not_reproduced | impact: none

Reproduce

No runnable PoC on this rig (see VERDICT.md for why).

See VERDICT.md for the full narrative and run.log for the decisive output.

VERDICT.md
↓ download raw

DF-3059 verification

Kernel: 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

Not executable on this rig for the same reason as DF-3058: dirfs is dead code (no Makefile, not built into any kernel or module, mount_dirfs refuses real kernels), so the lutimes(path, NULL)-always behavior (dirfs_subr.c:661 via dirfs_vnops.c:556-568) could not be exercised. Code-certain contract breach.

Kernel references

Fix

See fix.diff.

Fix status (batch validation)

Applied with the 36 sibling fix.diffs of this batch in findings/poc/_batch41/all_fixes.patch; single in-guest make -j6 nativekernel KERNCONF=X86_64_GENERIC completed RC=0 with zero errors under -Werror (full log: findings/poc/_batch41/fix_build8.log). Behavior A/B intentionally skipped for this Info-tier item.

Fix verification

not_testable
↓ fix.diffper-fix-DF-3059

Confirmed kernel references

Detail

Evidence (decisive lines)

VERDICT.md + run.log + sources

PoC changes

none

Verified recommended fix

diff: build tv[2] from vap->va_atime/va_mtime (VA_UTIMES_NULL -> NULL) and pass to lutimes; fail EOPNOTSUPP on explicit times if unsupported.

Verdict

Not executable on this rig for the same reason as DF-3058: dirfs is dead code (no Makefile, not built into any kernel or module, mount_dirfs refuses real kernels), so the lutimes(path, NULL)-always behavior (dirfs_subr.c:661 via dirfs_vnops.c:556-568) could not be exercised. Code-certain contract breach.