Subject: bin/13787: Core dumps on bad fstab file contents
To: None <>
From: None <>
List: netbsd-bugs
Date: 08/26/2001 09:25:52
>Number:         13787
>Category:       bin
>Synopsis:       swapctl, mount, and fsck all dump core on bad /etc/fstab
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 26 07:22:00 PDT 2001
>Originator:     Dave Burgess
>Release:        1.5
	Nebraska On-Ramp
System: NetBSD 1.5X NetBSD 1.5X (CYNJUT) #0: Sun Jul 29 11:39:56 CDT 2001 root@:/usr/src/sys/arch/i386/compile/CYNJUT i386
Architecture: i386
Machine: i386
One of my HelpDesk folks was assisting me in setting up the upgrade for one
of our servers from 1.5 to 1.5.1 and left out a column in the /etc/fstab file.
Instead of this:
/dev/wd0a			/			ffs	rw	1 1
/dev/wd0b			none			swap	sw	0 0
/dev/wd1a			/var			ffs	rw	2 1
/dev/wd1e			/usr			ffs	rw	2 1

He put this:
/dev/wd0a			/			ffs	1 1
/dev/wd0b			none			swap	0 0
/dev/wd1a			/var			ffs	2 1
/dev/wd1e			/usr			ffs	2 1

This caused swapctl, fsck, and mount to all fail with a core dump.  During
normal operations, it wouldn't have been so critical, but during boot-up, 
the system failed and couldn't write the resulting core dumps anywhere 
(since the root file system was still RO).

	Modify the fstab to have too few columns.
Obviously, the general fix is to not let people that aren't totally familiar
with the config file structures modify the files.  In spite of that, there
should be some other diagnostic available than a core dump that doesn't get
written.  My suspicion is that there is a single routine that reads the fstab,
so the fix should be relatively atomic.  I'd look into it, but I've got my
own demons to wrestle with this week-end: sorry.