[PATCH, natty and maverick] Yama: fix default relationship to check thread group

Kees Cook kees at ubuntu.com
Fri Mar 18 17:19:51 UTC 2011


Forgot to add the buglink for this one. It is for bug 737676.

Thanks!

On Fri, Mar 18, 2011 at 09:51:16AM -0700, Kees Cook wrote:
> Yet another case of a thread needing to match against the group leader.
> 
> Signed-off-by: Kees Cook <kees.cook at canonical.com>
> ---
>  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 b05f1dd..c8f3020 100644
> --- a/security/yama/yama_lsm.c
> +++ b/security/yama/yama_lsm.c
> @@ -173,6 +173,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;
> -- 
> 1.7.4.1
> 
> 
> -- 
> Kees Cook
> Ubuntu Security Team
-- 
Kees Cook
Ubuntu Security Team




More information about the kernel-team mailing list