From nobody  Thu Oct 22 18:17:24 1998
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id SAA03283;
          Thu, 22 Oct 1998 18:17:24 -0700 (PDT)
          (envelope-from nobody)
Message-Id: <199810230117.SAA03283@hub.freebsd.org>
Date: Thu, 22 Oct 1998 18:17:24 -0700 (PDT)
From: cmetz@inner.net
To: freebsd-gnats-submit@freebsd.org
Subject: 3.0 config(8) doesn't check that root fs device driver is present
X-Send-Pr-Version: www-1.0

>Number:         8417
>Category:       kern
>Synopsis:       3.0 config(8) doesn't check that root fs device driver is present
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 22 18:20:01 PDT 1998
>Closed-Date:    Tue Jun 27 01:03:55 PDT 2000
>Last-Modified:  Tue Jun 27 01:07:00 PDT 2000
>Originator:     Craig Metz
>Release:        3.0-RELEASE
>Organization:
>Environment:
>Description:
config(8) should check that the arguments to:

config kernel root on <foo> dumps on <bar>

to ensure that the controllers for <foo> and <bar> are in fact present
in the config file. If they are not, config(8) works, the kernel builds,
and you get a mysterious trap on line 165 of ffs_mount (where it first
dereferences bdevsw) where it tries to access the device, but the
pointer to the driver is bogus.

At the least, config(8) should do this sanity check. It's also worth
looking into why the value of bdevsw[major(rootdev)] is bogus but not
NULL under these conditions (there may be another bug in there).

>How-To-Repeat:
Try:

config kernel root on sd0

(3.0 not having a sd0 anymore...)

>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: bde 
State-Changed-When: Mon Oct 26 01:24:35 PST 1998 
State-Changed-Why:  
Mostly fixed, mostly in rev.1.167 of kern/vfs_subr.c.  Related null pointer 
panics for non-root mounts fixed in all affected vfs's. 

Not fixed in config(8).  It's hardly worth fixing there, since the root device 
specified there is rarely used.  It's easier to [mis]configure the root device 
at boot time and there is no way for the boot loader to check it. 

A nonexistent root device now causes an obscure panic in vfs_mountrootfs() 
instead of a null pointer panic.  Not fixed.  vfs_mountrootfs() should 
prompt for the root device if none is found. 

Not fixed in 2.2. 
State-Changed-From-To: suspended->closed 
State-Changed-By: nbm 
State-Changed-When: Tue Jun 27 01:03:55 PDT 2000 
State-Changed-Why:  
The kernel now asks for a root device, and the change bde made in 
3.x-CURRENT will have propogated to all currently supported releases. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=8417 
>Unformatted:
