]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rtnetlink: release net refcnt on error in do_setlink()
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 27 Nov 2014 09:16:15 +0000 (10:16 +0100)
committerJiri Slaby <jslaby@suse.cz>
Tue, 6 Jan 2015 12:59:52 +0000 (13:59 +0100)
commit6f6204584a51a9c36732d289cc037c256208b20e
tree267bb0fcdcc6396d1581f0f6b7337ddaacbbafb7
parent0b79861fc455782afb8f490d9e2e9102fa196bc2
rtnetlink: release net refcnt on error in do_setlink()

[ Upstream commit e0ebde0e131b529fd721b24f62872def5ec3718c ]

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@xmission.com>
Fixes: b51642f6d77b ("net: Enable a userns root rtnl calls that are safe for unprivilged users")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
net/core/rtnetlink.c