Wang Hai
fa6882c636
tipc: fix memory leak in tipc_topsrv_start()
...
kmemleak report a memory leak as follows:
unreferenced object 0xffff88810a596800 (size 512):
comm "ip", pid 21558, jiffies 4297568990 (age 112.120s)
hex dump (first 32 bytes):
00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N..........
ff ff ff ff ff ff ff ff 00 83 60 b0 ff ff ff ff ..........`.....
backtrace:
[<0000000022bbe21f>] tipc_topsrv_init_net+0x1f3/0xa70
[<00000000fe15ddf7>] ops_init+0xa8/0x3c0
[<00000000138af6f2>] setup_net+0x2de/0x7e0
[<000000008c6807a3>] copy_net_ns+0x27d/0x530
[<000000006b21adbd>] create_new_namespaces+0x382/0xa30
[<00000000bb169746>] unshare_nsproxy_namespaces+0xa1/0x1d0
[<00000000fe2e42bc>] ksys_unshare+0x39c/0x780
[<0000000009ba3b19>] __x64_sys_unshare+0x2d/0x40
[<00000000614ad866>] do_syscall_64+0x56/0xa0
[<00000000a1b5ca3c>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
'srv' is malloced in tipc_topsrv_start() but not free before
leaving from the error handling cases. We need to free it.
Fixes: 5c45ab24ac77 ("tipc: make struct tipc_server private for server.c")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Link: https://lore.kernel.org/r/20201109140913.47370-1-wanghai38@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-11-11 14:39:23 -08:00
..
2019-08-11 21:40:04 -07:00
2018-03-23 13:12:18 -04:00
2020-10-16 14:09:12 -07:00
2020-06-17 08:53:34 -07:00
2020-08-23 17:36:59 -05:00
2019-12-10 17:31:15 -08:00
2020-09-07 12:08:53 -07:00
2020-09-07 12:08:53 -07:00
2020-10-25 11:39:02 -07:00
2020-09-18 13:58:37 -07:00
2018-08-29 18:04:54 -07:00
2020-07-13 17:20:40 -07:00
2018-03-23 13:12:17 -04:00
2020-08-03 16:21:46 -07:00
2020-09-14 16:36:20 -07:00
2018-06-30 21:05:42 +09:00
2019-12-10 17:31:15 -08:00
2020-08-16 21:04:55 -07:00
2020-09-22 16:45:34 -07:00
2020-05-26 15:16:52 -07:00
2020-01-08 12:38:54 -08:00
2020-03-15 00:07:00 -07:00
2019-11-12 19:45:45 -08:00
2020-10-29 09:51:52 -07:00
2020-09-18 13:58:37 -07:00
2020-10-09 18:29:06 -07:00
2020-06-17 08:53:34 -07:00
2020-06-17 08:53:34 -07:00
2020-06-17 08:53:34 -07:00
2020-09-07 12:08:53 -07:00
2020-09-07 12:08:53 -07:00
2020-10-02 19:11:11 -07:00
2020-09-18 13:58:37 -07:00
2019-10-06 15:44:47 +02:00
2020-10-15 12:43:21 -07:00
2020-09-18 13:58:37 -07:00
2020-09-22 16:45:34 -07:00
2020-05-28 11:11:46 -07:00
2018-04-12 21:46:10 -04:00
2020-05-13 12:33:19 -07:00
2020-09-18 13:58:37 -07:00
2020-11-11 14:39:23 -08:00
2018-02-16 15:26:34 -05:00
2019-01-17 22:04:43 -08:00
2020-05-26 15:16:52 -07:00
2020-09-18 14:56:44 -07:00
2018-04-20 11:04:05 -04:00