Zhang Xiaoxu
45aea4fbf6
nfs4: Fix kmemleak when allocate slot failed
...
[ Upstream commit 7e8436728e22181c3f12a5dbabd35ed3a8b8c593 ]
If one of the slot allocate failed, should cleanup all the other
allocated slots, otherwise, the allocated slots will leak:
unreferenced object 0xffff8881115aa100 (size 64):
comm ""mount.nfs"", pid 679, jiffies 4294744957 (age 115.037s)
hex dump (first 32 bytes):
00 cc 19 73 81 88 ff ff 00 a0 5a 11 81 88 ff ff ...s......Z.....
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<000000007a4c434a>] nfs4_find_or_create_slot+0x8e/0x130
[<000000005472a39c>] nfs4_realloc_slot_table+0x23f/0x270
[<00000000cd8ca0eb>] nfs40_init_client+0x4a/0x90
[<00000000128486db>] nfs4_init_client+0xce/0x270
[<000000008d2cacad>] nfs4_set_client+0x1a2/0x2b0
[<000000000e593b52>] nfs4_create_server+0x300/0x5f0
[<00000000e4425dd2>] nfs4_try_get_tree+0x65/0x110
[<00000000d3a6176f>] vfs_get_tree+0x41/0xf0
[<0000000016b5ad4c>] path_mount+0x9b3/0xdd0
[<00000000494cae71>] __x64_sys_mount+0x190/0x1d0
[<000000005d56bdec>] do_syscall_64+0x35/0x80
[<00000000687c9ae4>] entry_SYSCALL_64_after_hwframe+0x46/0xb0
Fixes: abf79bb341bf ("NFS: Add a slot table to struct nfs_client for NFSv4.0 transport blocking")
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-10 18:14:16 +01:00
..
2020-08-23 17:36:59 -05:00
2021-06-03 09:00:35 +02:00
2021-11-18 14:04:22 +01:00
2022-06-22 14:13:16 +02:00
2022-04-08 14:40:27 +02:00
2022-02-16 12:54:18 +01:00
2022-02-16 12:54:17 +01:00
2022-11-10 18:14:16 +01:00
2021-07-20 16:05:47 +02:00
2022-04-13 21:01:04 +02:00
2022-04-13 21:01:02 +02:00
2020-05-27 10:10:12 -04:00
2022-06-09 10:21:19 +02:00
2022-05-18 10:23:43 +02:00
2020-05-08 22:20:24 +01:00
2020-03-30 19:56:50 -04:00
2022-04-13 21:01:04 +02:00
2022-06-06 08:42:44 +02:00
2021-03-30 14:31:49 +02:00
2020-07-13 17:52:46 -04:00
2020-05-14 18:42:44 -04:00
2020-10-06 10:21:18 -04:00
2022-04-08 14:40:25 +02:00
2020-08-23 17:36:59 -05:00
2022-08-21 15:15:18 +02:00
2021-07-20 16:05:51 +02:00
2022-04-08 14:40:25 +02:00
2022-02-16 12:54:18 +01:00
2022-11-10 18:14:16 +01:00
2022-08-31 17:15:15 +02:00
2022-08-25 11:37:54 +02:00
2022-02-16 12:54:18 +01:00
2022-08-25 11:37:54 +02:00
2020-02-04 12:27:55 -05:00
2022-11-10 18:14:16 +01:00
2021-01-19 18:27:30 +01:00
2020-01-15 10:54:33 -05:00
2020-10-02 08:43:09 -04:00
2022-02-16 12:54:18 +01:00
2020-07-13 17:52:45 -04:00
2022-04-13 21:01:01 +02:00
2020-11-12 10:40:02 -05:00
2021-12-01 09:19:03 +01:00
2020-11-02 10:29:03 -05:00
2020-07-13 17:52:45 -04:00
2022-04-13 21:01:03 +02:00
2022-04-13 21:01:03 +02:00
2022-06-22 14:13:16 +02:00
2022-06-22 14:13:16 +02:00
2020-01-24 16:51:13 -05:00
2020-06-11 13:33:48 -04:00
2022-09-23 14:16:57 +02:00
2020-10-15 13:31:08 -04:00
2020-10-15 13:31:08 -04:00
2020-03-16 08:34:29 -04:00
2022-06-09 10:21:19 +02:00