linux-stable/fs/ocfs2
Heming Zhao f377ac7597 ocfs2: fix freeing uninitialized resource on ocfs2_dlm_shutdown
commit 550842cc60 upstream.

After commit 0737e01de9 ("ocfs2: ocfs2_mount_volume does cleanup job
before return error"), any procedure after ocfs2_dlm_init() fails will
trigger crash when calling ocfs2_dlm_shutdown().

ie: On local mount mode, no dlm resource is initialized.  If
ocfs2_mount_volume() fails in ocfs2_find_slot(), error handling will call
ocfs2_dlm_shutdown(), then does dlm resource cleanup job, which will
trigger kernel crash.

This solution should bypass uninitialized resources in
ocfs2_dlm_shutdown().

Link: https://lkml.kernel.org/r/20220815085754.20417-1-heming.zhao@suse.com
Fixes: 0737e01de9 ("ocfs2: ocfs2_mount_volume does cleanup job before return error")
Signed-off-by: Heming Zhao <heming.zhao@suse.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>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-31 17:18:16 +02:00
..
cluster Merge branch 'akpm' (patches from Andrew) 2022-03-22 16:11:53 -07:00
dlm ocfs2: remove usage of list iterator variable after the loop body 2022-04-29 14:37:57 -07:00
dlmfs ocfs2: dlmfs: fix error handling of user_dlm_destroy_lock 2022-05-25 13:05:42 -07:00
Kconfig ocfs2: replace HTTP links with HTTPS ones 2020-08-07 11:33:22 -07:00
Makefile ocfs2: improve ocfs2 Makefile 2018-12-28 12:11:45 -08:00
acl.c vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
acl.h vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
alloc.c ocfs2: Convert ocfs2 to read_folio 2022-05-09 16:21:46 -04:00
alloc.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
aops.c fs: Change try_to_free_buffers() to take a folio 2022-05-09 23:12:34 -04:00
aops.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
blockcheck.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
blockcheck.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
buffer_head_io.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
buffer_head_io.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
dcache.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
dcache.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
dir.c fs/ocfs2: fix comments mentioning i_mutex 2022-03-22 15:57:00 -07:00
dir.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
dlmglue.c ocfs2: fix freeing uninitialized resource on ocfs2_dlm_shutdown 2022-08-31 17:18:16 +02:00
dlmglue.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
export.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
export.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
extent_map.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
extent_map.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
file.c ocfs2: Convert ocfs2 to read_folio 2022-05-09 16:21:46 -04:00
file.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
filecheck.c ocfs2: use default_groups in kobj_type 2022-01-15 16:30:24 +02:00
filecheck.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
heartbeat.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
heartbeat.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
inode.c ocfs2: fix mounting crash if journal is not alloced 2022-04-29 14:37:58 -07:00
inode.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
ioctl.c block: add a bdev_discard_granularity helper 2022-04-17 19:49:59 -06:00
ioctl.h ocfs2: convert to fileattr 2021-04-12 15:04:30 +02:00
journal.c ocfs2: fix mounting crash if journal is not alloced 2022-04-29 14:37:58 -07:00
journal.h ocfs2: fix mounting crash if journal is not alloced 2022-04-29 14:37:58 -07:00
localalloc.c fs/ocfs2: fix comments mentioning i_mutex 2022-03-22 15:57:00 -07:00
localalloc.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
locks.c fs: remove mandatory file locking support 2021-08-23 06:15:36 -04:00
locks.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
mmap.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
mmap.h
move_extents.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
move_extents.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
namei.c fs/ocfs2: fix comments mentioning i_mutex 2022-03-22 15:57:00 -07:00
namei.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
ocfs1_fs_compat.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
ocfs2.h Revert "ocfs2: mount shared volume without ha stack" 2022-07-18 15:09:15 -07:00
ocfs2_fs.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
ocfs2_ioctl.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
ocfs2_lockid.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
ocfs2_lockingver.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
ocfs2_trace.h ocfs2: fix the application IO timeout when fstrim is running 2019-03-05 21:07:13 -08:00
quota.h
quota_global.c ocfs2: fix crash when mount with quota enabled 2022-04-01 11:46:09 -07:00
quota_local.c ocfs2: replace usage of found with dedicated list iterator variable 2022-04-29 14:37:57 -07:00
refcounttree.c fs: Convert block_read_full_page() to block_read_full_folio() 2022-05-09 16:21:44 -04:00
refcounttree.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
reservations.c ocfs2: change return type of ocfs2_resmap_init 2022-04-29 14:37:58 -07:00
reservations.h ocfs2: change return type of ocfs2_resmap_init 2022-04-29 14:37:58 -07:00
resize.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
resize.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
slot_map.c Revert "ocfs2: mount shared volume without ha stack" 2022-07-18 15:09:15 -07:00
slot_map.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
stack_o2cb.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
stack_user.c ocfs2: cleanup some return variables 2022-03-22 15:57:00 -07:00
stackglue.c ocfs2: fix subdirectory registration with register_sysctl() 2022-01-28 18:15:16 +02:00
stackglue.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
suballoc.c ocfs2: fix a deadlock when commit trans 2022-01-30 09:56:58 +02:00
suballoc.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
super.c ocfs2: fix freeing uninitialized resource on ocfs2_dlm_shutdown 2022-08-31 17:18:16 +02:00
super.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
symlink.c ocfs2: Convert ocfs2 to read_folio 2022-05-09 16:21:46 -04:00
symlink.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
sysfile.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
sysfile.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
uptodate.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
uptodate.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
xattr.c fs/ocfs2: fix comments mentioning i_mutex 2022-03-22 15:57:00 -07:00
xattr.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00