lkml.org 
[lkml]   [2008]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 6/6] vfs: mountinfo: only show mounts under tasks root
On Thu, Mar 13, 2008 at 10:26:47PM +0100, Miklos Szeredi wrote:
> From: Miklos Szeredi <mszeredi@suse.cz>
>
> 1. Only show reachable mounts in /proc/<pid>/mountinfo, this makes
> mountpoints unambiguous for chrooted processes.
>
> 2. Instead of showing mountpoints relative to the current root, always
> show them relative to the queried task's root.
>
> This means, that a particular mountinfo file will always have the same
> contents, regardless of which process is reading the file. Which is a
> lot more consistent, than the current behavior of /proc/<pid>/mounts.
>
> Addressed comments from Jan Blunck and Ram Pai.

> return retval;
>
> global_root:
> + if (only_reachable)
> + return ERR_PTR(-EINVAL);

Humm... Might make sense to update *root in case we hit that place and
do the rest in callers, instead of playing with extra arguments...
Hell knows, I'd try to massage in that direction and see if anything
clean shows up.

> static int show_mountinfo(struct seq_file *m, void *v)
> {
> + struct proc_mounts *p = m->private;
> + size_t count_save = m->count;

*UGH*. Do you really need that? Frankly, in that case I'd rather
separate the check from __d_path(); unwinds like that are Not Nice(tm).

> + if (seq_path_root(m, &mnt_path, &p->root, " \t\n\\") == -EINVAL) {
> + /* path is outside root */
> + m->count = count_save;


\
 
 \ /
  Last update: 2008-03-19 22:25    [W:0.109 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site