linux-stable/fs/orangefs
Zhang Xiaoxu 44d3eac26a 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-07 12:07:33 +01:00
..
Kconfig
Makefile Orangefs: change pvfs2 filenames to orangefs 2015-12-04 12:56:14 -05:00
acl.c orangefs: Don't clear SGID when inheriting ACLs 2017-09-27 14:39:18 +02:00
dcache.c fs: orangefs: fix error return code of orangefs_revalidate_lookup() 2021-11-26 11:48:38 +01:00
devorangefs-req.c orangefs: initialize op on loop restart in orangefs_devreq_read 2018-01-31 12:55:50 +01:00
dir.c orangefs: use %pd/%pD 2016-08-07 23:38:47 -04:00
downcall.h orangefs: add features op 2016-08-12 15:12:54 -04:00
file.c orangefs: fix deadlock; do not write i_size in read_iter 2018-01-31 12:55:53 +01:00
inode.c orangefs: do not check possibly stale size on truncate 2017-05-20 14:28:39 +02:00
namei.c orangefs: set i_size on new symlink 2018-06-26 08:08:08 +08:00
orangefs-bufmap.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
orangefs-bufmap.h orangefs-bufmap.h: trim unused junk 2016-03-25 22:30:54 -04:00
orangefs-cache.c orangefs: add features op 2016-08-12 15:12:54 -04:00
orangefs-debug.h Orangef: remove overlooked old-style userspace debug parts 2015-12-11 11:00:12 -05:00
orangefs-debugfs.c orangefs: Fix kmemleak in orangefs_prepare_debugfs_help_string() 2023-01-07 12:07:33 +01:00
orangefs-debugfs.h orangefs: clean up debugfs globals 2016-08-15 11:38:36 -04:00
orangefs-dev-proto.h orangefs: fix buffer size mis-match between kernel space and user space. 2017-04-18 07:11:47 +02:00
orangefs-kernel.h orangefs: fix deadlock; do not write i_size in read_iter 2018-01-31 12:55:53 +01:00
orangefs-mod.c orangefs: Fix sysfs not cleanup when dev init failed 2023-01-07 12:07:24 +01:00
orangefs-sysfs.c orangefs: rate limit the client not running info message 2019-11-25 09:53:50 +01:00
orangefs-sysfs.h Orangefs: change pvfs2 filenames to orangefs 2015-12-04 12:56:14 -05:00
orangefs-utils.c fs: add i_blocksize() 2017-06-14 15:06:00 +02:00
protocol.h orangefs: clean up debugfs globals 2016-08-15 11:38:36 -04:00
super.c orangefs: fix orangefs df output. 2021-07-20 16:21:13 +02:00
symlink.c vfs: Remove {get,set,remove}xattr inode operations 2016-10-07 21:48:36 -04:00
upcall.h orangefs: add features op 2016-08-12 15:12:54 -04:00
waitqueue.c orangefs: do not wait for timeout if umounting 2018-03-24 11:00:16 +01:00
xattr.c orangefs: off by ones in xattr size checks 2018-11-10 07:42:46 -08:00