Re: [PATCH] Filter /proc/mounts based on process root dir

Alexander Viro (viro@math.psu.edu)
Tue, 2 Jul 2002 18:51:26 -0400 (EDT)


On Tue, 2 Jul 2002, Paul Menage wrote:

>
> This patch causes /proc/mounts to only display entries for mountpoints
> within the current process root. This makes df and friends behave more
> nicely in a chroot jail or with rootfs.
>
> Most of the logic in proc_check_root() is moved to a new function,
> is_namespace_subdir(), which checks whether the given mount/dentry
> refers to a subdirectory of the process root directory in the current
> namespace. show_vfsmount() now returns without adding an output line if
> is_namespace_subdir() returns false for a given mountpoint.

That looks nice, but keep in mind that behaviour of getmntent(3) in chroot
jails is a traditional misfeature. Hopefully nothing important relies on it,
but...

As far as I'm concerned patch (and behaviour change) are fine. Let's do it
and see if anybody screams...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/