Re: Dramatic mistake in fstab

Guest section DW (dwguest@win.tue.nl)
Sun, 27 Dec 1998 17:06:26 +0100 (MET)


From: Jack <jschmid@udallas.edu>

I made / user mountable.

My next reboot I got /sbin/fsck: Permission denied. ...

I finally discovered that when / was mounted implicitly everything was
fine, but once rcS called mount -o remount,rw / everything stopped. It
seems that a user mountable partition if remounted gains the flag noexec.

Yes. From mount(8):

user Allow an ordinary user to mount the file
system. This option implies the options
noexec, nosuid, and nodev (unless overridden
by subsequent options, as in the option line
user,exec,dev,suid).

Anyways it's a user error, I'm sure it's even well documented, but it does
seem a bit extreme a failure and useless a behavior for the root
filesystem. I'm sure someone somewhere depends on this queer behavior, but
I do wonder if a small check, or at least a warning, might not be added to
either mount or the ext2 code.

Hmm... `Queer behaviour' you say?
You ask for something and indeed get it? Queer indeed. Must be a Unix system.

This is not a kernel matter - the program mount does the mount system call
with the MS_NOEXEC bit set. So the kernel just does what is asked.
It is not the task of the kernel to guess what the user might mean.

And mount? There are quite a lot of stupid things one might do with mount -
I can see no reasonable way to add protection. Moreover, in some maybe
less common cases these `stupid' things are precisely what is desired.

But I am open for suggestions.

Andries
[mount maintainer]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/