linux-stable/fs/orangefs
Zhang Xiaoxu c885326728 orangefs: Fix kmemleak in orangefs_{kernel,client}_debug_init()
[ Upstream commit 31720a2b10 ]

When insert and remove the orangefs module, there are memory leaked
as below:

unreferenced object 0xffff88816b0cc000 (size 2048):
  comm "insmod", pid 783, jiffies 4294813439 (age 65.512s)
  hex dump (first 32 bytes):
    6e 6f 6e 65 0a 00 00 00 00 00 00 00 00 00 00 00  none............
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000031ab7788>] kmalloc_trace+0x27/0xa0
    [<000000005b405fee>] orangefs_debugfs_init.cold+0xaf/0x17f
    [<00000000e5a0085b>] 0xffffffffa02780f9
    [<000000004232d9f7>] do_one_initcall+0x87/0x2a0
    [<0000000054f22384>] do_init_module+0xdf/0x320
    [<000000003263bdea>] load_module+0x2f98/0x3330
    [<0000000052cd4153>] __do_sys_finit_module+0x113/0x1b0
    [<00000000250ae02b>] do_syscall_64+0x35/0x80
    [<00000000f11c03c7>] entry_SYSCALL_64_after_hwframe+0x46/0xb0

Use the golbal variable as the buffer rather than dynamic allocate to
slove the problem.

Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:14:44 +01:00
..
acl.c vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
dcache.c fs: orangefs: fix error return code of orangefs_revalidate_lookup() 2021-11-18 19:17:01 +01:00
devorangefs-req.c
dir.c
downcall.h
file.c Orangef: implement orangefs_readahead. 2021-04-28 07:33:04 -04:00
inode.c fs: add generic helper for filling statx attribute flags 2021-08-17 11:47:43 +02:00
Kconfig
Makefile
namei.c fs: make helpers idmap mount aware 2021-01-24 14:27:20 +01:00
orangefs-bufmap.c orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc() 2022-01-20 09:13:13 +01:00
orangefs-bufmap.h
orangefs-cache.c
orangefs-debug.h
orangefs-debugfs.c orangefs: Fix kmemleak in orangefs_{kernel,client}_debug_init() 2022-12-31 13:14:44 +01:00
orangefs-debugfs.h
orangefs-dev-proto.h
orangefs-kernel.h vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
orangefs-mod.c orangefs: Fix sysfs not cleanup when dev init failed 2022-12-31 13:14:26 +01:00
orangefs-sysfs.c
orangefs-sysfs.h
orangefs-utils.c orangefs_inode_is_stale(): i_mode type bits do *not* form a bitmap... 2021-03-12 22:15:17 -05:00
protocol.h
super.c orangefs: fix orangefs df output. 2021-06-28 08:40:08 -04:00
symlink.c
upcall.h
waitqueue.c
xattr.c acl: handle idmapped mounts 2021-01-24 14:27:17 +01:00