[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dragonfly-bugs
Subject:    Re: Stacked mounts of procfs/linprocfs
From:       Matthew Dillon <dillon () apollo ! backplane ! com>
Date:       2007-08-26 16:27:59
Message-ID: 200708261627.l7QGRxCf004160 () apollo ! backplane ! com
[Download RAW message or body]


> 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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic