projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40cf2f8
)
prctl: adds the capable(CAP_SYS_NICE) check to PR_SET_TIMERSLACK_PID.
author
Ruchi Kandoi
<kandoiruchi@google.com>
Sat, 14 Jun 2014 00:03:01 +0000
(17:03 -0700)
committer
Ruchi Kandoi
<kandoiruchi@google.com>
Mon, 16 Jun 2014 17:49:10 +0000
(17:49 +0000)
Adds a capable() check to make sure that arbitary apps do not change the
timer slack for other apps.
Bug:
15000427
Change-Id: I558a2551a0e3579c7f7e7aae54b28aa9d982b209
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
kernel/sys.c
patch
|
blob
|
history
diff --git
a/kernel/sys.c
b/kernel/sys.c
index 875529e936abae09b01082555edd9357a6001507..ab7fda5fbe188559fcb7924fa5944e8439c8e856 100644
(file)
--- a/
kernel/sys.c
+++ b/
kernel/sys.c
@@
-2378,6
+2378,9
@@
SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
return -EINVAL;
break;
case PR_SET_TIMERSLACK_PID:
+ if (current->pid != (pid_t)arg3 &&
+ !capable(CAP_SYS_NICE))
+ return -EPERM;
rcu_read_lock();
tsk = find_task_by_pid_ns((pid_t)arg3, &init_pid_ns);
if (tsk == NULL) {