Commit 36a04267 authored by Chris Wright's avatar Chris Wright Committed by Linus Torvalds

[PATCH] sys_capget should use current if the pid argument is 0

parent 78d78c9d
...@@ -54,11 +54,14 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr) ...@@ -54,11 +54,14 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
spin_lock(&task_capability_lock); spin_lock(&task_capability_lock);
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
target = find_task_by_pid(pid); if (pid && pid != current->pid) {
if (!target) { target = find_task_by_pid(pid);
ret = -ESRCH; if (!target) {
goto out; ret = -ESRCH;
} goto out;
}
} else
target = current;
data.permitted = cap_t(target->cap_permitted); data.permitted = cap_t(target->cap_permitted);
data.inheritable = cap_t(target->cap_inheritable); data.inheritable = cap_t(target->cap_inheritable);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment