]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Guard against a block size of 0 in the label. When the first
authorbde <bde@FreeBSD.org>
Mon, 19 Jan 1998 16:28:29 +0000 (16:28 +0000)
committerbde <bde@FreeBSD.org>
Mon, 19 Jan 1998 16:28:29 +0000 (16:28 +0000)
commitac4b63f1338312c9c6046da53037e2cebd7fd8e4
tree6fa72420122745d2159754098adc5ad1f76d510f
parent1b72307204011e93eacc0e8dd59cb6e3cfc867a8
Guard against a block size of 0 in the label.  When the first
superblock is invalid, fsck looks at the label to help guess where
the next superblock should be.  If the partition type is 4.2BSD,
fsck assumed that the block size was valid and divided by it, so
it dumped core if the size was 0.

Initialization of the label was broken almost 3 years ago in rev.1.9
of newfs/newfs.c.  Newfs does not change the label at all, so there
is no problem (except the breakage of the automatic search for
backup superblocks) unless something else sets the partition type
to 4.2BSD.  However, it is too easy to set partition types to
4.2.BSD by copying an old label or by using a disktab entry to
create the label.

PR: 2537
sbin/fsck/setup.c
sbin/fsck_ffs/setup.c
sbin/fsck_ifs/setup.c