svn commit: r248300 - head/sys/kern

Edward Tomasz Napierala trasz at FreeBSD.org
Thu Mar 14 23:25:42 UTC 2013


Author: trasz
Date: Thu Mar 14 23:25:42 2013
New Revision: 248300
URL: http://svnweb.freebsd.org/changeset/base/248300

Log:
  When throttling a process to enforce RACCT limits, do not use neither
  PBDRY (which simply doesn't make any sense) nor PCATCH (which could
  be used by a malicious process to work around the PCPU limit).
  
  Submitted by:	Rudo Tomori
  Reviewed by:	kib

Modified:
  head/sys/kern/subr_trap.c

Modified: head/sys/kern/subr_trap.c
==============================================================================
--- head/sys/kern/subr_trap.c	Thu Mar 14 23:25:01 2013	(r248299)
+++ head/sys/kern/subr_trap.c	Thu Mar 14 23:25:42 2013	(r248300)
@@ -100,9 +100,6 @@ void
 userret(struct thread *td, struct trapframe *frame)
 {
 	struct proc *p = td->td_proc;
-#ifdef	RACCT
-	int sig;
-#endif
 
 	CTR3(KTR_SYSC, "userret: thread %p (pid %d, %s)", td, p->p_pid,
             td->td_name);
@@ -175,12 +172,8 @@ userret(struct thread *td, struct trapfr
 #endif
 #ifdef	RACCT
 	PROC_LOCK(p);
-	while (p->p_throttled == 1) {
-		sig = msleep(p->p_racct, &p->p_mtx, PCATCH | PBDRY, "racct",
-		    hz);
-		if ((sig == EINTR) || (sig == ERESTART))
-			break;
-	}
+	while (p->p_throttled == 1)
+		msleep(p->p_racct, &p->p_mtx, 0, "racct", 0);
 	PROC_UNLOCK(p);
 #endif
 }


More information about the svn-src-all mailing list