DragonFlyBSD Kernel Audit
DF-0790 / fix_run.log
← back to finding ↓ download raw
=== DF-0790 FIX VALIDATION (Phase 8) ===
Guest: DragonFly 6.5-DEVELOPMENT #0 (default GENERIC, INVARIANTS ON)
Module: /boot/kernel/ntfs.ko rebuilt from patched sys/vfs/ntfs/ntfs_subr.c

=== BEFORE (unpatched ntfs.ko, kernel #0) ===
$ vnconfig -c vn0 /root/ntfs_0790_mount_loop.img && mount_ntfs -o ro /dev/vn0 /mnt/ntfs
  -> mount(2) NEVER RETURNS. ssh command timed out after 30s (rc=124).
     Guest completely wedged (subsequent ssh status check also timed out).
     Kernel spinning at 100% CPU in ntfs_ntvattrget ATTRLIST walk (reclen==0).
     SERIAL LOG: no panic (CWE-835 infinite loop, not a crash); clean boot
     followed by the mount command hanging forever. Confirmed local DoS.

=== AFTER (patched ntfs.ko, same kernel #0) ===
$ vnconfig -c vn0 /root/ntfs_0790_mount_loop.img && mount_ntfs -o ro /dev/vn0 /mnt/ntfs
mount_ntfs: /dev/vn0: Invalid argument
MOUNT_RC=71
PATCHED_TIMEOUT_RC=0      (returned in <1 second — NO HANG)
guest status: up          (guest fully responsive)

dmesg:
  ntfs_ntvattrget: malformed attrlist entry (reclen 0, len 26)

=== NULL variant on patched module (reclen>len → was potential NULL deref panic) ===
$ mount_ntfs -o ro /dev/vn2 /mnt/ntfs2   (ntfs_0790_mount_null.img)
mount_ntfs: /dev/vn2: Invalid argument
MOUNT_RC=71   (returned immediately, guest UP)

dmesg:
  ntfs_ntvattrget: malformed attrlist entry (reclen 32, len 26)

=== REGRESSION CHECK: clean NTFS image still mounts ===
$ mount_ntfs -o ro /dev/vn1 /mnt/ntfs   (clean DF-0786 ntfs.img)
MOUNT_RC=0
/dev/vn1 on /mnt/ntfs (ntfs, read-only, local)
  (mount succeeds; subsequent ls hits the pre-existing DF-0786 lockmgr bug,
   which is unrelated to this fix)

=== VERDICT ===
The fix closes both malformed-ATTRLIST-entry branches (reclen==0 infinite loop
and reclen>len NULL-deref-underflow) on the default GENERIC kernel. The mount
of a crafted image now fails cleanly with EINVAL in <1s instead of hanging the
kernel forever. Valid images still mount without regression.
DragonFly 6.5-DEVELOPMENT #0: Thu Jul  2 06:02:54 UTC 2026
SHA256 (/boot/kernel/ntfs.ko) = a3a5e498f73f4cbdbad3ee760499df7565d9ddc3f363f2e46e6d43a9966d7a02