Message ID | 20190729194205.212846-1-surenb@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/1] psi: do not require setsched permission from the trigger creator | expand |
On Mon, Jul 29, 2019 at 12:42:05PM -0700, Suren Baghdasaryan wrote: > 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> > --- > kernel/sched/psi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) $ ./scripts/get_maintainer.pl --file kernel/sched/psi.c Ingo Molnar <mingo@redhat.com> (maintainer:SCHEDULER) Peter Zijlstra <peterz@infradead.org> (maintainer:SCHEDULER) linux-kernel@vger.kernel.org (open list:SCHEDULER) No where am I listed there, so why did you send this "To:" me? please fix up and resend. greg k-h
On Mon, Jul 29, 2019 at 12:57 PM Greg KH <gregkh@linuxfoundation.org> wrote: > > On Mon, Jul 29, 2019 at 12:42:05PM -0700, Suren Baghdasaryan wrote: > > 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> > > --- > > kernel/sched/psi.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > $ ./scripts/get_maintainer.pl --file kernel/sched/psi.c > Ingo Molnar <mingo@redhat.com> (maintainer:SCHEDULER) > Peter Zijlstra <peterz@infradead.org> (maintainer:SCHEDULER) > linux-kernel@vger.kernel.org (open list:SCHEDULER) > > > No where am I listed there, so why did you send this "To:" me? > Oh, sorry about that. Both Ingo and Peter are CC'ed directly. Should I still resend? > please fix up and resend. > > greg k-h
diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 7acc632c3b82..ed9a1d573cb1 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);
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> --- kernel/sched/psi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)