gcc-plugins/stackleak: Avoid .head.text section
PATCH 1/1 gcc-plugins/stackleak: Avoid .head.text section
From: Ard Biesheuvel <[email protected]>
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 <[email protected]>
Signed-off-by Ard Biesheuvel <[email protected]>
--- scripts/gcc-plugins/stackleak_plugin.c | 2 ++ 1 file changed, 2 insertions(+)
scripts/gcc-plugins/stackleak_plugin.c +2 -0
@@ -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 ;
Signature · 1 line
2.44.0.396.g6e790dbe36-goog
Kees Cook
AppliedQuoted 6 lines · Ard Biesheuvel
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.
Applied to for-next/hardening, thanks!
[1/1] gcc-plugins/stackleak: Avoid .head.text section
https://git.kernel.org/kees/c/4ac9a796ada0
Take care,
Signature · 1 line
Kees Cook