]> git.karo-electronics.de Git - linux-beck.git/commitdiff
procfs: Print task uids and gids in the userns that opened the proc file
authorEric W. Biederman <ebiederm@xmission.com>
Sat, 11 Aug 2012 19:38:26 +0000 (12:38 -0700)
committerEric W. Biederman <ebiederm@xmission.com>
Tue, 20 Nov 2012 12:18:15 +0000 (04:18 -0800)
Instead of using current_userns() use the userns of the opener
of the file so that if the file is passed between processes
the contents of the file do not change.

Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/proc/array.c

index c1c207c36caefeb1fcbc8d782504cfcbf1b616d8..554434265613331c22c87e860c219b83652f3e93 100644 (file)
@@ -162,7 +162,7 @@ static inline const char *get_task_state(struct task_struct *tsk)
 static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
                                struct pid *pid, struct task_struct *p)
 {
-       struct user_namespace *user_ns = current_user_ns();
+       struct user_namespace *user_ns = seq_user_ns(m);
        struct group_info *group_info;
        int g;
        struct fdtable *fdt = NULL;