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
3b6d7dd9bd
commit
77a76e9949
@ -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