diff options
author | Juri Lelli <juri.lelli@gmail.com> | 2014-03-03 12:09:21 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-03-11 11:33:46 +0100 |
commit | d44753b843e093f9e1f2f14806fbe106fff74898 (patch) | |
tree | 0d5899268a6831cfcaad636ff85f0fd9e8759881 | |
parent | 8712a00514e50aafa7c9bf5cd3955fa60758e53b (diff) | |
download | linux-d44753b843e093f9e1f2f14806fbe106fff74898.tar.bz2 |
sched/deadline: Deny unprivileged users to set/change SCHED_DEADLINE policy
Deny the use of SCHED_DEADLINE policy to unprivileged users.
Even if root users can set the policy for normal users, we
don't want the latter to be able to change their parameters
(safest behavior).
Signed-off-by: Juri Lelli <juri.lelli@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1393844961-18097-1-git-send-email-juri.lelli@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | kernel/sched/core.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 6edbef296ece..f5c6635b806c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3338,6 +3338,15 @@ recheck: return -EPERM; } + /* + * Can't set/change SCHED_DEADLINE policy at all for now + * (safest behavior); in the future we would like to allow + * unprivileged DL tasks to increase their relative deadline + * or reduce their runtime (both ways reducing utilization) + */ + if (dl_policy(policy)) + return -EPERM; + /* * Treat SCHED_IDLE as nice 20. Only allow a switch to * SCHED_NORMAL if the RLIMIT_NICE would normally permit it. |