summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_resource.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1998-02-04 18:43:10 +0000
committerdg <dg@FreeBSD.org>1998-02-04 18:43:10 +0000
commit13eef94007a8aa8da83a505a87e104867aa61262 (patch)
treec8e486ad5b5ae4d21b33dd7a87a19667ffc7947b /sys/kern/kern_resource.c
parentdbf89ade74811dadd818e1a4fba5cd089a9b701d (diff)
downloadFreeBSD-src-13eef94007a8aa8da83a505a87e104867aa61262.zip
FreeBSD-src-13eef94007a8aa8da83a505a87e104867aa61262.tar.gz
Restrict idleprio to superuser:
Realtime priority has to be restricted for reasons which should be obvious. However, for idle priority, there is a potential for system deadlock if an idleprio process gains a lock on a resource that other processes need (and the idleprio process can't run due to a CPU-bound normal process). Fix me! XXX PR: 5639
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r--sys/kern/kern_resource.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index 5210a0e..d1bb77f 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_resource.c 8.5 (Berkeley) 1/21/94
- * $Id: kern_resource.c,v 1.29 1997/12/16 17:40:17 eivind Exp $
+ * $Id: kern_resource.c,v 1.30 1998/01/19 12:39:00 bde Exp $
*/
#include "opt_compat.h"
@@ -258,7 +258,17 @@ rtprio(curp, uap)
if (uap->pid)
return (EPERM);
/* can't set realtime priority */
+/*
+ * Realtime priority has to be restricted for reasons which should be
+ * obvious. However, for idle priority, there is a potential for
+ * system deadlock if an idleprio process gains a lock on a resource
+ * that other processes need (and the idleprio process can't run
+ * due to a CPU-bound normal process). Fix me! XXX
+ */
+#if 0
if (rtp.type == RTP_PRIO_REALTIME)
+#endif
+ if (rtp.type != RTP_PRIO_NORMAL)
return (EPERM);
}
switch (rtp.type) {
OpenPOWER on IntegriCloud