Page MenuHomeFreeBSD

D46472.1788995747.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D46472.1788995747.diff

diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -115,6 +115,7 @@
#include <sys/uio.h>
#include <sys/user.h>
#include <sys/event.h>
+#include <sys/jail.h>
#include <security/mac/mac_framework.h>
@@ -550,6 +551,20 @@
return (error);
}
+static void
+pipekva_enomem(void)
+{
+ static int curfail = 0;
+ static struct timeval lastfail;
+
+ pipeallocfail++;
+ if (!ppsratecheck(&lastfail, &curfail, 1))
+ return;
+ printf("pid %d (%s), jid %d, uid %d: kern.ipc.maxpipekva exceeded\n",
+ curproc->p_pid, curproc->p_comm, curproc->p_ucred->cr_prison->pr_id,
+ curproc->p_ucred->cr_uid);
+}
+
/*
* Allocate kva for pipe circular buffer, the space is pageable
* This routine will 'realloc' the size of a pipe safely, if it fails
@@ -561,8 +576,6 @@
{
caddr_t buffer;
int error, cnt, firstseg;
- static int curfail = 0;
- static struct timeval lastfail;
KASSERT(!mtx_owned(PIPE_MTX(cpipe)), ("pipespace: pipe mutex locked"));
KASSERT(!(cpipe->pipe_state & PIPE_DIRECTW),
@@ -585,9 +598,7 @@
goto retry;
}
if (cpipe->pipe_buffer.buffer == NULL) {
- pipeallocfail++;
- if (ppsratecheck(&lastfail, &curfail, 1))
- printf("kern.ipc.maxpipekva exceeded; see tuning(7)\n");
+ pipekva_enomem();
} else {
piperesizefail++;
}

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 9, 11:15 PM (4 m, 21 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29530002
Default Alt Text
D46472.1788995747.diff (1 KB)

Event Timeline