提交 ac9a8e3f 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

sys_getsid: don't use ->nsproxy directly

With the new semantics of find_vpid() we don't need to play with ->nsproxy
explicitely, _vxx() do the right things.

Also s/tasklist/rcu/.
Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 44c4e1b2
......@@ -1025,19 +1025,16 @@ asmlinkage long sys_getsid(pid_t pid)
else {
int retval;
struct task_struct *p;
struct pid_namespace *ns;
ns = current->nsproxy->pid_ns;
read_lock(&tasklist_lock);
p = find_task_by_pid_ns(pid, ns);
rcu_read_lock();
p = find_task_by_vpid(pid);
retval = -ESRCH;
if (p) {
retval = security_task_getsid(p);
if (!retval)
retval = task_session_nr_ns(p, ns);
retval = task_session_vnr(p);
}
read_unlock(&tasklist_lock);
rcu_read_unlock();
return retval;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册