]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Continuing efforts to provide hardening of FFS, this change adds a
authormckusick <mckusick@FreeBSD.org>
Tue, 23 Oct 2018 21:10:06 +0000 (21:10 +0000)
committermckusick <mckusick@FreeBSD.org>
Tue, 23 Oct 2018 21:10:06 +0000 (21:10 +0000)
commitce1bca43e9a141e69ca544ff1cc913398d3bcfbb
tree0f51492bb043f6e2c716b9eba95af4631be6c024
parent1d618354943096f676f00864f227a0f2c278c022
Continuing efforts to provide hardening of FFS, this change adds a
check hash to the superblock. If a check hash fails when an attempt
is made to mount a filesystem, the mount fails with EINVAL (Invalid
argument). This avoids a class of filesystem panics related to
corrupted superblocks. The hash is done using crc32c.

Check hases are added only to UFS2 and not to UFS1 as UFS1 is primarily
used in embedded systems with small memories and low-powered processors
which need as light-weight a filesystem as possible.

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: Netflix
sbin/fsck_ffs/main.c
sbin/newfs/mkfs.c
sys/sys/param.h
sys/ufs/ffs/ffs_subr.c
sys/ufs/ffs/ffs_vfsops.c
sys/ufs/ffs/fs.h