Skip to content

Commit

Permalink
gcc-plugins/stackleak: Ignore .noinstr.text and .entry.text
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kees committed Feb 6, 2022
1 parent 27e9faf commit ae97800
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/gcc-plugins/stackleak_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ static bool stackleak_gate(void)
return false;
if (STRING_EQUAL(section, ".meminit.text"))
return false;
if (STRING_EQUAL(section, ".noinstr.text"))
return false;
if (STRING_EQUAL(section, ".entry.text"))
return false;
}

return track_frame_size >= 0;
Expand Down

0 comments on commit ae97800

Please sign in to comment.