Skip to content

Commit e7d24c0

Browse files
ardbiesheuvelkees
authored andcommitted
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>
1 parent 39cd87c commit e7d24c0

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
@@ -467,6 +467,8 @@ static bool stackleak_gate(void)
467467
return false;
468468
if (STRING_EQUAL(section, ".entry.text"))
469469
return false;
470+
if (STRING_EQUAL(section, ".head.text"))
471+
return false;
470472
}
471473

472474
return track_frame_size >= 0;

0 commit comments

Comments
 (0)