Isolate some explicit usage of task->tgid
With pid namespaces this field is now dangerous to use explicitly, so hide it behind the helpers. Also the pid and pgrp fields o task_struct and signal_struct are to be deprecated. Unfortunately this patch cannot be sent right now as this leads to tons of warnings, so start isolating them, and deprecate later. Actually the p->tgid == pid has to be changed to has_group_leader_pid(), but Oleg pointed out that in case of posix cpu timers this is the same, and thread_group_leader() is more preferable. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
19b9b9b54e
commit
bac0abd617
@ -2553,7 +2553,7 @@ static struct dentry *proc_task_lookup(struct inode *dir, struct dentry * dentry
|
||||
rcu_read_unlock();
|
||||
if (!task)
|
||||
goto out;
|
||||
if (leader->tgid != task->tgid)
|
||||
if (!same_thread_group(leader, task))
|
||||
goto out_drop_task;
|
||||
|
||||
result = proc_task_instantiate(dir, dentry, task, NULL);
|
||||
|
Reference in New Issue
Block a user