FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 11-24-2011, 09:07 AM
Paolo Pisati
 
Default Yama: use thread group leader when creating match

From: Kees Cook <kees.cook@canonical.com>

Like the earlier bug-fix for thread group leader when matching,
we also need to find the thread group leader for "current" when
creating the match.

BugLink: http://bugs.launchpad.net/bugs/729839

Signed-off-by: Kees Cook <kees.cook@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
(cherry picked from commit ad0ff93928b5b690054ba8a8fa9cd37464733122)

BugLink: http://launchpad.net/bugs/893190

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
security/yama/yama_lsm.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
index f3e7d7f..be177ca 100644
--- a/security/yama/yama_lsm.c
+++ b/security/yama/yama_lsm.c
@@ -131,8 +131,12 @@ int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3,
}
else {
struct task_struct *tracer;
+ struct task_struct *myself = current;

rcu_read_lock();
+ if (!thread_group_leader(myself))
+ myself = myself->group_leader;
+ get_task_struct(myself);
tracer = find_task_by_vpid(arg2);
if (tracer)
get_task_struct(tracer);
@@ -141,9 +145,10 @@ int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3,
rcu_read_unlock();

if (tracer) {
- rc = yama_ptracer_add(tracer, current);
+ rc = yama_ptracer_add(tracer, myself);
put_task_struct(tracer);
}
+ put_task_struct(myself);
}
break;
}
--
1.7.5.4


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 11:31 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org