aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRuchi Kandoi <kandoiruchi@google.com>2014-06-13 17:03:01 -0700
committerZiyann <jaraidaniel@gmail.com>2014-11-26 21:10:51 +0100
commit5f6c49e634a85bdf2e443db004a4f2e7a5875164 (patch)
tree40404ffc1b84d613e36220d6478b39d0914cd6b8 /kernel
parentc620fdb741eaec1776e3e84e88e2676002901b14 (diff)
downloadkernel_samsung_tuna-5f6c49e634a85bdf2e443db004a4f2e7a5875164.zip
kernel_samsung_tuna-5f6c49e634a85bdf2e443db004a4f2e7a5875164.tar.gz
kernel_samsung_tuna-5f6c49e634a85bdf2e443db004a4f2e7a5875164.tar.bz2
prctl: adds the capable(CAP_SYS_NICE) check to PR_SET_TIMERSLACK_PID.
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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sys.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 8d1142a..f89cca5 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1807,6 +1807,9 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
error = PR_MCE_KILL_DEFAULT;
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) {