Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87eet5lx97.fsf@x220.int.ebiederm.org>
Date: Thu, 02 Apr 2020 10:31:48 -0500
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Alexey Gladkov <gladkov.alexey@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>,  Kernel Hardening <kernel-hardening@...ts.openwall.com>,  Linux API <linux-api@...r.kernel.org>,  Linux FS Devel <linux-fsdevel@...r.kernel.org>,  Linux Security Module <linux-security-module@...r.kernel.org>,  Akinobu Mita <akinobu.mita@...il.com>,  Alexander Viro <viro@...iv.linux.org.uk>,  Alexey Dobriyan <adobriyan@...il.com>,  Alexey Gladkov <legion@...nel.org>,  Andrew Morton <akpm@...ux-foundation.org>,  Andy Lutomirski <luto@...nel.org>,  Daniel Micay <danielmicay@...il.com>,  Djalal Harouni <tixxdz@...il.com>,  "Dmitry V . Levin" <ldv@...linux.org>,  Greg Kroah-Hartman <gregkh@...uxfoundation.org>,  Ingo Molnar <mingo@...nel.org>,  "J . Bruce Fields" <bfields@...ldses.org>,  Jeff Layton <jlayton@...chiereds.net>,  Jonathan Corbet <corbet@....net>,  Kees Cook <keescook@...omium.org>,  Linus Torvalds <torvalds@...ux-foundation.org>,  Oleg Nesterov <oleg@...hat.com>
Subject: Re: [PATCH v10 2/9] proc: allow to mount many instances of proc in one pid namespace


> diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
> index 40a7982b7285..5920a4ecd71b 100644
> --- a/include/linux/proc_fs.h
> +++ b/include/linux/proc_fs.h
> @@ -27,6 +27,17 @@ struct proc_ops {
>  	unsigned long (*proc_get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
>  };
>  
> +struct proc_fs_info {
> +	struct pid_namespace *pid_ns;
> +	struct dentry *proc_self;        /* For /proc/self */
> +	struct dentry *proc_thread_self; /* For /proc/thread-self */
> +};

Minor nit.

I have not seen a patch where you remove proc_self and proc_thread_self
from struct pid_namepace.

Ideally it would have been in this patch.  But as it won't break
anyone's bisection can you please have a follow up patch that removes
those fields?

Thank you,
Eric



> +
> +static inline struct proc_fs_info *proc_sb_info(struct super_block *sb)
> +{
> +	return sb->s_fs_info;
> +}
> +
>  #ifdef CONFIG_PROC_FS
>  
>  typedef int (*proc_write_t)(struct file *, char *, size_t);
> @@ -161,6 +172,7 @@ int open_related_ns(struct ns_common *ns,
>  /* get the associated pid namespace for a file in procfs */
>  static inline struct pid_namespace *proc_pid_ns(const struct inode *inode)
>  {
> +	return proc_sb_info(inode->i_sb)->pid_ns;
>  	return inode->i_sb->s_fs_info;
>  }

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.