lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 18 Jan 2008 15:53:14 +0300 From: "Denis V. Lunev" <den@...nvz.org> To: davem@...emloft.net Cc: netdev@...r.kernel.org, devel@...nvz.org, containers@...ts.osdl.org, "Denis V. Lunev" <den@...nvz.org> Subject: [PATCH] [NETNS 2/4 net-2.6.25] Memory leak on network namespace stop. Network namespace allocates 2 kernel netlink sockets, fibnl & rtnl. These sockets should be disposed properly, i.e. by sock_release. Plain sock_put is not enough. Signed-off-by: Denis V. Lunev <den@...nvz.org> Tested-by: Alexey Dobriyan <adobriyan@...nvz.org> --- net/core/rtnetlink.c | 2 +- net/ipv4/fib_frontend.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 4a07e83..2c1f665 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -1381,7 +1381,7 @@ static void rtnetlink_net_exit(struct net *net) * free. */ sk->sk_net = get_net(&init_net); - sock_put(sk); + sock_release(net->rtnl->sk_socket); net->rtnl = NULL; } } diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 8ddcd3f..4e5216e 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -881,7 +881,7 @@ static void nl_fib_lookup_exit(struct net *net) * initial network namespace. So the socket will be safe to free. */ net->ipv4.fibnl->sk_net = get_net(&init_net); - sock_put(net->ipv4.fibnl); + sock_release(net->ipv4.fibnl->sk_socket); } static void fib_disable_ip(struct net_device *dev, int force) -- 1.5.3.rc5 -- 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