[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <871toozlt4.fsf@x220.int.ebiederm.org>
Date: Thu, 27 Nov 2014 09:48:39 -0600
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH net] rtnetlink: release net refcnt on error in do_setlink()
Nicolas Dichtel <nicolas.dichtel@...nd.com> writes:
> rtnl_link_get_net() holds a reference on the 'struct net', we need to release
> it in case of error.
>
> CC: Eric W. Biederman <ebiederm@...ssion.com>
> Fixes: b51642f6d77b ("net: Enable a userns root rtnl calls that are safe for unprivilged users")
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Doh!
Reviewed-by: "Eric W. Biederman" <ebiederm@...ssion.com>
> ---
> net/core/rtnetlink.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index b9b7dfaf202b..76321ea442c3 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -1498,6 +1498,7 @@ static int do_setlink(const struct sk_buff *skb,
> goto errout;
> }
> if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) {
> + put_net(net);
> err = -EPERM;
> goto errout;
> }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists