Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Jul 2001 12:35:32 -0500
From:      Mike Meyer <mwm@mired.org>
To:        Ed Alley <alley1@llnl.gov>
Cc:        questions@freebsd.org
Subject:   Re: Why panic when mounting bad CD?
Message-ID:  <15193.48484.879754.875650@guru.mired.org>
In-Reply-To: <105187253@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Ed Alley <alley1@llnl.gov> types:
> I am running FreeBSD 4.3 with an HP 9500 ide CD-RW.
> 
> My question is why does the kernel panic
> under these conditions? Does it get lost
> trying to find the disklabel or does the
> kernel think that the numbers it picked
> up are the disklabel and merrily goes
> off into some other world looking for
> the superblock?

CD's generally use the ISO 9660 file system, not UFS. They don't have
superblocks or disklabels, they have volume descriptors. And yes, if a
file system has bogus description data in it, the system tends to
crash while trying to deal with it. This is true for most file
systems.

> Wouldn't it be a good idea to have a
> magic number in with the disklabel
> that the kernel could test against
> before it believes what it finds?

UFS has a magic number in the superblock, and it's checked. ISO 9660
file systems also have a magic number in the volume descriptor, and
that's checked. The code in -stable check for either the ISO 9660 or
the ISO SIERRA magic numbers, as it understands both formats.

Neither of these guarantee that the file system descriptor tables are
actually correct. Mounting a file system with a valid magic number and
bogus descriptor tables is generally a bad idea. It appears that an
unfixated CD meets that description. There may be a way to detect that
the CD is unfixated; if so, submitting a patch to the
/usr/src/sys/isofs/cd9660_vfsops.c via a PR would be appreciated.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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