]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Dec 2024 09:48:14 +0000 (10:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Dec 2024 09:48:14 +0000 (10:48 +0100)
added patches:
lib-stackinit-hide-never-taken-branch-from-compiler.patch
ocfs2-update-seq_file-index-in-ocfs2_dlm_seq_next.patch

queue-6.1/lib-stackinit-hide-never-taken-branch-from-compiler.patch [new file with mode: 0644]
queue-6.1/ocfs2-update-seq_file-index-in-ocfs2_dlm_seq_next.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/lib-stackinit-hide-never-taken-branch-from-compiler.patch b/queue-6.1/lib-stackinit-hide-never-taken-branch-from-compiler.patch
new file mode 100644 (file)
index 0000000..fb17dc7
--- /dev/null
@@ -0,0 +1,40 @@
+From 5c3793604f91123bf49bc792ce697a0bef4c173c Mon Sep 17 00:00:00 2001
+From: Kees Cook <kees@kernel.org>
+Date: Sun, 17 Nov 2024 03:38:13 -0800
+Subject: lib: stackinit: hide never-taken branch from compiler
+
+From: Kees Cook <kees@kernel.org>
+
+commit 5c3793604f91123bf49bc792ce697a0bef4c173c upstream.
+
+The never-taken branch leads to an invalid bounds condition, which is by
+design. To avoid the unwanted warning from the compiler, hide the
+variable from the optimizer.
+
+../lib/stackinit_kunit.c: In function 'do_nothing_u16_zero':
+../lib/stackinit_kunit.c:51:49: error: array subscript 1 is outside array bounds of 'u16[0]' {aka 'short unsigned int[]'} [-Werror=array-bounds=]
+   51 | #define DO_NOTHING_RETURN_SCALAR(ptr)           *(ptr)
+      |                                                 ^~~~~~
+../lib/stackinit_kunit.c:219:24: note: in expansion of macro 'DO_NOTHING_RETURN_SCALAR'
+  219 |                 return DO_NOTHING_RETURN_ ## which(ptr + 1);    \
+      |                        ^~~~~~~~~~~~~~~~~~
+
+Link: https://lkml.kernel.org/r/20241117113813.work.735-kees@kernel.org
+Signed-off-by: Kees Cook <kees@kernel.org>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ lib/stackinit_kunit.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/lib/stackinit_kunit.c
++++ b/lib/stackinit_kunit.c
+@@ -199,6 +199,7 @@ static noinline void test_ ## name (stru
+ static noinline DO_NOTHING_TYPE_ ## which(var_type)           \
+ do_nothing_ ## name(var_type *ptr)                            \
+ {                                                             \
++      OPTIMIZER_HIDE_VAR(ptr);                                \
+       /* Will always be true, but compiler doesn't know. */   \
+       if ((unsigned long)ptr > 0x2)                           \
+               return DO_NOTHING_RETURN_ ## which(ptr);        \
diff --git a/queue-6.1/ocfs2-update-seq_file-index-in-ocfs2_dlm_seq_next.patch b/queue-6.1/ocfs2-update-seq_file-index-in-ocfs2_dlm_seq_next.patch
new file mode 100644 (file)
index 0000000..184b577
--- /dev/null
@@ -0,0 +1,43 @@
+From 914eec5e980171bc128e7e24f7a22aa1d803570e Mon Sep 17 00:00:00 2001
+From: Wengang Wang <wen.gang.wang@oracle.com>
+Date: Tue, 19 Nov 2024 09:45:00 -0800
+Subject: ocfs2: update seq_file index in ocfs2_dlm_seq_next
+
+From: Wengang Wang <wen.gang.wang@oracle.com>
+
+commit 914eec5e980171bc128e7e24f7a22aa1d803570e upstream.
+
+The following INFO level message was seen:
+
+seq_file: buggy .next function ocfs2_dlm_seq_next [ocfs2] did not
+update position index
+
+Fix:
+Update *pos (so m->index) to make seq_read_iter happy though the index its
+self makes no sense to ocfs2_dlm_seq_next.
+
+Link: https://lkml.kernel.org/r/20241119174500.9198-1-wen.gang.wang@oracle.com
+Signed-off-by: Wengang Wang <wen.gang.wang@oracle.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: 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 |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/fs/ocfs2/dlmglue.c
++++ b/fs/ocfs2/dlmglue.c
+@@ -3108,6 +3108,7 @@ static void *ocfs2_dlm_seq_next(struct s
+       struct ocfs2_lock_res *iter = v;
+       struct ocfs2_lock_res *dummy = &priv->p_iter_res;
++      (*pos)++;
+       spin_lock(&ocfs2_dlm_tracking_lock);
+       iter = ocfs2_dlm_next_res(iter, priv);
+       list_del_init(&dummy->l_debug_list);
index 12a08c0ae8d99e2285c805d4f91445e3c7c7a74b..a8a2092e2eea6c3783e3fbd833277632a02185f9 100644 (file)
@@ -650,3 +650,5 @@ xsk-fix-oob-map-writes-when-deleting-elements.patch
 regmap-detach-regmap-from-dev-on-regmap_exit.patch
 mmc-sdhci-pci-add-dmi-quirk-for-missing-cd-gpio-on-vexia-edu-atla-10-tablet.patch
 mmc-core-further-prevent-card-detect-during-shutdown.patch
+ocfs2-update-seq_file-index-in-ocfs2_dlm_seq_next.patch
+lib-stackinit-hide-never-taken-branch-from-compiler.patch