From: Eric W. Biederman Date: Sat, 11 Aug 2012 19:38:26 +0000 (-0700) Subject: procfs: Print task uids and gids in the userns that opened the proc file X-Git-Tag: firefly_0821_release~3680^2~1404^2~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e9f238c3041e2582a710e75910c8cbf2a98e51b2;p=firefly-linux-kernel-4.4.55.git procfs: Print task uids and gids in the userns that opened the proc file 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 Signed-off-by: "Eric W. Biederman" --- diff --git a/fs/proc/array.c b/fs/proc/array.c index c1c207c36cae..554434265613 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -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;