kernel: bump 6.6 to 6.6.26
[openwrt/staging/stintel.git] / target / linux / generic / pending-6.6 / 981-gcc-plugins-stackleak-Avoid-.head.txt.section.patch
1 From e7d24c0aa8e678f41457d1304e2091cac6fd1a2e Mon Sep 17 00:00:00 2001
2 From: Ard Biesheuvel <ardb@kernel.org>
3 Date: Thu, 28 Mar 2024 07:42:57 +0100
4 Subject: gcc-plugins/stackleak: Avoid .head.text section
5
6 The .head.text section carries the startup code that runs with the MMU
7 off or with a translation of memory that deviates from the ordinary one.
8 So avoid instrumentation with the stackleak plugin, which already avoids
9 .init.text and .noinstr.text entirely.
10
11 Fixes: 48204aba801f1b51 ("x86/sme: Move early SME kernel encryption handling into .head.text")
12 Reported-by: kernel test robot <oliver.sang@intel.com>
13 Closes: https://lore.kernel.org/oe-lkp/202403221630.2692c998-oliver.sang@intel.com
14 Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
15 Link: https://lore.kernel.org/r/20240328064256.2358634-2-ardb+git@google.com
16 Signed-off-by: Kees Cook <keescook@chromium.org>
17 ---
18 scripts/gcc-plugins/stackleak_plugin.c | 2 ++
19 1 file changed, 2 insertions(+)
20
21 --- a/scripts/gcc-plugins/stackleak_plugin.c
22 +++ b/scripts/gcc-plugins/stackleak_plugin.c
23 @@ -467,6 +467,8 @@ static bool stackleak_gate(void)
24 return false;
25 if (STRING_EQUAL(section, ".entry.text"))
26 return false;
27 + if (STRING_EQUAL(section, ".head.text"))
28 + return false;
29 }
30
31 return track_frame_size >= 0;