Skip to content

Commit

Permalink
sys_getsid: don't use ->nsproxy directly
Browse files Browse the repository at this point in the history
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: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Feb 8, 2008
1 parent 44c4e1b commit ac9a8e3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit ac9a8e3

Please sign in to comment.