UBUNTU: SAUCE: Yama: check PTRACE using thread group leader
authorKees Cook <kees.cook@canonical.com>
Sat, 10 Jul 2010 19:12:20 +0000 (12:12 -0700)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 28 Mar 2011 13:48:57 +0000 (06:48 -0700)
When examining process ancestory, we must use the thread group leader
or else we end up missing potential matches.

[submitted upstream to security-next]

Signed-off-by: Kees Cook <kees.cook@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>

security/yama/yama_lsm.c

index 291a9e5..b28d9cc 100644 (file)
@@ -170,6 +170,8 @@ static int task_is_descendant(struct task_struct *parent,
        rcu_read_lock();
        read_lock(&tasklist_lock);
        while (walker->pid > 0) {
+               if (!thread_group_leader(walker))
+                       walker = walker->group_leader;
                if (walker == parent) {
                        rc = 1;
                        break;