summaryrefslogtreecommitdiffstats
path: root/sys/kern/p1003_1b.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-05-21 00:40:38 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-05-21 00:40:38 +0000
commit77a76e9949a1994dbeb934e3cb8ecaf6c54c853c (patch)
tree683856d781a6dedd8b2fa1fa6e783d0abc38e9c5 /sys/kern/p1003_1b.c
parent3b6d7dd9bd6cbea7fd598174f543390256b97f4b (diff)
downloadFreeBSD-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/kern/p1003_1b.c')
-rw-r--r--sys/kern/p1003_1b.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/p1003_1b.c b/sys/kern/p1003_1b.c
index 95adfee..4da17a5 100644
--- a/sys/kern/p1003_1b.c
+++ b/sys/kern/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);
OpenPOWER on IntegriCloud