freebsd-dev/sys/ufs/ffs
Kirk McKusick fdf34aa3a5 The error reported in FS-14-UFS-3 can only happen on UFS/FFS
filesystems that have block pointers that are out-of-range for their
filesystem. These out-of-range block pointers are corrected by
fsck(8) so are only encountered when an unchecked filesystem is
mounted.

A new "untrusted" flag has been added to the generic mount interface
that can be set when mounting media of unknown provenance or integrity.
For example, a daemon that automounts a filesystem on a flash drive
when it is plugged into a system.

This commit adds a test to UFS/FFS that validates all block numbers
before using them. Because checking for out-of-range blocks adds
unnecessary overhead to normal operation, the tests are only done
when the filesystem is mounted as an "untrusted" filesystem.

Reported by:  Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
Reported as:  FS-14-UFS-3: Out of bounds read in write-2 (ffs_alloccg)
Reviewed by:  kib
Sponsored by: Netflix
2019-07-17 22:07:43 +00:00
..
ffs_alloc.c The error reported in FS-14-UFS-3 can only happen on UFS/FFS 2019-07-17 22:07:43 +00:00
ffs_balloc.c The error reported in FS-14-UFS-3 can only happen on UFS/FFS 2019-07-17 22:07:43 +00:00
ffs_extern.h The error reported in FS-14-UFS-3 can only happen on UFS/FFS 2019-07-17 22:07:43 +00:00
ffs_inode.c Remove "struct ucred*" argument from vtruncbuf 2019-05-24 20:27:50 +00:00
ffs_rawread.c Allocate pager bufs from UMA instead of 80-ish mutex protected linked list. 2019-01-15 01:02:16 +00:00
ffs_snapshot.c Separate kernel crc32() implementation to its own header (gsb_crc32.h) and 2019-06-17 19:49:08 +00:00
ffs_softdep.c The error reported in FS-14-UFS-3 can only happen on UFS/FFS 2019-07-17 22:07:43 +00:00
ffs_subr.c The error reported in FS-14-UFS-3 can only happen on UFS/FFS 2019-07-17 22:07:43 +00:00
ffs_suspend.c Avoid assertion in /dev/ufssuspend when the suspend ioctl is 2018-08-01 19:06:55 +00:00
ffs_tables.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
ffs_vfsops.c The error reported in FS-14-UFS-3 can only happen on UFS/FFS 2019-07-17 22:07:43 +00:00
ffs_vnops.c FFS: allow sendfile(2) to work with block sizes greater than the page size 2019-02-26 04:56:10 +00:00
fs.h After a crash, a file that extends into indirect blocks may end up 2019-02-25 21:58:19 +00:00
softdep.h Convert use of UFS-specific #ifdef DEBUG to DIAGNOSTIC or INVARIANTS 2019-05-28 16:32:04 +00:00