Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148848707
D46472.1788995747.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D46472.1788995747.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D46472: Make pipe(2) & Co bullet-proof again (PR 272332)
Attached
Detach File
Event Timeline
Log In to Comment