mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/deadline: Normal users can't set/change SCHED_DEADLINE policy
@ 2014-03-03 11:09 Juri Lelli
  2014-03-11 12:36 ` [tip:sched/core] sched/deadline: Deny unprivileged users to set/ change " tip-bot for Juri Lelli
  0 siblings, 1 reply; 2+ messages in thread
From: Juri Lelli @ 2014-03-03 11:09 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel, Juri Lelli

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 <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Juri Lelli <juri.lelli@gmail.com>
---
 kernel/sched/core.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 6edbef2..dbed360 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.
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:sched/core] sched/deadline: Deny unprivileged users to set/ change SCHED_DEADLINE policy
  2014-03-03 11:09 [PATCH] sched/deadline: Normal users can't set/change SCHED_DEADLINE policy Juri Lelli
@ 2014-03-11 12:36 ` tip-bot for Juri Lelli
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Juri Lelli @ 2014-03-11 12:36 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, peterz, tglx, juri.lelli

Commit-ID:  d44753b843e093f9e1f2f14806fbe106fff74898
Gitweb:     http://git.kernel.org/tip/d44753b843e093f9e1f2f14806fbe106fff74898
Author:     Juri Lelli <juri.lelli@gmail.com>
AuthorDate: Mon, 3 Mar 2014 12:09:21 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
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 <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>
---
 kernel/sched/core.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 6edbef2..f5c6635 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-11 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-03 11:09 [PATCH] sched/deadline: Normal users can't set/change SCHED_DEADLINE policy Juri Lelli
2014-03-11 12:36 ` [tip:sched/core] sched/deadline: Deny unprivileged users to set/ change " tip-bot for Juri Lelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome