Yama: fix default relationship to check thread group
authorKees Cook <kees@ubuntu.com>
Fri, 18 Mar 2011 16:51:16 +0000 (09:51 -0700)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 28 Mar 2011 13:54:44 +0000 (06:54 -0700)
Yet another case of a thread needing to match against the group leader.

BugLink: http://bugs.launchpad.net/bugs/737676
Signed-off-by: Kees Cook <kees.cook@canonical.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>

security/yama/yama_lsm.c

index f082a55..7c3591a 100644 (file)
@@ -174,6 +174,8 @@ static int task_is_descendant(struct task_struct *parent,
 
        rcu_read_lock();
        read_lock(&tasklist_lock);
+       if (!thread_group_leader(parent))
+               parent = parent->group_leader;
        while (walker->pid > 0) {
                if (!thread_group_leader(walker))
                        walker = walker->group_leader;