From: gladkov.alexey@gmail.com (Alexey Gladkov)
To: linux-security-module@vger.kernel.org
Subject: [PATCH v5 5/7] proc: instantiate only pids that we can ptrace on 'limit_pids=1' mount option
Date: Mon, 14 May 2018 10:29:08 +0200 [thread overview]
Message-ID: <20180514082908.GA28179@comp-core-i7-2640m-0182e6> (raw)
In-Reply-To: <CA+55aFxYwH6dw=bsQJHEgkM_iZfVNerqn+RAXrrY2iufJag6Qw@mail.gmail.com>
On Fri, May 11, 2018 at 09:45:33AM -0700, Linus Torvalds wrote:
> On Fri, May 11, 2018 at 2:46 AM Alexey Gladkov <gladkov.alexey@gmail.com>
> wrote:
>
> > + /* Limit procfs to only ptracable tasks */
> > + if (limit_pids == PROC_LIMIT_PIDS_PTRACE) {
> > + cond_resched();
> > + if (!has_pid_permissions(fs_info, task,
> HIDEPID_NO_ACCESS))
> > + goto out_put_task;
> > + }
>
> Where did that "cond_resched()" come from? That doesn't seem to make a lot
> of sense.
This call came along with has_pid_permissions from proc_pid_readdir [1]. It
seems to me that proc_pid_readdir and proc_pid_lookup should act in a
similar way in this case.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3ba4bceef23206349d4130ddf140819b365de7c8
--
Rgrds, legion
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2018-05-14 8:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-11 9:36 [PATCH v5 5/7] proc: instantiate only pids that we can ptrace on 'limit_pids=1' mount option Alexey Gladkov
2018-05-11 16:09 ` Randy Dunlap
2018-05-14 8:34 ` Alexey Gladkov
2018-05-11 16:45 ` Linus Torvalds
2018-05-14 8:29 ` Alexey Gladkov [this message]
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=20180514082908.GA28179@comp-core-i7-2640m-0182e6 \
--to=gladkov.alexey@gmail.com \
--cc=linux-security-module@vger.kernel.org \
/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