[Bug 257768] Corrupt UDF disk image can cause crash when mounted.

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 11 Aug 2021 13:19:25 +0000
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257768

            Bug ID: 257768
           Summary: Corrupt UDF disk image can cause crash when mounted.
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs_at_FreeBSD.org
          Reporter: rtm_at_lcs.mit.edu

If a corrupt (or malicious) UDF disk contains root_icb.len -2032,
udf_mountfs() ends up passing a size of zero to breadn_flags(),
which causes it to return a bp with an unmapped b_data, which causes
udf_mountfs()/udf_checktag() to pagefault. You can see this with the
attached UDF image, using

  mdconfig -f bad-udf.iso
  mount_udf /dev/md0 /mnt

which yields (on my amd64 13.0-RELEASE-p3 machine):

panic: vm_fault_lookup: fault on nofault entry, addr: 0xfffffe0009cd8000
cpuid = 0
time = 1628673343
KDB: stack backtrace:
#0 0xffffffff80c57515 at kdb_backtrace+0x65
#1 0xffffffff80c09ef1 at vpanic+0x181
#2 0xffffffff80c09d63 at panic+0x43
#3 0xffffffff80f289db at vm_fault+0x144b
#4 0xffffffff80f274b1 at vm_fault_trap+0xb1
#5 0xffffffff8108b3b8 at trap_pfault+0x1f8
#6 0xffffffff8108a86d at trap+0x27d
#7 0xffffffff810619a8 at calltrap+0x8
#8 0xffffffff80cdaa09 at vfs_domount+0x5e9
#9 0xffffffff80cd9c27 at vfs_donmount+0x8e7
#10 0xffffffff80cd9309 at sys_nmount+0x69
#11 0xffffffff8108babc at amd64_syscall+0x10c
#12 0xffffffff810622ce at fast_syscall_common+0xf8

-- 
You are receiving this mail because:
You are the assignee for the bug.
Received on Wed Aug 11 2021 - 13:19:25 UTC

Original text of this message