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:
David Xu 2006-05-21 00:40:38 +00:00
parent 0c723783a7
commit f705bbe8b1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158778
2 changed files with 8 additions and 0 deletions

View File

@ -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);

View File

@ -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);