diff options
-rw-r--r-- | sys/kern/p1003_1b.c | 4 | ||||
-rw-r--r-- | sys/posix4/p1003_1b.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/p1003_1b.c b/sys/kern/p1003_1b.c index 95adfee..4da17a5 100644 --- a/sys/kern/p1003_1b.c +++ b/sys/kern/p1003_1b.c @@ -193,6 +193,10 @@ sched_setscheduler(struct thread *td, struct sched_setscheduler_args *uap) struct thread *targettd; struct proc *targetp; + /* Don't allow non root user to set a scheduler policy */ + if (suser(td) != 0) + return (EPERM); + e = copyin(uap->param, &sched_param, sizeof(sched_param)); if (e) return (e); diff --git a/sys/posix4/p1003_1b.c b/sys/posix4/p1003_1b.c index 95adfee..4da17a5 100644 --- a/sys/posix4/p1003_1b.c +++ b/sys/posix4/p1003_1b.c @@ -193,6 +193,10 @@ sched_setscheduler(struct thread *td, struct sched_setscheduler_args *uap) struct thread *targettd; struct proc *targetp; + /* Don't allow non root user to set a scheduler policy */ + if (suser(td) != 0) + return (EPERM); + e = copyin(uap->param, &sched_param, sizeof(sched_param)); if (e) return (e); |