Created attachment 226783 [details] A FAT12 file system image that crashes fsck_msdosfs I've attached a FAT12 image, fat.dat, that crashes fsck_msdosfs: % fsck_msdosfs /tmp/fat.dat ** /tmp/fat.dat ** Phase 1 - Read FAT and checking connectivity Bus error % uname -a FreeBSD xxx 13.0-RELEASE-p3 FreeBSD 13.0-RELEASE-p3 #0: Tue Jun 29 19:46:20 UTC 2021 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 The problem seems to be that fat.dat has a FATsecs and bpbBytesPerSec that multiply to more than the size of fat.dat; fsck_msdosfs calls mmap() with that huge offset; mmap() returns a pointer (not MAP_FAILED); fsck_msdosfs uses that pointer, but there's nothing there but a bus error.