Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6804b175 authored by Ruchi Kandoi's avatar Ruchi Kandoi Committed by Ian Maund
Browse files

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: default avatarRuchi Kandoi <kandoiruchi@google.com>
Git-commit: 8ae872f1d59990a1f33a7e5aae6b5bcbedc5806f
Git-repo: https://android.googlesource.com/kernel/common.git


Signed-off-by: default avatarIan Maund <imaund@codeaurora.org>
parent b9efd921
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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) {