Subject: [PATCH] pspace: Don't report the parent process id in proc if it is in a different pspace. From: Eric W. Biederman Date: 1133861723 -0700 --- fs/proc/array.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) a74b2c3cb6ccfffd71f047f60f6bf5ec7192588d diff --git a/fs/proc/array.c b/fs/proc/array.c index 3a7d50d..64cc859 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -175,8 +175,12 @@ static inline char * task_state(struct t get_task_state(p), (p->sleep_avg/1024)*100/(1020000000/1024), p->tgid, - p->tid, task_alive(p) ? p->group_leader->real_parent->tgid : 0, - task_alive(p) && p->ptrace ? p->parent->tid : 0, + p->tid, + task_alive(p) && + p->pspace == p->group_leader->real_parent->pspace ? + p->group_leader->real_parent->tgid : 0, + task_alive(p) && p->ptrace && p->pspace == p->parent->pspace ? + p->parent->tid : 0, p->uid, p->euid, p->suid, p->fsuid, p->gid, p->egid, p->sgid, p->fsgid); read_unlock(&tasklist_lock); @@ -388,7 +392,9 @@ static int do_task_stat(struct task_stru } it_real_value = task->signal->it_real_value; } - ppid = task_alive(task) ? task->group_leader->real_parent->tgid : 0; + ppid = task_alive(task) && + task->pspace == task->group_leader->real_parent->pspace ? + task->group_leader->real_parent->tgid : 0; read_unlock(&tasklist_lock); if (!whole || num_threads<2) -- 1.0.GIT