Re: bug: mount on an open directory succeeds

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


Guest section DW wrote:
> So, I think we have to change. But it would be strange to
> have . point at the old directory, and ./a/.. at the
> mounted filesystem.

Besides, this may violate POSIX too ;-) It says something like "dot-dot
is the parent of the predecessor" (don't have The Book with me right
now).

> So, . must point at the mounted filesystem as well, precisely as we
> already do today. But then the best way to get rid of the fact that
> foo and ./foo may differ is to do like Unix6 did and return EBUSY if
> the mount point is the cwd of some process.

Hmm, this can create a subtle DoS attack for user-accessible mount:

Bad guy Good guy
cd /home/goodguy/floppy
# sits there with an evil mount ~/floppy -> EBUSY
# smile and waits fuser -k ~/floppy -> EPERM (*)
                                Mail -s "heeeelllp" root
                                ...

(* or doesn't see the processes in the first place, depending on
   /proc permissions)

It may also be quite inconvenient in the incremental construction of
a fully functional system environment where you launch some demons
on a partial system, then mount more stuff. E.g. PCMCIA vs. NFS.
This is admittedly somewhat exotic.

- 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:21 EST