]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Apr 2023 08:48:02 +0000 (10:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Apr 2023 08:48:02 +0000 (10:48 +0200)
added patches:
kbuild-fix-single-directory-build.patch
ocfs2-fix-freeing-uninitialized-resource-on-ocfs2_dlm_shutdown.patch

queue-5.15/kbuild-fix-single-directory-build.patch [new file with mode: 0644]
queue-5.15/ocfs2-fix-freeing-uninitialized-resource-on-ocfs2_dlm_shutdown.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/kbuild-fix-single-directory-build.patch b/queue-5.15/kbuild-fix-single-directory-build.patch
new file mode 100644 (file)
index 0000000..ae25292
--- /dev/null
@@ -0,0 +1,35 @@
+From 3753af778dd9d0d5199d6a7d01b0ead33135d095 Mon Sep 17 00:00:00 2001
+From: Masahiro Yamada <masahiroy@kernel.org>
+Date: Sat, 15 Oct 2022 05:18:11 +0900
+Subject: kbuild: fix single directory build
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+commit 3753af778dd9d0d5199d6a7d01b0ead33135d095 upstream.
+
+Commit f110e5a250e3 ("kbuild: refactor single builds of *.ko") was wrong.
+
+KBUILD_MODULES _is_ needed for single builds.
+
+Otherwise, "make foo/bar/baz/" does not build module objects at all.
+
+Fixes: f110e5a250e3 ("kbuild: refactor single builds of *.ko")
+Reported-by: David Sterba <dsterba@suse.cz>
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Tested-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/Makefile
++++ b/Makefile
+@@ -1890,6 +1890,8 @@ export KBUILD_SINGLE_TARGETS := $(addpre
+ build-dirs := $(foreach d, $(build-dirs), \
+                       $(if $(filter $(d)/%, $(KBUILD_SINGLE_TARGETS)), $(d)))
++KBUILD_MODULES := 1
++
+ endif
+ # Handle descending into subdirectories listed in $(build-dirs)
diff --git a/queue-5.15/ocfs2-fix-freeing-uninitialized-resource-on-ocfs2_dlm_shutdown.patch b/queue-5.15/ocfs2-fix-freeing-uninitialized-resource-on-ocfs2_dlm_shutdown.patch
new file mode 100644 (file)
index 0000000..9383fb5
--- /dev/null
@@ -0,0 +1,69 @@
+From 550842cc60987b269e31b222283ade3e1b6c7fc8 Mon Sep 17 00:00:00 2001
+From: Heming Zhao <ocfs2-devel@oss.oracle.com>
+Date: Mon, 15 Aug 2022 16:57:54 +0800
+Subject: ocfs2: fix freeing uninitialized resource on ocfs2_dlm_shutdown
+
+From: Heming Zhao <ocfs2-devel@oss.oracle.com>
+
+commit 550842cc60987b269e31b222283ade3e1b6c7fc8 upstream.
+
+After commit 0737e01de9c4 ("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: 0737e01de9c4 ("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 |    8 +++++---
+ fs/ocfs2/super.c   |    3 +--
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+--- a/fs/ocfs2/dlmglue.c
++++ b/fs/ocfs2/dlmglue.c
+@@ -3403,10 +3403,12 @@ void ocfs2_dlm_shutdown(struct ocfs2_sup
+       ocfs2_lock_res_free(&osb->osb_nfs_sync_lockres);
+       ocfs2_lock_res_free(&osb->osb_orphan_scan.os_lockres);
+-      ocfs2_cluster_disconnect(osb->cconn, hangup_pending);
+-      osb->cconn = NULL;
++      if (osb->cconn) {
++              ocfs2_cluster_disconnect(osb->cconn, hangup_pending);
++              osb->cconn = NULL;
+-      ocfs2_dlm_shutdown_debug(osb);
++              ocfs2_dlm_shutdown_debug(osb);
++      }
+ }
+ static int ocfs2_drop_lock(struct ocfs2_super *osb,
+--- a/fs/ocfs2/super.c
++++ b/fs/ocfs2/super.c
+@@ -1918,8 +1918,7 @@ static void ocfs2_dismount_volume(struct
+           !ocfs2_is_hard_readonly(osb))
+               hangup_needed = 1;
+-      if (osb->cconn)
+-              ocfs2_dlm_shutdown(osb, hangup_needed);
++      ocfs2_dlm_shutdown(osb, hangup_needed);
+       ocfs2_blockcheck_stats_debugfs_remove(&osb->osb_ecc_stats);
+       debugfs_remove_recursive(osb->osb_debug_root);
index da57d884391ab94fa0ce2bf9f54c88277abd4465..8c0f5bfbc20943fa2165b104c8d410a7da96ce7c 100644 (file)
@@ -91,3 +91,5 @@ ring-buffer-fix-race-while-reader-and-writer-are-on-the-same-page.patch
 mm-swap-fix-swap_info_struct-race-between-swapoff-and-get_swap_pages.patch
 drm-bridge-lt9611-fix-pll-being-unable-to-lock.patch
 mm-take-a-page-reference-when-removing-device-exclusive-entries.patch
+kbuild-fix-single-directory-build.patch
+ocfs2-fix-freeing-uninitialized-resource-on-ocfs2_dlm_shutdown.patch