diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 061e27cb6c121249c18d763c0856305e8f32c435..204297dffd2aecc7d5616f839dc4f34c9359f7da 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -2952,14 +2952,10 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, name_assign_type = NET_NAME_ENUM; } - dest_net = rtnl_link_get_net(net, tb); + dest_net = rtnl_link_get_net_capable(skb, net, tb, CAP_NET_ADMIN); if (IS_ERR(dest_net)) return PTR_ERR(dest_net); - err = -EPERM; - if (!netlink_ns_capable(skb, dest_net->user_ns, CAP_NET_ADMIN)) - goto out; - if (tb[IFLA_LINK_NETNSID]) { int id = nla_get_s32(tb[IFLA_LINK_NETNSID]);