diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2013-03-14 23:25:42 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2013-03-14 23:25:42 +0000 |
commit | a8efb53478dbb7dcc4a24aa9f715d473a7944bfa (patch) | |
tree | ebd3d1d7fa26ee31913556ea689d8737a03a8a9f /sys/kern/subr_trap.c | |
parent | 16befafd162f81741897711b7839861cb45ebe99 (diff) | |
download | src-a8efb53478dbb7dcc4a24aa9f715d473a7944bfa.tar.gz src-a8efb53478dbb7dcc4a24aa9f715d473a7944bfa.zip |
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
Notes
Notes:
svn path=/head/; revision=248300
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r-- | sys/kern/subr_trap.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 1f24e8848cc1..11a4bc43bf2e 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -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 trapframe *frame) #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 } |