Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Feb 2001 17:08:05 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc:        FreeBSD Current <freebsd-current@FreeBSD.ORG>
Subject:   Re: DEVFS and ms-dos partitions
Message-ID:  <Pine.BSF.4.21.0102071652490.31427-100000@besplex.bde.org>
In-Reply-To: <200102070543.f175hYZ14318@troutmask.apl.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 6 Feb 2001, Steve Kargl wrote:

> I have a world and kernel from 4 Feb 01.  I tried listing the
> contents in my mounted MS-DOS slice via "ls /msdos" as a normal
> users, but got a permission denied message (which I've never
> received before).  So, a quick check on the directory permissions
> shows:
> 
> d-------w-   1 root  493    arch 4096 Jan  1  1980 msdos/
> 
> which appears to be somewhat strange.  So, I unmounted the
> slice and manually mounted the slice with various incantations
> of mount_msdos.  All yield the above listing.
> 
> The source in src/sbin/mount_msdos has changed in a long time,
> so is this a side effect of using DEVFS?

This is caused by the same bug that cause panics for exporting
filesystems (things in mount structs moving around whenever the size
of struct mtx changes).  struct msdosfs_args is particularly well
designed to be affected by this bug even when nothing is exported:

struct msdosfs_args {
	char	*fspec;		/* blocks special holding the fs to mount */
	struct	export_args export;	/* network export information */
	uid_t	uid;		/* uid that owns msdosfs files */
	gid_t	gid;		/* gid that owns msdosfs files */
	mode_t	mask;		/* mask to be applied for msdosfs perms */
	int	flags;		/* see below */
	int magic;		/* version number */
	u_int16_t u2w[128];     /* Local->Unicode table */
	u_int8_t  ul[128];      /* Local upper->lower table */
	u_int8_t  lu[128];      /* Local lower->upper table */
	u_int8_t  d2u[128];     /* DOS->local table */
	u_int8_t  u2d[128];     /* Local->DOS table */
};

The fields after the export field become garbage when the size of the
export field changes.  The garbage is easy to see using `ls -ld /msdos'.

Bruce



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




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