Don't allow non-root user to set a scheduler policy, otherwise this could
be a local DOS. Submitted by: Diane Bruce at db at db.net
This commit is contained in:
parent
0c723783a7
commit
f705bbe8b1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158778
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user