d7784ee452
These leaks were observed in the RT kernel but the fixes are not RT specific. We deemed it prudent to also include the fixes in the std kernel as well. See the specific patches for details. Change-Id: I00e6d06a82e289806e5d51008ea1597735b2ad0f Closes-Bug: 1836638 Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
58 lines
2.3 KiB
Diff
58 lines
2.3 KiB
Diff
From e3887b1e84e274be02f992e034e0dba1f53925b6 Mon Sep 17 00:00:00 2001
|
|
Message-Id: <e3887b1e84e274be02f992e034e0dba1f53925b6.1566585829.git.Jim.Somerville@windriver.com>
|
|
From: Tommi Rantala <tt.rantala@gmail.com>
|
|
Date: Thu, 7 May 2015 15:12:21 +0300
|
|
Subject: [PATCH 1/3] ipvs: fix memory leak in ip_vs_ctl.c
|
|
|
|
[ commit f30bf2a5cac6c60ab366c4bc6db913597bf4d6ab in Linus' repo ]
|
|
|
|
Fix memory leak introduced in commit a0840e2e165a ("IPVS: netns,
|
|
ip_vs_ctl local vars moved to ipvs struct."):
|
|
|
|
unreferenced object 0xffff88005785b800 (size 2048):
|
|
comm "(-localed)", pid 1434, jiffies 4294755650 (age 1421.089s)
|
|
hex dump (first 32 bytes):
|
|
bb 89 0b 83 ff ff ff ff b0 78 f0 4e 00 88 ff ff .........x.N....
|
|
04 00 00 00 a4 01 00 00 00 00 00 00 00 00 00 00 ................
|
|
backtrace:
|
|
[<ffffffff8262ea8e>] kmemleak_alloc+0x4e/0xb0
|
|
[<ffffffff811fba74>] __kmalloc_track_caller+0x244/0x430
|
|
[<ffffffff811b88a0>] kmemdup+0x20/0x50
|
|
[<ffffffff823276b7>] ip_vs_control_net_init+0x1f7/0x510
|
|
[<ffffffff8231d630>] __ip_vs_init+0x100/0x250
|
|
[<ffffffff822363a1>] ops_init+0x41/0x190
|
|
[<ffffffff82236583>] setup_net+0x93/0x150
|
|
[<ffffffff82236cc2>] copy_net_ns+0x82/0x140
|
|
[<ffffffff810ab13d>] create_new_namespaces+0xfd/0x190
|
|
[<ffffffff810ab49a>] unshare_nsproxy_namespaces+0x5a/0xc0
|
|
[<ffffffff810833e3>] SyS_unshare+0x173/0x310
|
|
[<ffffffff8265cbd7>] system_call_fastpath+0x12/0x6f
|
|
[<ffffffffffffffff>] 0xffffffffffffffff
|
|
|
|
Fixes: a0840e2e165a ("IPVS: netns, ip_vs_ctl local vars moved to ipvs struct.")
|
|
Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
|
|
Acked-by: Julian Anastasov <ja@ssi.bg>
|
|
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
|
---
|
|
net/netfilter/ipvs/ip_vs_ctl.c | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
|
|
index 02409f3..3738b84 100644
|
|
--- a/net/netfilter/ipvs/ip_vs_ctl.c
|
|
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
|
|
@@ -3843,6 +3843,9 @@ static void __net_exit ip_vs_control_net_cleanup_sysctl(struct net *net)
|
|
cancel_delayed_work_sync(&ipvs->defense_work);
|
|
cancel_work_sync(&ipvs->defense_work.work);
|
|
unregister_net_sysctl_table(ipvs->sysctl_hdr);
|
|
+
|
|
+ if (!net_eq(net, &init_net))
|
|
+ kfree(ipvs->sysctl_tbl);
|
|
}
|
|
|
|
#else
|
|
--
|
|
1.8.3.1
|
|
|