Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Oct 1997 03:20:02 -0700 (PDT)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs
Subject:   Re: bin/4840: fsck dumps core when it can't read super block
Message-ID:  <199710241020.DAA07297@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/4840; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, pangolin@rogers.wave.ca
Cc:  Subject: Re: bin/4840: fsck dumps core when it can't read super block
Date: Fri, 24 Oct 1997 20:16:11 +1000

 >fsck in 3.0-CURRENT dumps core after dereferencing an unitialized
 >super block data structure. It seems the setup() routine now returns more
 >than a boolean. That is handled by a case statement with a suspicious
 >fall through.
 >
 >>How-To-Repeat:
 >
 >#
 ># as non-root
 >#
 >bash-2.01$ fsck
 >Can't open /dev/rwd1a: Permission denied
 >Segmentation fault (core dumped)
 
 It also dumps core for attempting to evaluate 0.0/0 when it gets a little
 further (e.g., for an empty partition).
 
 >>Fix:
 >
 >Possible patch. I do not know what the purpose of the fall through is.
 
 It is just to avoid repeating `return (0)' in the Lite2 version.  It is
 just the result of a bad merge in the current version.
 
 >Exit code meaning is also unknown.
 
 Returning 1 may be better, but fsck seems to want to exit with status 0
 after certain errors.  For `fsck /dev/something', the change has no
 effect since fsck always exits with status 0 in that case.  For `fsck'
 with no device args, returning 1 ensures that fsck exits with a nonzero
 status after checking all the file systems in /etc/fstab.
 
 Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710241020.DAA07297>