From patchwork Thu Nov 24 10:07:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [5/6] Yama: fix default relationship to check thread group From: Paolo Pisati X-Patchwork-Id: 127468 Message-Id: <1322129246-5397-6-git-send-email-paolo.pisati@canonical.com> To: kernel-team@lists.ubuntu.com Date: Thu, 24 Nov 2011 11:07:25 +0100 From: Kees Cook 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 Signed-off-by: Andy Whitcroft Acked-by: Brad Figg Signed-off-by: Tim Gardner (cherry picked from commit 47208c22ade02f2b0b95dc3cb38e9a30c5ac600a) BugLink: http://launchpad.net/bugs/893190 Signed-off-by: Paolo Pisati --- security/yama/yama_lsm.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c index 1fb1f90..f3e7d7f 100644 --- a/security/yama/yama_lsm.c +++ b/security/yama/yama_lsm.c @@ -169,6 +169,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;