From: Kees Cook <kees.cook@canonical.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] security: Yama LSM
Date: Mon, 21 Jun 2010 18:14:52 -0700 [thread overview]
Message-ID: <20100622011452.GN24749@outflux.net> (raw)
In-Reply-To: <201006220028.o5M0Sbx7062650@www262.sakura.ne.jp>
Hi Tetsuo,
On Tue, Jun 22, 2010 at 09:28:37AM +0900, Tetsuo Handa wrote:
> Kees Cook wrote:
> > + /* require ptrace target be a child of ptracer on attach */
> > + if (mode == PTRACE_MODE_ATTACH && ptrace_scope &&
> > + !capable(CAP_SYS_PTRACE)) {
> > + struct task_struct *walker = child;
> > +
> > + read_lock(&tasklist_lock);
>
> Holding tasklist_lock does not imply rcu protection.
> Don't you need rcu_read_lock() like setpriority() and getppid()?
You're totally right, thanks for the catch! Looks like setpriority() does
a similar kind of thing, so I've wrapped the whole thing in rcu_ now:
...
+ rcu_read_lock();
read_lock(&tasklist_lock);
while (walker->pid > 0) {
...
rc = -EPERM;
read_unlock(&tasklist_lock);
+ rcu_read_unlock();
...
-Kees
--
Kees Cook
Ubuntu Security Team
next parent reply other threads:[~2010-06-22 1:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100621213424.GG24749@outflux.net>
[not found] ` <201006220028.o5M0Sbx7062650@www262.sakura.ne.jp>
2010-06-22 1:14 ` Kees Cook [this message]
2010-06-22 12:25 ` [PATCH] security: Yama LSM Dmitry Kasatkin
2010-06-22 16:06 ` ext Kees Cook
2010-06-23 6:03 ` Christian Stroetmann
2010-06-23 6:22 ` Kees Cook
2010-06-23 6:43 ` Christian Stroetmann
2010-06-23 7:01 ` Kees Cook
2010-06-23 9:16 ` Alan Cox
2010-06-21 21:34 Kees Cook
-- strict thread matches above, loose matches on Subject: below --
2010-06-21 21:34 Kees Cook
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=20100622011452.GN24749@outflux.net \
--to=kees.cook@canonical.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
/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).