summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSuren Baghdasaryan <surenb@google.com>2019-07-29 18:33:10 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-29 08:30:15 +0200
commit1f54a9b84956329bacce075f1a98c0e49de0c027 (patch)
treeef00364328538abbfdb62050bf4158a5c9bbbb25 /kernel
parent9ea2355c3117cc1e36fe43bbdef2abe101b2aae4 (diff)
downloadlinux-stable-1f54a9b84956329bacce075f1a98c0e49de0c027.tar.gz
linux-stable-1f54a9b84956329bacce075f1a98c0e49de0c027.tar.bz2
linux-stable-1f54a9b84956329bacce075f1a98c0e49de0c027.zip
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@google.com> Signed-off-by: Suren Baghdasaryan <surenb@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: lizefan@huawei.com Cc: mingo@redhat.com Cc: akpm@linux-foundation.org Cc: kernel-team@android.com Cc: dennisszhou@gmail.com Cc: dennis@kernel.org Cc: hannes@cmpxchg.org Cc: axboe@kernel.dk Link: https://lkml.kernel.org/r/20190730013310.162367-1-surenb@google.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/psi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 7fe2c5fd26b5..23fbbcc414d5 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, &param);
+ sched_setscheduler_nocheck(kworker->task, SCHED_FIFO, &param);
kthread_init_delayed_work(&group->poll_work,
psi_poll_work);
rcu_assign_pointer(group->poll_kworker, kworker);