Wang Hai
e255e11e66
ipv6: addrlabel: fix possible memory leak in ip6addrlbl_net_init
...
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: 2a8cc6c89039 ("[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>
2020-11-25 11:20:16 -08:00
..
2020-06-20 21:33:57 -07:00
2020-11-19 10:49:50 -08:00
2020-08-31 12:26:39 -07:00
2020-11-13 18:20:00 -08:00
2020-11-25 11:20:16 -08:00
2020-08-31 12:26:39 -07:00
2020-11-18 10:53:16 -08:00
2020-07-30 16:30:55 -07:00
2020-10-13 17:11:52 -07:00
2020-07-24 17:12:41 -07:00
2020-06-20 21:33:57 -07:00
2020-07-28 07:57:23 +02:00
2019-07-27 14:23:48 -07:00
2019-05-30 11:26:32 -07:00
2020-07-13 17:20:39 -07:00
2019-10-04 11:10:56 -07:00
2020-07-28 17:42:31 -07:00
2020-06-20 21:33:57 -07:00
2020-10-31 13:16:02 -07:00
2019-12-24 22:28:54 -08:00
2020-08-31 13:08:10 -07:00
2018-10-24 14:18:16 -07:00
2020-10-15 12:43:21 -07:00
2020-08-05 20:13:21 -07:00
2020-09-28 16:01:37 -07:00
2020-06-19 13:41:59 -07:00
2020-03-30 13:45:04 -07:00
2020-06-23 20:10:15 -07:00
2019-05-30 11:26:32 -07:00
2020-10-15 18:42:13 -07:00
2020-10-30 08:07:30 -07:00
2020-06-01 14:57:14 -07:00
2020-10-06 06:23:21 -07:00
2020-07-24 15:41:54 -07:00
2020-07-09 12:55:37 +02:00
2020-08-02 01:02:12 -07:00
2020-09-18 17:45:04 -07:00
2020-03-29 22:30:57 -07:00
2019-06-05 17:37:07 +02:00
2020-06-15 13:29:39 -07:00
2019-06-06 08:34:50 +02:00
2020-11-13 14:24:39 -08:00
2020-10-30 12:57:39 +01:00
2019-05-21 10:50:45 +02:00
2020-07-03 14:36:04 -07:00
2019-06-07 11:00:14 -07:00
2019-05-30 11:26:32 -07:00
2020-08-20 15:45:14 -04:00
2020-11-19 10:49:50 -08:00
2020-10-15 12:43:21 -07:00
2020-06-23 20:27:09 -07:00
2020-04-18 15:04:27 -07:00
2020-05-08 15:32:17 +10:00
2020-08-03 17:57:40 -07:00
2020-06-04 15:39:32 -07:00
2020-06-04 15:39:32 -07:00
2020-11-09 15:07:40 -08:00
2020-11-10 17:42:35 -08:00
2020-09-02 15:44:53 -07:00
2020-11-24 14:12:55 -08:00
2019-05-30 11:26:32 -07:00
2020-07-09 12:52:37 +02:00
2020-07-24 15:41:54 -07:00
2020-11-12 09:55:51 -08:00
2020-07-31 02:00:48 +02:00
2020-07-19 18:16:41 -07:00
2020-05-06 09:40:08 +02:00
2020-05-06 09:40:08 +02:00
2019-12-24 22:28:54 -08:00
2020-04-28 11:28:36 +02:00
2020-05-06 09:40:08 +02:00
2020-10-09 12:29:48 +02:00