summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2024-03-28 07:42:57 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-13 13:01:47 +0200
commit5d17986cbfd51d6f5ff16d8c832795d11ef6b8f4 (patch)
tree57a30350116de2d34f0e77fc0239293337618375
parent7e0bd07ce9655656ad0c55f5dfff563eecffa82f (diff)
downloadlinux-stable-5d17986cbfd51d6f5ff16d8c832795d11ef6b8f4.tar.gz
linux-stable-5d17986cbfd51d6f5ff16d8c832795d11ef6b8f4.tar.bz2
linux-stable-5d17986cbfd51d6f5ff16d8c832795d11ef6b8f4.zip
gcc-plugins/stackleak: Avoid .head.text section
commit e7d24c0aa8e678f41457d1304e2091cac6fd1a2e upstream. The .head.text section carries the startup code that runs with the MMU off or with a translation of memory that deviates from the ordinary one. So avoid instrumentation with the stackleak plugin, which already avoids .init.text and .noinstr.text entirely. Fixes: 48204aba801f1b51 ("x86/sme: Move early SME kernel encryption handling into .head.text") Reported-by: kernel test robot <oliver.sang@intel.com> Closes: https://lore.kernel.org/oe-lkp/202403221630.2692c998-oliver.sang@intel.com Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20240328064256.2358634-2-ardb+git@google.com Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--scripts/gcc-plugins/stackleak_plugin.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/gcc-plugins/stackleak_plugin.c b/scripts/gcc-plugins/stackleak_plugin.c
index 42f0252ee2a4..e5c63f806ef2 100644
--- a/scripts/gcc-plugins/stackleak_plugin.c
+++ b/scripts/gcc-plugins/stackleak_plugin.c
@@ -467,6 +467,8 @@ static bool stackleak_gate(void)
return false;
if (STRING_EQUAL(section, ".entry.text"))
return false;
+ if (STRING_EQUAL(section, ".head.text"))
+ return false;
}
return track_frame_size >= 0;