|
Message-ID: <20200325190429.73k52amlfjer7epa@comp-core-i7-2640m-0182e6> Date: Wed, 25 Mar 2020 20:04:29 +0100 From: Alexey Gladkov <gladkov.alexey@...il.com> To: Alexey Dobriyan <adobriyan@...il.com> Cc: Linus Torvalds <torvalds@...ux-foundation.org>, 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>, 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 Wed, Mar 25, 2020 at 09:00:15PM +0300, Alexey Dobriyan wrote: > 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. I will fix this in the final version. > mount -t proc -o subset=pid,sysctl,misc I have not yet figured out how to implement this. I mean subset=meminfo,misc. -- Rgrds, legion
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.