Re: [PATCH] security: Yama LSM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux