linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Gladkov <gladkov.alexey@gmail.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Kernel Hardening <kernel-hardening@lists.openwall.com>,
	Linux API <linux-api@vger.kernel.org>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	Linux Security Module <linux-security-module@vger.kernel.org>,
	Akinobu Mita <akinobu.mita@gmail.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andy Lutomirski <luto@kernel.org>,
	Daniel Micay <danielmicay@gmail.com>,
	Djalal Harouni <tixxdz@gmail.com>,
	"Dmitry V . Levin" <ldv@altlinux.org>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ingo Molnar <mingo@kernel.org>,
	"J . Bruce Fields" <bfields@fieldses.org>,
	Jeff Layton <jlayton@poochiereds.net>,
	Jonathan Corbet <corbet@lwn.net>,
	Kees Cook <keescook@chromium.org>,
	Oleg Nesterov <oleg@redhat.com>
Subject: Re: [PATCH RESEND v9 3/8] proc: move hide_pid, pid_gid from pid_namespace to proc_fs_info
Date: Wed, 25 Mar 2020 20:04:29 +0100	[thread overview]
Message-ID: <20200325190429.73k52amlfjer7epa@comp-core-i7-2640m-0182e6> (raw)
In-Reply-To: <20200325180015.GA18706@avx2>

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@gmail.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


  reply	other threads:[~2020-03-25 19:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 20:44 [PATCH RESEND v9 0/8] proc: modernize proc to support multiple private instances Alexey Gladkov
2020-03-24 20:44 ` [PATCH RESEND v9 1/8] proc: rename struct proc_fs_info to proc_fs_opts Alexey Gladkov
2020-03-24 20:44 ` [PATCH RESEND v9 2/8] proc: allow to mount many instances of proc in one pid namespace Alexey Gladkov
2020-03-24 20:44 ` [PATCH RESEND v9 3/8] proc: move hide_pid, pid_gid from pid_namespace to proc_fs_info Alexey Gladkov
2020-03-24 21:21   ` Linus Torvalds
2020-03-25 17:42     ` [PATCH v9 9/8] proc: use named enums for better readability Alexey Gladkov
2020-03-25 19:16       ` Kees Cook
2020-03-25 18:00     ` [PATCH RESEND v9 3/8] proc: move hide_pid, pid_gid from pid_namespace to proc_fs_info Alexey Dobriyan
2020-03-25 19:04       ` Alexey Gladkov [this message]
2020-03-24 20:44 ` [PATCH RESEND v9 4/8] proc: instantiate only pids that we can ptrace on 'hidepid=4' mount option Alexey Gladkov
2020-03-24 20:44 ` [PATCH RESEND v9 5/8] proc: add option to mount only a pids subset Alexey Gladkov
2020-03-24 20:44 ` [PATCH RESEND v9 6/8] docs: proc: add documentation for "hidepid=4" and "subset=pidfs" options and new mount behavior Alexey Gladkov
2020-03-24 20:44 ` [PATCH RESEND v9 7/8] proc: move hidepid values to uapi as they are user interface to mount Alexey Gladkov
2020-03-24 20:44 ` [PATCH RESEND v9 8/8] proc: use human-readable values for hidehid Alexey Gladkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200325190429.73k52amlfjer7epa@comp-core-i7-2640m-0182e6 \
    --to=gladkov.alexey@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bfields@fieldses.org \
    --cc=corbet@lwn.net \
    --cc=danielmicay@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jlayton@poochiereds.net \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=ldv@altlinux.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=tixxdz@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).