]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: fix freeing uninitialized resource on ocfs2_dlm_shutdown
authorHeming Zhao <ocfs2-devel@oss.oracle.com>
Mon, 15 Aug 2022 08:57:54 +0000 (16:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:42:06 +0000 (11:42 +0100)
commit2b1c5dc69b27b0d34f537b91f8332245039a8902
treef3173b769368ae95090e15a49c5accd755059b0c
parent3f88104b11d1922de6b06c47cc805f07a6318551
ocfs2: fix freeing uninitialized resource on ocfs2_dlm_shutdown

commit 1803497a4cc03102949e351e90af1c1b305536bc upstream.

After commit 384885bdcf42 ("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: 384885bdcf42 ("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>
fs/ocfs2/dlmglue.c
fs/ocfs2/super.c