git: 5bc926af9fd1 - main - Bug fix to UFS/FFS superblock integrity checks when reading a superblock.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 06 Jul 2022 21:45:58 UTC
The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=5bc926af9fd1c47f74356734f731c68145e31c6f commit 5bc926af9fd1c47f74356734f731c68145e31c6f Author: Kirk McKusick <mckusick@FreeBSD.org> AuthorDate: 2022-07-06 21:38:19 +0000 Commit: Kirk McKusick <mckusick@FreeBSD.org> CommitDate: 2022-07-06 21:45:30 +0000 Bug fix to UFS/FFS superblock integrity checks when reading a superblock. Older versions of growfs(8) failed to correctly update fs_dsize. Filesystems that have been grown fail the test for fs_dsize's correct value. For now we exclude the fs_dsize test from the requirements. Reported by: Edward Tomasz Napiera Tested by: Edward Tomasz Napiera Tested by: Peter Holm MFC after: 1 month (with 076002f24d35) Differential Revision: https://reviews.freebsd.org/D35219 --- sys/ufs/ffs/ffs_subr.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index d87579832617..25657a00894f 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -422,9 +422,16 @@ validate_sblock(struct fs *fs, int isaltsblk) CHK(fs->fs_cgsize, >, fs->fs_bsize, %jd); CHK(fs->fs_cssize, !=, fragroundup(fs, fs->fs_ncg * sizeof(struct csum)), %jd); + /* + * This test is valid, however older versions of growfs failed + * to correctly update fs_dsize so will fail this test. Thus we + * exclude it from the requirements. + */ +#ifdef notdef CHK(fs->fs_dsize, !=, fs->fs_size - fs->fs_sblkno - fs->fs_ncg * (fs->fs_dblkno - fs->fs_sblkno) - howmany(fs->fs_cssize, fs->fs_fsize), %jd); +#endif CHK(fs->fs_metaspace, <, 0, %jd); CHK(fs->fs_metaspace, >, fs->fs_fpg / 2, %jd); CHK(fs->fs_minfree, >, 99, %jd%%);