]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Nov 2022 17:22:43 +0000 (18:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Nov 2022 17:22:43 +0000 (18:22 +0100)
added patches:
once-fix-section-mismatch-on-clang-builds.patch

queue-5.4/once-fix-section-mismatch-on-clang-builds.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/once-fix-section-mismatch-on-clang-builds.patch b/queue-5.4/once-fix-section-mismatch-on-clang-builds.patch
new file mode 100644 (file)
index 0000000..0eb8154
--- /dev/null
@@ -0,0 +1,48 @@
+From 76d0ecd42da6e2cc54980363ba790591c277f71c Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Tue, 1 Nov 2022 18:12:39 +0100
+Subject: once: fix section mismatch on clang builds
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+On older kernels (5.4 and older), building the kernel with clang can
+cause the section name to end up with "" in them, which can cause lots
+of runtime issues as that is not normally a valid portion of the string.
+
+This was fixed up in newer kernels with commit 33def8498fdd ("treewide:
+Convert macro and uses of __section(foo) to __section("foo")") but
+that's too heavy-handed for older kernels.
+
+So for now, fix up the problem that commit 62c07983bef9 ("once: add
+DO_ONCE_SLOW() for sleepable contexts") caused by being backported by
+removing the "" characters from the section definition.
+
+Reported-by: Oleksandr Tymoshenko <ovt@google.com>
+Reported-by: Yongqin Liu <yongqin.liu@linaro.org>
+Tested-by: Yongqin Liu <yongqin.liu@linaro.org>
+Cc: Naresh Kamboju <naresh.kamboju@linaro.org>
+Link: https://lore.kernel.org/r/20221029011211.4049810-1-ovt@google.com
+Link: https://lore.kernel.org/r/CAMSo37XApZ_F5nSQYWFsSqKdMv_gBpfdKG3KN1TDB+QNXqSh0A@mail.gmail.com
+Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
+Cc: Eric Dumazet <edumazet@google.com>
+Cc: Willy Tarreau <w@1wt.eu>
+Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
+Cc: David S. Miller <davem@davemloft.net>
+Cc: Sasha Levin <sashal@kernel.org>
+Cc: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/once.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/include/linux/once.h
++++ b/include/linux/once.h
+@@ -64,7 +64,7 @@ void __do_once_slow_done(bool *done, str
+ #define DO_ONCE_SLOW(func, ...)                                                    \
+       ({                                                                   \
+               bool ___ret = false;                                         \
+-              static bool __section(".data.once") ___done = false;         \
++              static bool __section(.data.once) ___done = false;           \
+               static DEFINE_STATIC_KEY_TRUE(___once_key);                  \
+               if (static_branch_unlikely(&___once_key)) {                  \
+                       ___ret = __do_once_slow_start(&___done);             \
index 27eb28bad3303790c77539d2ab29bf35cbbd8910..cd25bad1e61412de12d1bbe238af6436dbe4a972 100644 (file)
@@ -61,3 +61,4 @@ nh-fix-scope-used-to-find-saddr-when-adding-non-gw-n.patch
 net-mlx5e-do-not-increment-esn-when-updating-ipsec-e.patch
 net-mlx5-fix-possible-use-after-free-in-async-comman.patch
 net-enetc-survive-memory-pressure-without-crashing.patch
+once-fix-section-mismatch-on-clang-builds.patch