HomeFreeBSD

Do comprehensive UFS/FFS superblock integrity checks when reading a superblock.

Description

Do comprehensive UFS/FFS superblock integrity checks when reading a superblock.

Historically only minimal checks were made of a superblock when it
was read in as it was assumed that fsck would have been run to
correct any errors before attempting to use the filesystem. Recently
several bug reports have been submitted reporting kernel panics
that can be triggered by deliberately corrupting filesystem superblocks,
see Bug 263979 - [meta] UFS / FFS / GEOM crash (panic) tracking
which is tracking the reported corruption bugs.

This change upgrades the checks that are performed. These additional
checks should prevent panics from a corrupted superblock. Although
it appears in only one place, the new code will apply to the kernel
modules and (through libufs) user applications that read in superblocks.

Reported by: Robert Morris and Neeraj
Reviewed by: kib
Tested by: Peter Holm
PR: 263979
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D35219

Details

Provenance
mckusickAuthored on May 27 2022, 7:21 PM
Reviewer
kib
Differential Revision
D35219: Comprehensive UFS/FFS superblock integrity checks made when a superblock is read
Parents
rGeca6e0f7e460: Apply clang fix for assertion failure building webkit2-gtk
Branches
Unknown
Tags
Unknown