DF-0789 / fix_run.log
=== DF-0789 FIX VALIDATION (Phase 8) ===
Kernel: DragonFly 6.5-DEVELOPMENT #0 (with-src base)
Fix: ntfs_runtovrun() bounded by runlen parameter (ntfs_subr.c:582)
Caller ntfs_attrtontvattr() passes (reclen - a_dataoff) as runlen
Both loops (count at :601, decode at :621) now check off < runlen
Entry-straddle check: off + adv > runlen โ EINVAL
Build: standalone ntfs.ko (make in sys/vfs/ntfs/), MAKE_RC=0, 0 errors
--- BEFORE (unpatched ntfs.ko, kernel #0) ---
Test image: ntfs_0789_isolated.img
ino 0 $DATA: run list = 24 bytes of 0x22 (no terminator, 5-byte entries)
attr reclen=88, a_dataoff=64 โ runlen=24 (if it were passed)
Outer attribute walk properly bounded (correct reclen + end marker)
โ isolates DF-0789 from sibling DF-0787
Result: mount_ntfs SUCCEEDS (MOUNT_RC=0)
ntfs_runtovrun walks past 24-byte run-list extent into end-marker/zeros,
reads garbage, returns SUCCESS with corrupt run data.
Since system nodes (ino<11) read directly from disk, mount proceeds.
Guest stays UP (corruption is latent).
Compound image (ntfs_0789.img, fills entire record with 0x11):
mount_ntfs PANICS the guest โ "NTFS vattr: malloc limit exceeded"
through ntfs_attrtontvattr โ ntfs_runtovrun โ ntfs_loadntode.
(This compounds DF-0789's inner OOB walk with DF-0787's outer OOB walk.)
--- AFTER (patched ntfs.ko, kernel #0 โ only ntfs.ko rebuilt) ---
test 1: ISOLATED image (DF-0789 trigger)
mount_ntfs: /dev/vn0: Invalid argument
ISOLATED_MOUNT_RC=71
ntfs_runtovrun: malformed run list at offset 20
test 2: CLEAN image (regression check)
CLEAN_MOUNT_RC=0
guest_status: up