]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Extend the sanity checks in ufs_lookup to ensure that each directory
authoriedowse <iedowse@FreeBSD.org>
Sun, 4 Feb 2001 01:52:11 +0000 (01:52 +0000)
committeriedowse <iedowse@FreeBSD.org>
Sun, 4 Feb 2001 01:52:11 +0000 (01:52 +0000)
commitbe2876f24f2c685bf1d2fc62bb16195a46d3a0ad
treea95ffc2d21a6b9849b2ff8c73e71829d4d0ed2f0
parent62f9307582193e143fe23fdb9866da7efdf2716b
Extend the sanity checks in ufs_lookup to ensure that each directory
entry fits within its DIRBLKSIZ block. The surrounding code is
extremely fragile with respect to corruption of the directory entry
'd_reclen' field; if directory corruption occurs, it can blindly
scan forward beyond the end of the filesystem block. Usually this
results in a 'fault on nofault entry' panic.

Directory corruption is now much more likely to be detected, resulting
in a 'ufs_dirbad' panic. If the filesystem is read-only, it will
simply print a warning message, and skip the corrupted block.

Reviewed by: mckusick
sys/ufs/ufs/ufs_lookup.c