Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1631751

Re: [PATCH RFC v2 5/6] proc: instantiate only pids that we can ptrace on 'limit_pids=1' mount option

From Andy Lutomirski <luto@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH RFC v2 5/6] proc: instantiate only pids that we can ptrace on 'limit_pids=1' mount option
Date 2017-04-27 00:10 +0200
Message-ID <tADih-8v0-1@gated-at.bofh.it> (permalink)
References <tA7Lr-4EF-9@gated-at.bofh.it> <tA7Lr-4EF-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Apr 25, 2017 at 5:23 AM, Djalal Harouni <tixxdz@gmail.com> wrote:
> If "limit_pids=1" mount option is set then do not instantiate pids that
> we can not ptrace. "limit_pids=1" means that procfs should only contain
> pids that the caller can ptrace.
>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Andy Lutomirski <luto@kernel.org>
> Signed-off-by: Djalal Harouni <tixxdz@gmail.com>
> ---
>  fs/proc/base.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 2e0f661..a663284 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -3149,6 +3149,7 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, unsign
>         unsigned tgid;
>         struct proc_fs_info *fs_info = proc_sb(dir->i_sb);
>         struct pid_namespace *ns = fs_info->pid_ns;
> +       int limit_pids = proc_fs_limit_pids(fs_info);

Shouldn't the addition of proc_fs_limit_pids() be in this patch?

Also, can we name it something self-documented?
"ptraceable_pids_only=1", perhaps?  Or even pids=ptraceable (as
opposed to pids=all or maybe other choices in the future)?

--Andy

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH RFC v2 5/6] proc: instantiate only pids that we can ptrace on 'limit_pids=1' mount option Djalal Harouni <tixxdz@gmail.com> - 2017-04-25 14:30 +0200
  Re: [PATCH RFC v2 5/6] proc: instantiate only pids that we can ptrace  on 'limit_pids=1' mount option Andy Lutomirski <luto@kernel.org> - 2017-04-27 00:10 +0200
    Re: [PATCH RFC v2 5/6] proc: instantiate only pids that we can ptrace  on 'limit_pids=1' mount option Djalal Harouni <tixxdz@gmail.com> - 2017-05-02 16:10 +0200

csiph-web