Stacked mounts of procfs/linprocfs
Matthew Dillon
dillon at apollo.backplane.com
Sun Aug 26 09:30:12 PDT 2007
:Hey,
:
:I just noticed that we can produce stacked mounts of procfs and linprocfs. Probably not what we want:
:
:% mount|grep procfs
:procfs on /proc (procfs, local)
:procfs on /proc (procfs, local)
:
:I tried looking into where to prevent this, probably in the vfsmount routine. However I'm a bit out of the loop concerning the namecache, so I'm not sure when I need to lock/release what.
:
:Nevertheless I think we should prevent this behavior.
:
:cheers
: simon
Yah, that wouldn't be good. procfs likes to destroy nodes dynamically
and that could lead to unmountable filesystems.
The easiest solution is to add a kernel mount flag (MNTK_*) to the
mount structure that tells the kernel not to allow mounts under a
particular mount (e.g. procfs), and just have the kernel check it when
a mount is attempted. Probably not more then 10 lines of code if you
would like to have a go at it.
-Matt
More information about the Bugs
mailing list