sched/deadline: Normal users can't set/change SCHED_DEADLINE policy
PATCH 1/1 sched/deadline: Normal users can't 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).
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Signed-off-by Juri Lelli <[email protected]>
--- kernel/sched/core.c | 9 +++++++++ 1 file changed, 9 insertions(+)
kernel/sched/core.c +9 -0
@@ -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.
Signature · 1 line
1.7.9.5
tip-bot for Juri Lelli
merge bot[tip:sched/core] sched/deadline: Deny unprivileged users to set/ change SCHED_DEADLINE policy
sched/deadline: Deny unprivileged users to set/change SCHED_DEADLINE policy
Commit-ID: d44753b843e093f9e1f2f14806fbe106fff74898 Gitweb: http://git.kernel.org/tip/d44753b843e093f9e1f2f14806fbe106fff74898 Author: Juri Lelli <[email protected]> AuthorDate: Mon, 3 Mar 2014 12:09:21 +0100 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 11 Mar 2014 11:33:46 +0100
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 <[email protected]>
Signed-off-by Peter Zijlstra <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- kernel/sched/core.c | 9 +++++++++ 1 file changed, 9 insertions(+)
kernel/sched/core.c +9 -0
@@ -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.