From mboxrd@z Thu Jan 1 00:00:00 1970 From: Serge Hallyn Subject: Re: [PATCH review 11/16] procfs: Print task uids and gids in the userns that opened the proc file Date: Mon, 19 Nov 2012 11:58:53 -0600 Message-ID: <20121119175853.GB1883@serge-ThinkPad-X130e> References: <87lidx8wbo.fsf@xmission.com> <1353337961-12962-1-git-send-email-ebiederm@xmission.com> <1353337961-12962-11-git-send-email-ebiederm@xmission.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux Containers , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Eric W. Biederman" Return-path: Content-Disposition: inline In-Reply-To: <1353337961-12962-11-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org Quoting Eric W. Biederman (ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org): > From: "Eric W. Biederman" > > 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. > > Signed-off-by: "Eric W. Biederman" Acked-by: Serge E. Hallyn > --- > fs/proc/array.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/fs/proc/array.c b/fs/proc/array.c > index c1c207c..5544342 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; > -- > 1.7.5.4 > > _______________________________________________ > Containers mailing list > Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org > https://lists.linuxfoundation.org/mailman/listinfo/containers