Re: bug: mount on an open directory succeeds

From: Werner Almesberger (almesber@lrc.epfl.ch)
Date: Tue Mar 07 2000 - 08:51:35 EST


Amit S. Kale wrote:
> This can be taken care of by removing access permissions on mount point.

Sure. I just wonder what great benefit that "vertical behaviour" of
"." should add that it justifies the addition of
 - a scan for processes with cwd on the mount point
 - a new requirement for prevention of a DoS attack
while it
 - may break existing valid uses (i.e. disallowing mounting on a
   busy directory)
 - doesn't solve the problem for anything living further down the
   tree
 - may open new chroot exploits (by not solving ... see above)

(All this under the assumption that the "foo" vs "./foo" inconsistency
is resolved by making mount(2) fail if the mount point is busy.)

What I see here is consistent "traditional" behaviour (i.e. "." non-
vertical), and a gratuitous change in semantics that needs a lot of
band aid to fix all the subtle distortions it creates.

> Besides the 'bad guy' can cd AFTER mount and prevent the
> 'good guy' from unmounting.

Yes, but note that before mount the permissions of the mount point apply,
whole after mount, the permissions of the top-level directory of the
mounted file system apply. Subtle, but has been like that on Linux for
ages.

So, what makes an implementation with "vertical ." superior to the
traditional implementation with less complicated semantics ?

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH       werner.almesberger@ica.epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/

- 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/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:22 EST