diff mbox

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

Message ID 20110318165116.GH5466@outflux.net
State New
Headers show

Commit Message

Kees Cook March 18, 2011, 4:51 p.m. UTC
Yet another case of a thread needing to match against the group leader.

Signed-off-by: Kees Cook <kees.cook@canonical.com>
---
 security/yama/yama_lsm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Kees Cook March 18, 2011, 5:19 p.m. UTC | #1
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@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
Stefan Bader March 21, 2011, 9:51 a.m. UTC | #2
On 03/18/2011 05:51 PM, Kees Cook wrote:
> Yet another case of a thread needing to match against the group leader.
> 
> Signed-off-by: Kees Cook <kees.cook@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;

Acked-by: Stefan Bader <stefan.bader@canonical.com>
Brad Figg April 8, 2011, 2:58 p.m. UTC | #3
On 03/21/2011 02:51 AM, Stefan Bader wrote:
> On 03/18/2011 05:51 PM, Kees Cook wrote:
>> Yet another case of a thread needing to match against the group leader.
>>
>> Signed-off-by: Kees Cook<kees.cook@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;
>
> Acked-by: Stefan Bader<stefan.bader@canonical.com>
>

The patch looks fine, we need SRU Justification text.

Acked-by: Brad Figg <brad.figg@canonical.com>
Tim Gardner April 8, 2011, 4:08 p.m. UTC | #4
On 04/08/2011 08:58 AM, Brad Figg wrote:
> On 03/21/2011 02:51 AM, Stefan Bader wrote:
>> On 03/18/2011 05:51 PM, Kees Cook wrote:
>>> Yet another case of a thread needing to match against the group leader.
>>>
>>> Signed-off-by: Kees Cook<kees.cook@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;
>>
>> Acked-by: Stefan Bader<stefan.bader@canonical.com>
>>
>
> The patch looks fine, we need SRU Justification text.
>
> Acked-by: Brad Figg <brad.figg@canonical.com>
>

Acked-by ..., applied
Brad Figg April 27, 2011, 3:53 p.m. UTC | #5
On 03/18/2011 09:51 AM, Kees Cook wrote:
> Yet another case of a thread needing to match against the group leader.
>
> Signed-off-by: Kees Cook<kees.cook@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;

Acked-by: Brad Figg <brad.figg@canonical.com>
diff mbox

Patch

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;