Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200325180015.GA18706@avx2>
Date: Wed, 25 Mar 2020 21:00:15 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Alexey Gladkov <gladkov.alexey@...il.com>,
	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 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>,
	"Eric W . Biederman" <ebiederm@...ssion.com>,
	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>,
	Oleg Nesterov <oleg@...hat.com>
Subject: Re: [PATCH RESEND v9 3/8] proc: move hide_pid, pid_gid from
 pid_namespace to proc_fs_info

On Tue, Mar 24, 2020 at 02:21:59PM -0700, Linus Torvalds wrote:
> On Tue, Mar 24, 2020 at 1:46 PM Alexey Gladkov <gladkov.alexey@...il.com> wrote:
> >
> > +/* definitions for hide_pid field */
> > +enum {
> > +       HIDEPID_OFF       = 0,
> > +       HIDEPID_NO_ACCESS = 1,
> > +       HIDEPID_INVISIBLE = 2,
> > +};
> 
> Should this enum be named...
> 
> >  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 */
> > +       kgid_t pid_gid;
> > +       int hide_pid;
> >  };
> 
> .. and then used here instead of "int"?
> 
> Same goes for 'struct proc_fs_context' too, for that matter?
> 
> And maybe in the function declarations and definitions too? In things
> like 'has_pid_permissions()' (the series adds some other cases later,
> like hidepid2str() etc)
> 
> Yeah, enums and ints are kind of interchangeable in C, but even if it
> wouldn't give us any more typechecking (except perhaps with sparse if
> you mark it so), it would be documenting the use.
> 
> Or am I missing something?
> 
> Anyway, I continue to think the series looks fine, bnut would love to
> see it in -next and perhaps comments from Al and Alexey Dobriyan..

Patches are OK, except the part where "pid" is named "pidfs" and
the suffix doesn't convey any information.

	mount -t proc -o subset=pid,sysctl,misc

Reviewed-by: Alexey Dobriyan <adobriyan@...il.com>

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.