net: Use netlink_ns_capable to verify the permisions of netlink messages
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / tipc / netlink.c
index 8bcd4985d0fb341f795346f06c55d1f059c4c643..1e6081fb60788f35d5413dd799e107652177ba97 100644 (file)
@@ -47,7 +47,7 @@ static int handle_cmd(struct sk_buff *skb, struct genl_info *info)
        int hdr_space = nlmsg_total_size(GENL_HDRLEN + TIPC_GENL_HDRLEN);
        u16 cmd;
 
-       if ((req_userhdr->cmd & 0xC000) && (!capable(CAP_NET_ADMIN)))
+       if ((req_userhdr->cmd & 0xC000) && (!netlink_capable(skb, CAP_NET_ADMIN)))
                cmd = TIPC_CMD_NOT_NET_ADMIN;
        else
                cmd = req_userhdr->cmd;