Skip to content

Commit c2fc69a

Browse files
committed
gcc-plugins/stackleak: Avoid .head.text section
JIRA: https://issues.redhat.com/browse/RHEL-39439 commit e7d24c0 Author: Ard Biesheuvel <ardb@kernel.org> Date: Thu Mar 28 07:42:57 2024 +0100 gcc-plugins/stackleak: Avoid .head.text section 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: 48204ab ("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: Bandan Das <bsd@redhat.com>
1 parent e08c690 commit c2fc69a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/gcc-plugins/stackleak_plugin.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ static bool stackleak_gate(void)
446446
return false;
447447
if (!strncmp(TREE_STRING_POINTER(section), ".meminit.text", 13))
448448
return false;
449+
if (STRING_EQUAL(section, ".head.text"))
450+
return false;
449451
}
450452

451453
return track_frame_size >= 0;

0 commit comments

Comments
 (0)