Skip to content

Commit 04e048c

Browse files
surenbaghdasaryanPeter Zijlstra
authored andcommitted
sched/psi: Do not require setsched permission from the trigger creator
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 <[email protected]> Signed-off-by: Suren Baghdasaryan <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 14f5c7b commit 04e048c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/psi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group,
10611061
mutex_unlock(&group->trigger_lock);
10621062
return ERR_CAST(kworker);
10631063
}
1064-
sched_setscheduler(kworker->task, SCHED_FIFO, &param);
1064+
sched_setscheduler_nocheck(kworker->task, SCHED_FIFO, &param);
10651065
kthread_init_delayed_work(&group->poll_work,
10661066
psi_poll_work);
10671067
rcu_assign_pointer(group->poll_kworker, kworker);

0 commit comments

Comments
 (0)