]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Dec 2023 14:37:31 +0000 (15:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Dec 2023 14:37:31 +0000 (15:37 +0100)
added patches:
gcc-plugins-randstruct-update-code-comment-in-relayout_struct.patch

queue-6.6/gcc-plugins-randstruct-update-code-comment-in-relayout_struct.patch [new file with mode: 0644]
queue-6.6/series

diff --git a/queue-6.6/gcc-plugins-randstruct-update-code-comment-in-relayout_struct.patch b/queue-6.6/gcc-plugins-randstruct-update-code-comment-in-relayout_struct.patch
new file mode 100644 (file)
index 0000000..b22d53f
--- /dev/null
@@ -0,0 +1,35 @@
+From d71f22365a9caca82d424f3a33445de46567e198 Mon Sep 17 00:00:00 2001
+From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
+Date: Sat, 25 Nov 2023 15:49:12 -0600
+Subject: gcc-plugins: randstruct: Update code comment in relayout_struct()
+
+From: Gustavo A. R. Silva <gustavoars@kernel.org>
+
+commit d71f22365a9caca82d424f3a33445de46567e198 upstream.
+
+Update code comment to clarify that the only element whose layout is
+not randomized is a proper C99 flexible-array member. This update is
+complementary to commit 1ee60356c2dc ("gcc-plugins: randstruct: Only
+warn about true flexible arrays")
+
+Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org>
+Link: https://lore.kernel.org/r/ZWJr2MWDjXLHE8ap@work
+Fixes: 1ee60356c2dc ("gcc-plugins: randstruct: Only warn about true flexible arrays")
+Signed-off-by: Kees Cook <keescook@chromium.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ scripts/gcc-plugins/randomize_layout_plugin.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/scripts/gcc-plugins/randomize_layout_plugin.c
++++ b/scripts/gcc-plugins/randomize_layout_plugin.c
+@@ -339,8 +339,7 @@ static int relayout_struct(tree type)
+       /*
+        * enforce that we don't randomize the layout of the last
+-       * element of a struct if it's a 0 or 1-length array
+-       * or a proper flexible array
++       * element of a struct if it's a proper flexible array
+        */
+       if (is_flexible_array(newtree[num_fields - 1])) {
+               has_flexarray = true;
index c9e4a33a7a75ccc40699a0aa05d8058f5ce2ce09..7b2c923bd2c7ba692d43b52a525a8c5c091cbe00 100644 (file)
@@ -237,3 +237,4 @@ mips-loongson64-handle-more-memory-types-passed-from-firmware.patch
 mips-loongson64-enable-dma-noncoherent-support.patch
 netfilter-nft_set_pipapo-skip-inactive-elements-during-set-walk.patch
 asoc-qcom-sc8280xp-limit-speaker-digital-volumes.patch
+gcc-plugins-randstruct-update-code-comment-in-relayout_struct.patch