git: eefbecaab1b1 - stable/13 - Updates to UFS/FFS superblock integrity checks when reading a superblock.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 19 May 2023 23:54:25 UTC
The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=eefbecaab1b10c5a587bf1292e585ef480f81d71 commit eefbecaab1b10c5a587bf1292e585ef480f81d71 Author: Kirk McKusick <mckusick@FreeBSD.org> AuthorDate: 2023-04-29 18:52:27 +0000 Commit: Kirk McKusick <mckusick@FreeBSD.org> CommitDate: 2023-05-19 22:51:27 +0000 Updates to UFS/FFS superblock integrity checks when reading a superblock. (cherry picked from commit a2d1957bbcc87b499526df8d99ec7e1ddd2193c0) --- sys/ufs/ffs/ffs_subr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index d847373a8cde..1bd298315dd9 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -432,6 +432,9 @@ validate_sblock(struct fs *fs, int isaltsblk) %jd); CHK(fs->fs_sbsize, >, SBLOCKSIZE, %jd); CHK(fs->fs_sbsize, <, (unsigned)sizeof(struct fs), %jd); + /* fix for misconfigured filesystems */ + if (fs->fs_maxbsize == 0) + fs->fs_maxbsize = fs->fs_bsize; CHK(fs->fs_maxbsize, <, fs->fs_bsize, %jd); CHK(powerof2(fs->fs_maxbsize), ==, 0, %jd); CHK(fs->fs_maxbsize, >, FS_MAXCONTIG * fs->fs_bsize, %jd);