linux-stable/fs/ocfs2
Shang XiaoJing 0000281f01 ocfs2: fix memory leak in ocfs2_stack_glue_init()
[ Upstream commit 13b6269dd0 ]

ocfs2_table_header should be free in ocfs2_stack_glue_init() if
ocfs2_sysfs_init() failed, otherwise kmemleak will report memleak.

BUG: memory leak
unreferenced object 0xffff88810eeb5800 (size 128):
  comm "modprobe", pid 4507, jiffies 4296182506 (age 55.888s)
  hex dump (first 32 bytes):
    c0 40 14 a0 ff ff ff ff 00 00 00 00 01 00 00 00  .@..............
    01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000001e59e1cd>] __register_sysctl_table+0xca/0xef0
    [<00000000c04f70f7>] 0xffffffffa0050037
    [<000000001bd12912>] do_one_initcall+0xdb/0x480
    [<0000000064f766c9>] do_init_module+0x1cf/0x680
    [<000000002ba52db0>] load_module+0x6441/0x6f20
    [<000000009772580d>] __do_sys_finit_module+0x12f/0x1c0
    [<00000000380c1f22>] do_syscall_64+0x3f/0x90
    [<000000004cf473bc>] entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/41651ca1-432a-db34-eb97-d35744559de1@linux.alibaba.com
Fixes: 3878f110f7 ("ocfs2: Move the hb_ctl_path sysctl into the stack glue.")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-07 12:07:13 +01:00
..
cluster ocfs2: fix a use after free on error 2021-03-03 17:44:40 +01:00
dlm fs/ocfs2/dlm/dlmdebug.c: fix a sleep-in-atomic-context bug in dlm_print_one_mle() 2019-11-28 18:28:41 +01:00
dlmfs ocfs2: dlmfs: fix error handling of user_dlm_destroy_lock 2022-06-14 16:52:34 +02:00
Kconfig
Makefile
acl.c ocfs2: fix passing zero to 'PTR_ERR' warning 2020-01-04 13:41:03 +01:00
acl.h
alloc.c ocfs2: fix data corruption after conversion from inline format 2021-10-27 09:34:00 +02:00
alloc.h ocfs2: retry on ENOSPC if sufficient space in truncate log 2016-08-02 17:31:41 -04:00
aops.c ocfs2: fix deadlock between setattr and dio_end_io_write 2021-04-16 11:59:06 +02:00
aops.h
blockcheck.c
blockcheck.h
buffer_head_io.c ocfs2: don't put and assigning null to bh allocated outside 2019-11-28 18:28:53 +01:00
buffer_head_io.h
dcache.c fs/ocfs2: fix race in ocfs2_dentry_attach_lock() 2019-06-22 08:17:18 +02:00
dcache.h
dir.c ocfs2: fix a misuse a of brelse after failing ocfs2_check_dir_entry 2018-11-21 09:26:00 +01:00
dir.h
dlmglue.c ocfs2: drop acl cache for directories too 2021-10-06 10:23:38 +02:00
dlmglue.h ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock 2017-10-21 17:21:36 +02:00
export.c ocfs2: fix ocfs2 read inode data panic in ocfs2_iget 2019-05-21 18:48:58 +02:00
export.h
extent_map.c
extent_map.h
file.c ocfs2: fix data corruption on truncate 2021-11-26 11:48:18 +01:00
file.h
filecheck.c ocfs2: fix snprintf() checking 2021-07-20 16:21:01 +02:00
filecheck.h
heartbeat.c
heartbeat.h
inode.c
inode.h ocfs2: fix undefined struct variable in inode.h 2016-10-07 18:46:26 -07:00
ioctl.c fs: ocfs2: fix a possible null-pointer dereference in ocfs2_info_scan_inode_alloc() 2019-11-06 12:18:11 +01:00
ioctl.h
journal.c ocfs2: call journal flush to mark journal as empty after journal recovery when mount 2020-01-23 08:19:38 +01:00
journal.h ocfs2: fix a NULL pointer dereference when call ocfs2_update_inode_fsync_trans() 2020-02-28 15:42:41 +01:00
localalloc.c ocfs2: fix panic due to ocfs2_wq is null 2019-10-29 09:15:08 +01:00
localalloc.h
locks.c
locks.h
mmap.c
mmap.h
move_extents.c ocfs2: fix clusters leak in ocfs2_defrag_extent() 2019-11-28 18:28:53 +01:00
move_extents.h
namei.c ocfs2: fix BUG when iput after ocfs2_mknod fails 2022-11-03 23:49:14 +09:00
namei.h
ocfs1_fs_compat.h
ocfs2.h ocfs2: change slot number type s16 to u16 2020-08-21 11:02:08 +02:00
ocfs2_fs.h ocfs2: fix value of OCFS2_INVALID_SLOT 2020-06-30 15:38:44 -04:00
ocfs2_ioctl.h
ocfs2_lockid.h
ocfs2_lockingver.h
ocfs2_trace.h switch generic_file_splice_read() to use of ->read_iter() 2016-10-05 18:23:56 -04:00
quota.h
quota_global.c quota: Check that quota is not dirty before release 2019-12-21 10:42:08 +01:00
quota_local.c
refcounttree.c fs: Replace CURRENT_TIME with current_time() for inode timestamps 2016-09-27 21:06:21 -04:00
refcounttree.h
reservations.c
reservations.h
resize.c
resize.h
slot_map.c
slot_map.h
stack_o2cb.c
stack_user.c ocfs2: ensure that dlm lockspace is created by kernel module 2016-08-02 17:31:41 -04:00
stackglue.c ocfs2: fix memory leak in ocfs2_stack_glue_init() 2023-01-07 12:07:13 +01:00
stackglue.h ocfs2: remove ocfs2_is_o2cb_active() 2019-11-28 18:29:02 +01:00
suballoc.c ocfs2: change slot number type s16 to u16 2020-08-21 11:02:08 +02:00
suballoc.h
super.c ocfs2: mount fails with buffer overflow in strlen 2021-10-27 09:34:00 +02:00
super.h
symlink.c vfs: Remove {get,set,remove}xattr inode operations 2016-10-07 21:48:36 -04:00
symlink.h
sysfile.c
sysfile.h
uptodate.c
uptodate.h
xattr.c Revert "fs: ocfs2: fix possible null-pointer dereferences in ocfs2_xa_prepare_entry()" 2019-11-28 18:28:08 +01:00
xattr.h