From: Greg Kroah-Hartman Date: Mon, 11 Dec 2023 14:37:31 +0000 (+0100) Subject: 6.6-stable patches X-Git-Tag: v4.14.333~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4271a4d9f72ad79e6ff070af4812ad780d9e792e;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: gcc-plugins-randstruct-update-code-comment-in-relayout_struct.patch --- 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 index 00000000000..b22d53f69a1 --- /dev/null +++ b/queue-6.6/gcc-plugins-randstruct-update-code-comment-in-relayout_struct.patch @@ -0,0 +1,35 @@ +From d71f22365a9caca82d424f3a33445de46567e198 Mon Sep 17 00:00:00 2001 +From: "Gustavo A. R. Silva" +Date: Sat, 25 Nov 2023 15:49:12 -0600 +Subject: gcc-plugins: randstruct: Update code comment in relayout_struct() + +From: Gustavo A. R. Silva + +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" +Link: https://lore.kernel.org/r/ZWJr2MWDjXLHE8ap@work +Fixes: 1ee60356c2dc ("gcc-plugins: randstruct: Only warn about true flexible arrays") +Signed-off-by: Kees Cook +Signed-off-by: Greg Kroah-Hartman +--- + 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; diff --git a/queue-6.6/series b/queue-6.6/series index c9e4a33a7a7..7b2c923bd2c 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -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