[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190827072741.055271779@linuxfoundation.org>
Date: Tue, 27 Aug 2019 09:50:12 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Nick Kralevich <nnk@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
lizefan@...wei.com, mingo@...hat.com, akpm@...ux-foundation.org,
kernel-team@...roid.com, dennisszhou@...il.com, dennis@...nel.org,
hannes@...xchg.org, axboe@...nel.dk,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.2 084/162] sched/psi: Do not require setsched permission from the trigger creator
[ Upstream commit 04e048cf09d7b5fc995817cdc5ae1acd4482429c ]
When a process creates a new trigger by writing into /proc/pressure/*
files, permissions to write such a file should be used to determine whether
the process is allowed to do so or not. Current implementation would also
require such a process to have setsched capability. Setting of psi trigger
thread's scheduling policy is an implementation detail and should not be
exposed to the user level. Remove the permission check by using _nocheck
version of the function.
Suggested-by: Nick Kralevich <nnk@...gle.com>
Signed-off-by: Suren Baghdasaryan <surenb@...gle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: lizefan@...wei.com
Cc: mingo@...hat.com
Cc: akpm@...ux-foundation.org
Cc: kernel-team@...roid.com
Cc: dennisszhou@...il.com
Cc: dennis@...nel.org
Cc: hannes@...xchg.org
Cc: axboe@...nel.dk
Link: https://lkml.kernel.org/r/20190730013310.162367-1-surenb@google.com
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
kernel/sched/psi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 7fe2c5fd26b54..23fbbcc414d5d 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -1061,7 +1061,7 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group,
mutex_unlock(&group->trigger_lock);
return ERR_CAST(kworker);
}
- sched_setscheduler(kworker->task, SCHED_FIFO, ¶m);
+ sched_setscheduler_nocheck(kworker->task, SCHED_FIFO, ¶m);
kthread_init_delayed_work(&group->poll_work,
psi_poll_work);
rcu_assign_pointer(group->poll_kworker, kworker);
--
2.20.1
Powered by blists - more mailing lists