mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
8712a00514
commit
d44753b843
1 changed files with 9 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue