]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sched_setscheduler(2): Change realtime privilege check
authorFlorian Walpen <dev@submerge.ch>
Wed, 14 Feb 2024 13:50:44 +0000 (14:50 +0100)
committerOlivier Certner <olce@FreeBSD.org>
Wed, 14 Feb 2024 18:19:04 +0000 (19:19 +0100)
commit1ee910875cd00c6f86f3f64dbc1686ec6d52ab11
tree87b4ee0be4abd1fd2daa1096e4d3eaf2afcdf574
parentb36ddb27b3b96a3d42dba6b0cc5c103b70911ddb
sched_setscheduler(2): Change realtime privilege check

Check for privilege PRIV_SCHED_SETPOLICY instead of PRIV_SCHED_SET, to
at least make it coherent with what is done at thread creation when
a realtime policy is requested, and have users authorized by
mac_priority(4) pass it.

This change is good enough in practice since it only allows 'root' (as
before) and mac_priority(4)'s authorized users in (the point of this
change), without other side effects.  More changes in this area, to
generally ensure that all privilege checks are consistent, are going to
come as olce's priority revamp project lands.

(olce: Expanded the explanations.)

PR:                     276962
Reported by:            jbeich
Reviewed by:            olce
Approved by:            emaste (mentor)
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D43835

(cherry picked from commit 2198221bd9df0ceb69945120bc477309a5729241)
(cherry picked from commit 8ff01d01f2e8894bbac9f179f1ab0e83a8160384)

Approved by:            emaste (mentor)
Approved by:            re (cperciva)
sys/kern/p1003_1b.c