DragonFlyBSD Kernel Audit
DF-0932 / fix_run.log
← back to finding ↓ download raw
=== DF-0932 FIX VALIDATION — patched ntfs.ko ===

Setup: DragonFly 6.5-DEVELOPMENT #0 (kernel unchanged) + freshly-built
ntfs.ko with fix.diff applied (return 0 when pos+boff<0 in ntfs_uncompblock).

  /boot/kernel/ntfs.ko sha256: 54431edf1877ca5fae7ffce59589a369225063cfd7f1ee4e0a264ae9db9e1101
  source sha256 (ntfs_compr.c after patch): see VERDICT.md

--- root cat /mnt/evil/F ---
cat: /mnt/evil/F: Invalid argument
RC=1

--- maxx (uid 1001) cat /mnt/evil/F ---
$ id
uid=1001(maxx) gid=1001(maxx) groups=1001(maxx)
$ cat /mnt/evil/F
cat: /mnt/evil/F: Invalid argument
MAXX_CAT_RC=1

--- maxx dd ---
$ dd if=/mnt/evil/F of=/tmp/maxx.patched bs=64 count=1
dd: /mnt/evil/F: Invalid argument
0+0 records in
0+0 records out
0 bytes transferred in 0.004430 secs (0 bytes/sec)
MAXX_DD_RC=1
-rw-r--r--  1 maxx  wheel  0 Jul  7 09:23 /tmp/maxx.patched

=== BEFORE/AFTER COMPARISON ===

BEFORE (unpatched ntfs.ko, sha256 aa8d83843b...):
  $ cat /mnt/evil/F | head -c 16 | od -An -tx1
   00 70 bd 00 08 00 00 00 c0 34 6a 00 08 00 00 00
  RC=0, 4096 bytes returned.  Bytes 0..15 are KERNEL HEAP pointers
  (0x0008_00bd_7000, 0x0008_006a_34c0) leaked from the slab neighbour
  of uup via the unchecked LZ77 back-reference displacement.

AFTER (patched ntfs.ko, sha256 54431edf18...):
  $ cat /mnt/evil/F
  cat: /mnt/evil/F: Invalid argument
  RC=1, 0 bytes returned.  ntfs_uncompblock returns 0 -> ntfs_uncompunit
  returns EINVAL -> ntfs_readattr returns EINVAL -> read(2) returns EINVAL.
  The malformed compressed block is REJECTED; no bytes are decompressed
  or shipped to user.

=> fix.diff CLOSES the LZ77 underflow info leak.