diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-05-21 00:40:38 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-05-21 00:40:38 +0000 |
commit | 77a76e9949a1994dbeb934e3cb8ecaf6c54c853c (patch) | |
tree | 683856d781a6dedd8b2fa1fa6e783d0abc38e9c5 /sys/posix4 | |
parent | 3b6d7dd9bd6cbea7fd598174f543390256b97f4b (diff) | |
download | FreeBSD-src-77a76e9949a1994dbeb934e3cb8ecaf6c54c853c.zip FreeBSD-src-77a76e9949a1994dbeb934e3cb8ecaf6c54c853c.tar.gz |
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
Diffstat (limited to 'sys/posix4')
-rw-r--r-- | sys/posix4/p1003_1b.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |