net: Make CAP_NET_BIND_SERVICE per user namespace
Allow privileged users in any user namespace to bind to privileged sockets in network namespaces they control. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
b51642f6d7
commit
3594698a1f
@@ -283,7 +283,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
|
||||
return -EINVAL;
|
||||
|
||||
snum = ntohs(addr->sin6_port);
|
||||
if (snum && snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE))
|
||||
if (snum && snum < PROT_SOCK && !ns_capable(net->user_ns, CAP_NET_BIND_SERVICE))
|
||||
return -EACCES;
|
||||
|
||||
lock_sock(sk);
|
||||
|
Reference in New Issue
Block a user