Re: mount(2) bug found

Rik van Riel (H.H.vanRiel@phys.uu.nl)
Tue, 16 Jun 1998 09:21:26 +0200 (CEST)


On Tue, 16 Jun 1998, Chris Wedgwood wrote:
> On Mon, Jun 15, 1998 at 04:38:33PM +0200, Rik van Riel wrote:
> >
> > The directory gets mounted correctly, however the status
> > in /proc/mounts is _not_ displayed correctly. After I've
> > installed Stampede, I'll investigate the bug and correct
> > it for both 2.0 and 2.1 kernels...
>
> 'Thats not a bug - its a feature' <tm>.

It _is_ a bug. Just look at the following scenario:

mirkwood:# df
/dev/root / <blahblahblah>
/dev/sda4 /stampede <blahblahblah>
mirkwood:# chroot /stampede /bin/bash
chroot:# mount /dev/sda1 /mnt
chroot:# mount -t proc none /proc
<flip to other console>
mirkwood:# cat /proc/mounts
/dev/root / <blah>
/dev/sda4 /stampede <blah>
none /proc <blah>
/dev/sda1 /mnt <blah> <-- mounted on /stampede/mnt
none /proc <blah> <-- mounted on /stampede/proc

So you see, it _is_ a bug... This is mainly because
programs like 'df' depend on the fact that the FSes
are correctly listed.
The above setup clearly breaks 'df' and other programs.

Furthermore, it would be nice to have chroot() in such
a way that you can't see you're chroot()ed...
The security buffs would probably like such a setup
too :-)

Rik.
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu