summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2009-12-13 13:57:32 +0000
committerbz <bz@FreeBSD.org>2009-12-13 13:57:32 +0000
commit932cbdbe4d3c405e08edd47627e620e9ad1b07d0 (patch)
tree8d2708fb3455d0829b95b1ddc69d4a072486bf2d /sys/net
parent1ba3a5e4e0b1a21dd0c00df2e5223a60984e3de6 (diff)
downloadFreeBSD-src-932cbdbe4d3c405e08edd47627e620e9ad1b07d0.zip
FreeBSD-src-932cbdbe4d3c405e08edd47627e620e9ad1b07d0.tar.gz
Throughout the network stack we have a few places of
if (jailed(cred)) left. If you are running with a vnet (virtual network stack) those will return true and defer you to classic IP-jails handling and thus things will be "denied" or returned with an error. Work around this problem by introducing another "jailed()" function, jailed_without_vnet(), that also takes vnets into account, and permits the calls, should the jail from the given cred have its own virtual network stack. We cannot change the classic jailed() call to do that, as it is used outside the network stack as well. Discussed with: julian, zec, jamie, rwatson (back in Sept) MFC after: 5 days
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/rtsock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 4bbd6e3..a0677ec 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -651,7 +651,7 @@ route_output(struct mbuf *m, struct socket *so)
report:
RT_LOCK_ASSERT(rt);
if ((rt->rt_flags & RTF_HOST) == 0
- ? jailed(curthread->td_ucred)
+ ? jailed_without_vnet(curthread->td_ucred)
: prison_if(curthread->td_ucred,
rt_key(rt)) != 0) {
RT_UNLOCK(rt);
@@ -1312,7 +1312,7 @@ sysctl_dumpentry(struct radix_node *rn, void *vw)
if (w->w_op == NET_RT_FLAGS && !(rt->rt_flags & w->w_arg))
return 0;
if ((rt->rt_flags & RTF_HOST) == 0
- ? jailed(w->w_req->td->td_ucred)
+ ? jailed_without_vnet(w->w_req->td->td_ucred)
: prison_if(w->w_req->td->td_ucred, rt_key(rt)) != 0)
return (0);
bzero((caddr_t)&info, sizeof(info));
OpenPOWER on IntegriCloud