summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r--sys/kern/uipc_socket.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 76495e1..7313811 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -53,6 +53,7 @@
#include <sys/signalvar.h>
#include <sys/sysctl.h>
#include <sys/uio.h>
+#include <sys/jail.h>
#include <vm/vm_zone.h>
#include <machine/limits.h>
@@ -133,6 +134,14 @@ socreate(dom, aso, type, proto, p)
prp = pffindproto(dom, proto, type);
else
prp = pffindtype(dom, type);
+
+ if (p->p_prison && jail_socket_unixiproute_only &&
+ prp->pr_domain->dom_family != PF_LOCAL &&
+ prp->pr_domain->dom_family != PF_INET &&
+ prp->pr_domain->dom_family != PF_ROUTE) {
+ return (EPROTONOSUPPORT);
+ }
+
if (prp == 0 || prp->pr_usrreqs->pru_attach == 0)
return (EPROTONOSUPPORT);
if (prp->pr_type != type)
OpenPOWER on IntegriCloud