linux-stable/fs/orangefs
Zhang Xiaoxu ba9d3b9cec orangefs: Fix kmemleak in orangefs_prepare_debugfs_help_string()
[ Upstream commit d23417a5bf ]

When insert and remove the orangefs module, then debug_help_string will
be leaked:

  unreferenced object 0xffff8881652ba000 (size 4096):
    comm "insmod", pid 1701, jiffies 4294893639 (age 13218.530s)
    hex dump (first 32 bytes):
      43 6c 69 65 6e 74 20 44 65 62 75 67 20 4b 65 79  Client Debug Key
      77 6f 72 64 73 20 61 72 65 20 75 6e 6b 6e 6f 77  words are unknow
    backtrace:
      [<0000000004e6f8e3>] kmalloc_trace+0x27/0xa0
      [<0000000006f75d85>] orangefs_prepare_debugfs_help_string+0x5e/0x480 [orangefs]
      [<0000000091270a2a>] _sub_I_65535_1+0x57/0xf70 [crc_itu_t]
      [<000000004b1ee1a3>] do_one_initcall+0x87/0x2a0
      [<000000001d0614ae>] do_init_module+0xdf/0x320
      [<00000000efef068c>] load_module+0x2f98/0x3330
      [<000000006533b44d>] __do_sys_finit_module+0x113/0x1b0
      [<00000000a0da6f99>] do_syscall_64+0x35/0x80
      [<000000007790b19b>] entry_SYSCALL_64_after_hwframe+0x46/0xb0

When remove the module, should always free debug_help_string. Should
always free the allocated buffer when change the free_debug_help_string.

Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-18 11:30:37 +01:00
..
Kconfig
Makefile
acl.c get rid of pointless includes of fs_struct.h 2018-02-22 14:28:50 -05:00
dcache.c fs: orangefs: fix error return code of orangefs_revalidate_lookup() 2021-11-26 11:36:14 +01:00
devorangefs-req.c Merge branch 'work.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-06-16 16:21:50 +09:00
dir.c
downcall.h
file.c orangefs: Adding new return type vm_fault_t 2018-08-14 12:07:14 -04:00
inode.c orangefs: remove redundant pointer orangefs_inode 2018-08-14 12:07:14 -04:00
namei.c orangefs: fixes and cleanups 2018-06-07 09:23:12 -07:00
orangefs-bufmap.c orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc() 2022-01-27 09:04:13 +01:00
orangefs-bufmap.h
orangefs-cache.c
orangefs-debug.h orangefs: remove unused code 2018-04-03 21:55:28 -04:00
orangefs-debugfs.c orangefs: Fix kmemleak in orangefs_prepare_debugfs_help_string() 2023-01-18 11:30:37 +01:00
orangefs-debugfs.h
orangefs-dev-proto.h
orangefs-kernel.h vfs/y2038: inode timestamps conversion to timespec64 2018-06-15 07:31:07 +09:00
orangefs-mod.c orangefs: Fix sysfs not cleanup when dev init failed 2023-01-18 11:30:23 +01:00
orangefs-sysfs.c orangefs: rate limit the client not running info message 2019-11-24 08:20:57 +01:00
orangefs-sysfs.h
orangefs-utils.c orangefs: formatting cleanups 2018-06-01 14:51:30 -04:00
protocol.h orangefs: specify user pointers when using dev_map_desc and bufmap 2018-06-01 14:51:36 -04:00
super.c orangefs: fix orangefs df output. 2021-07-20 16:16:11 +02:00
symlink.c
upcall.h
waitqueue.c orangefs: use sparse annotations for holding locks across function calls. 2018-06-01 14:51:49 -04:00
xattr.c