Wang Hai
716cd2eba3
ipv6: addrlabel: fix possible memory leak in ip6addrlbl_net_init
[ Upstream commit e255e11e66 ]
kmemleak report a memory leak as follows:
unreferenced object 0xffff8880059c6a00 (size 64):
comm "ip", pid 23696, jiffies 4296590183 (age 1755.384s)
hex dump (first 32 bytes):
20 01 00 10 00 00 00 00 00 00 00 00 00 00 00 00 ...............
1c 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00 ................
backtrace:
[<00000000aa4e7a87>] ip6addrlbl_add+0x90/0xbb0
[<0000000070b8d7f1>] ip6addrlbl_net_init+0x109/0x170
[<000000006a9ca9d4>] ops_init+0xa8/0x3c0
[<000000002da57bf2>] setup_net+0x2de/0x7e0
[<000000004e52d573>] copy_net_ns+0x27d/0x530
[<00000000b07ae2b4>] create_new_namespaces+0x382/0xa30
[<000000003b76d36f>] unshare_nsproxy_namespaces+0xa1/0x1d0
[<0000000030653721>] ksys_unshare+0x3a4/0x780
[<0000000007e82e40>] __x64_sys_unshare+0x2d/0x40
[<0000000031a10c08>] do_syscall_64+0x33/0x40
[<0000000099df30e7>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
We should free all rules when we catch an error in ip6addrlbl_net_init().
otherwise a memory leak will occur.
Fixes: 2a8cc6c890 ("[IPV6] ADDRCONF: Support RFC3484 configurable address selection policy table.")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Link: https://lore.kernel.org/r/20201124071728.8385-1-wanghai38@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-08 10:18:51 +01:00
..
2020-11-05 11:08:44 +01:00
2020-10-01 13:14:43 +02:00
2020-07-31 18:37:48 +02:00
2020-12-02 08:48:10 +01:00
2020-10-30 10:38:30 +01:00
2020-11-24 13:27:17 +01:00
2020-11-24 13:27:22 +01:00
2020-11-05 11:08:53 +01:00
2020-11-24 13:27:17 +01:00
2020-09-26 18:01:29 +02:00
2020-04-29 16:31:16 +02:00
2020-04-23 10:30:24 +02:00
2020-11-10 12:36:02 +01:00
2020-04-21 09:03:03 +02:00
2020-11-24 13:27:18 +01:00
2020-12-08 10:18:51 +01:00
2020-11-18 19:18:51 +01:00
2020-09-26 18:01:28 +02:00
2020-07-22 09:31:59 +02:00
2020-10-01 13:14:26 +02:00
2020-11-24 13:27:26 +01:00
2020-10-01 13:14:51 +02:00
2020-04-29 16:31:17 +02:00
2020-11-24 13:27:19 +01:00
2020-11-18 19:18:44 +01:00
2020-11-24 13:27:17 +01:00
2020-07-22 09:31:58 +02:00
2020-04-29 16:31:21 +02:00
2020-10-29 09:54:58 +01:00
2020-10-14 10:31:24 +02:00
2020-10-07 08:00:08 +02:00
2020-09-26 18:01:30 +02:00
2020-08-05 10:06:01 +02:00
2020-10-14 10:31:26 +02:00
2020-11-18 19:18:53 +01:00
2020-11-24 13:27:18 +01:00
2020-10-29 09:54:55 +01:00
2020-10-30 10:38:23 +01:00
2020-11-18 19:18:51 +01:00
2020-10-29 09:54:56 +01:00
2020-10-01 13:14:32 +02:00
2020-11-10 12:35:59 +01:00
2020-11-18 19:18:45 +01:00
2020-11-24 13:27:18 +01:00
2020-06-25 15:33:05 +02:00
2020-11-18 19:18:41 +01:00
2020-08-21 11:05:32 +02:00
2020-08-19 08:15:03 +02:00