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>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
}
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);
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;
}