aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-02-08 07:19:15 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:28 -0500
commitac9a8e3f0f43d20fc316162e8e5f9186d295ff49 (patch)
treea6b8d416c38d222773a46c5d84b3d043facbf008
parent44c4e1b2581f7273ab14ef30b6430618801c57b1 (diff)
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: 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>
-rw-r--r--kernel/sys.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index ee2e78dbea6c..5a61f8071b8e 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1025,19 +1025,16 @@ asmlinkage long sys_getsid(pid_t pid)
1025 else { 1025 else {
1026 int retval; 1026 int retval;
1027 struct task_struct *p; 1027 struct task_struct *p;
1028 struct pid_namespace *ns;
1029
1030 ns = current->nsproxy->pid_ns;
1031 1028
1032 read_lock(&tasklist_lock); 1029 rcu_read_lock();
1033 p = find_task_by_pid_ns(pid, ns); 1030 p = find_task_by_vpid(pid);
1034 retval = -ESRCH; 1031 retval = -ESRCH;
1035 if (p) { 1032 if (p) {
1036 retval = security_task_getsid(p); 1033 retval = security_task_getsid(p);
1037 if (!retval) 1034 if (!retval)
1038 retval = task_session_nr_ns(p, ns); 1035 retval = task_session_vnr(p);
1039 } 1036 }
1040 read_unlock(&tasklist_lock); 1037 rcu_read_unlock();
1041 return retval; 1038 return retval;
1042 } 1039 }
1043} 1040}