Skip to content

Commit ae97800

Browse files
committed
gcc-plugins/stackleak: Ignore .noinstr.text and .entry.text
The .noinstr.text section functions may not have "current()" sanely available. Similarly true for .entry.text, though such a check is currently redundant. Add a check for both. In an x86_64 defconfig build, the following functions no longer receive stackleak instrumentation: __do_fast_syscall_32() do_int80_syscall_32() do_machine_check() do_syscall_64() exc_general_protection() fixup_bad_iret() Suggested-by: Peter Zijlstra <peterz@infradead.org> Cc: Alexander Popov <alex.popov@linux.com> Signed-off-by: Kees Cook <keescook@chromium.org>
1 parent 27e9faf commit ae97800

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

scripts/gcc-plugins/stackleak_plugin.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,10 @@ static bool stackleak_gate(void)
463463
return false;
464464
if (STRING_EQUAL(section, ".meminit.text"))
465465
return false;
466+
if (STRING_EQUAL(section, ".noinstr.text"))
467+
return false;
468+
if (STRING_EQUAL(section, ".entry.text"))
469+
return false;
466470
}
467471

468472
return track_frame_size >= 0;

0 commit comments

Comments
 (0)