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:
davidxu 2006-05-21 00:40:38 +00:00
parent 3b6d7dd9bd
commit 77a76e9949
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);