diff options
author | bz <bz@FreeBSD.org> | 2009-12-13 13:57:32 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2009-12-13 13:57:32 +0000 |
commit | 932cbdbe4d3c405e08edd47627e620e9ad1b07d0 (patch) | |
tree | 8d2708fb3455d0829b95b1ddc69d4a072486bf2d /sys/netinet/raw_ip.c | |
parent | 1ba3a5e4e0b1a21dd0c00df2e5223a60984e3de6 (diff) | |
download | FreeBSD-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/netinet/raw_ip.c')
-rw-r--r-- | sys/netinet/raw_ip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 02b51eb..3573472 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -291,7 +291,7 @@ rip_input(struct mbuf *m, int off) continue; if (inp->inp_faddr.s_addr != ip->ip_src.s_addr) continue; - if (jailed(inp->inp_cred)) { + if (jailed_without_vnet(inp->inp_cred)) { /* * XXX: If faddr was bound to multicast group, * jailed raw socket will drop datagram. @@ -325,7 +325,7 @@ rip_input(struct mbuf *m, int off) if (!in_nullhost(inp->inp_faddr) && !in_hosteq(inp->inp_faddr, ip->ip_src)) continue; - if (jailed(inp->inp_cred)) { + if (jailed_without_vnet(inp->inp_cred)) { /* * Allow raw socket in jail to receive multicast; * assume process had PRIV_NETINET_RAW at attach, |