freebsd-skq/sbin/fsck_ffs
Kirk McKusick 12487c7243 Fix a read past the end of a buffer in fsck.
To minimize the time spent scanning all of the directories in pass 2
(Check Pathnames), fsck uses a search order based on the location
of their first block. Zero length directories have no first block,
so the array being used to hold the block numbers of directory
inodes was of zero length. Thus a lookup was done past the end of
the array getting at best a random value and at worst a segment
fault.  For zero length directories, this change allocates a one
element block array and initializes it to zero. The effect is that
all zero length directories are handled first in pass 2.

Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D14163
2018-02-21 20:32:23 +00:00
..
dir.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
ea.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
fsck_ffs.8 Exit fsck_ffs with non-zero status when file system is not repaired. 2018-01-15 19:25:11 +00:00
fsck.h Include files missed in 329051. 2018-02-08 23:14:24 +00:00
fsutil.c Refactoring of reading and writing of the UFS/FFS superblock. 2018-01-26 00:58:32 +00:00
gjournal.c More throughly integrate libufs into fsck_ffs by using its cgput() 2018-01-24 23:57:40 +00:00
globs.c Include files missed in 329051. 2018-02-08 23:14:24 +00:00
inode.c Fix a read past the end of a buffer in fsck. 2018-02-21 20:32:23 +00:00
main.c Include files missed in 329051. 2018-02-08 23:14:24 +00:00
Makefile
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
pass1.c Rename cgget => cglookup to clear name space for new libufs function cgget. 2018-01-17 06:31:21 +00:00
pass1b.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
pass2.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
pass3.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
pass4.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
pass5.c The goal of this change is to prevent accidental foot shooting by 2018-02-08 23:06:58 +00:00
setup.c Refactoring of reading and writing of the UFS/FFS superblock. 2018-01-26 00:58:32 +00:00
suj.c Use sbput(3) rather than sbwrite(3) to ensure that the updated copy of 2018-02-02 00:07:38 +00:00
utilities.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00