NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/48808

The following reply was made to PR kern/48808; it has been noted by GNATS.

From: "Thomas Schmitt" <>
Subject: Re: kern/48808
Date: Fri, 16 May 2014 12:52:56 +0200

 > cdXd is only the raw partition on some ports, it will be cdXc on others
 > (e.g. see the BUGS section of disklabel(8)), so that should be noted
 > somewhere - I don't think that we have a good way of doing that though.
 It's indeed mentionen in man 8 mscdlabel:
     "The raw partition (typically partition c, but d on i386 and some other
      platforms) is left alone during this process."
 I change the man page proposal of mount_cd9660:
   Such a default offset will be overridden by option
   .Fl s
 - so that all /dev/cd* will behave like /dev/cd*d.
 + so that all /dev/cd* will behave like the raw partition device /dev/cd*d
 + resp. /dev/cd*c.
   .Xr mscdlabel 8
 > how likely are we to crash if the block_offset isn't a superblock?
 To my estimation not more than with a user applying
   mount -t 9660
 to a not suitable device rep. medium.
 I tried unsuitable offsets already (sorry for not reporting):
   netbsd# mount_cd9660 -s 12345 /dev/cd0a /mnt/iso
   mount_cd9660: /dev/cd0a on /mnt/iso: Invalid argument
 With unsuitable medium content i get the same
   netbsd# mount_cd9660  /dev/wd1f /mnt/iso
   mount_cd9660: /dev/wd1f on /mnt/iso: Invalid argument
 Existing precautions in cd9660:
 In sys/fs/cd9660/cd9660_vfsops.c the loop
         for (iso_blknum = 16; iso_blknum < 100; iso_blknum++) {
 is searching for ISO 9660 Volume Descriptors.
 If it does not find one, then it throws the error
         if (pribp == NULL) {
                 error = EINVAL;
                 goto out;
 The loop ends on the first block that does not look like
 a ISO 9660 volume descriptor.
                 if (memcmp(vdp->id, ISO_STANDARD_ID, sizeof(vdp->id)) != 0) {
 It could be made a notch sharper by demanding a Primary Volume
 Descriptor (case ISO_VD_PRIMARY:) in the first block that is
 examined by the loop.
 (The macros are defined in iso.h and match my knowledge about
  ISO 9660.)

Home | Main Index | Thread Index | Old Index