Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Oct 1997 23:52:28 -0700 (PDT)
From:      pangolin@rogers.wave.ca
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/4840: fsck dumps core when it can't read super block
Message-ID:  <199710240652.XAA01041@pc-21490.bc.rogers.wave.ca>
Resent-Message-ID: <199710240700.AAA28336@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         4840
>Category:       bin
>Synopsis:       fsck dumps core when it can't read super block
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 24 00:00:01 PDT 1997
>Last-Modified:
>Originator:     Jonathan Hanna
>Organization:
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

FreeBSD 3.0-CURRENT
FreeBSD 2.2-STABLE is OK

>Description:

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)

>Fix:

Possible patch. I do not know what the purpose of the fall through is.
Exit code meaning is also unknown.

--- main.c.orig Thu Oct 23 23:14:50 1997
+++ main.c      Thu Oct 23 23:23:12 1997
@@ -195,7 +195,8 @@
        case 0:
                if (preen)
                        pfatal("CAN'T CHECK FILE SYSTEM.");
-               /* fall through */
+               /* don't fall through */
+               return(1);
        case -1:
                pwarn("clean, %ld free ", sblock.fs_cstotal.cs_nffree +
                        sblock.fs_frag * sblock.fs_cstotal.cs_nbfree);

>Audit-Trail:
>Unformatted:



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