[1489] in linux-security and linux-alert archive

home help back first fref pref prev next nref lref last post

[linux-alert] mount -o remount may be misleading

daemon@ATHENA.MIT.EDU (Sameer R. Manek)
Mon Mar 31 15:16:06 1997

Date: Mon, 31 Mar 1997 10:03:45 -0800 (PST)
From: "Sameer R. Manek" <manek@challenger.atc.fhda.edu>
To: linux-alert@redhat.com
Resent-From: linux-alert@redhat.com
Reply-To: linux-alert@redhat.com

One thing i noticed is that mount does work quite the way the man
page would suggest it would. Reading the man page one would think that
the only limitation is:
         The  -o remount may not be able to change mount parameters
         (all ext2fs parameters, except sb, are changeable  with  a
         remount,  for  example,  but you can't change gid or umask
         for the dosfs).

Reading that one would think that the follow mount command is legal.
  mount -o remount,rw,noexec,nosuid,nodev /dev/hda3 /tmp
Infact typing mount to misleadingly confirms it, below is the
before/after results of such a command
/dev/hda3 on /tmp type ext2 (rw)
/dev/hda3 on /tmp type ext2 (rw,noexec,nosuid,nodev)

host:/tmp> cc -o helloworld helloworld.c
host:/tmp> chmod u+s helloworld
host:/tmp> ls -l helloworld
-rwsr-xr-x   1 manek    users        3953 Mar 25 02:44 helloworld*
host:/tmp> ./helloworld
Hello world

As we see both the noexec and nosuid failed. According to
the maintainer of the man page and mount utility Andries.Brouwer@cwi.nl
he explained the apparent descripencies between the results and
the man page below:

> This text is correct as it stands: the noexec parameter is not
> an ext2fs parameter but a general parameter. It cannot be changed.
> (But the kernel does not return an error for such a mount call,
> so mount never notices that some of the options were ignored.)
> I'll include the word `specific' in the next version:
> all ext2fs-specific parameters ...

The only effective way to unmount and remount the partition, which 
can be difficult on machines where a reboot is not possible.


--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Sameer Manek                        manek@challenger.atc.fhda.edu
    "A mind once stretched by a new idea 
                   never regains its original dimensions"
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
              MIT Magic Cookies, made with Xtc


home help back first fref pref prev next nref lref last post