Message ID | 1314993400-6910-11-git-send-email-serge@hallyn.com |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 0a4db02..3cc0bbe 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -580,8 +580,9 @@ retry: static inline int netlink_capable(struct socket *sock, unsigned int flag) { - return (nl_table[sock->sk->sk_protocol].nl_nonroot & flag) || - capable(CAP_NET_ADMIN); + if (nl_table[sock->sk->sk_protocol].nl_nonroot & flag) + return 1; + return ns_capable(sock_net(sock->sk)->user_ns, CAP_NET_ADMIN); } static void