diff options
-rw-r--r-- | kernel/sys.c | 11 |
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 | } |