Skip to content

Commit 469f002

Browse files
ramosian-gliderIngo Molnar
authored andcommitted
x86, kasan, ftrace: Put APIC interrupt handlers into .irqentry.text
Dmitry Vyukov has reported unexpected KASAN stackdepot growth: google/kernel-sanitizers#36 ... which is caused by the APIC handlers not being present in .irqentry.text: When building with CONFIG_FUNCTION_GRAPH_TRACER=y or CONFIG_KASAN=y, put the APIC interrupt handlers into the .irqentry.text section. This is needed because both KASAN and function graph tracer use __irqentry_text_start and __irqentry_text_end to determine whether a function is an IRQ entry point. Reported-by: Dmitry Vyukov <[email protected]> Signed-off-by: Alexander Potapenko <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] [ Minor edits. ] Signed-off-by: Ingo Molnar <[email protected]>
1 parent a0cba21 commit 469f002

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

arch/x86/entry/entry_64.S

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,9 +601,20 @@ apicinterrupt3 \num trace(\sym) smp_trace(\sym)
601601
.endm
602602
#endif
603603

604+
/* Make sure APIC interrupt handlers end up in the irqentry section: */
605+
#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
606+
# define PUSH_SECTION_IRQENTRY .pushsection .irqentry.text, "ax"
607+
# define POP_SECTION_IRQENTRY .popsection
608+
#else
609+
# define PUSH_SECTION_IRQENTRY
610+
# define POP_SECTION_IRQENTRY
611+
#endif
612+
604613
.macro apicinterrupt num sym do_sym
614+
PUSH_SECTION_IRQENTRY
605615
apicinterrupt3 \num \sym \do_sym
606616
trace_apicinterrupt \num \sym
617+
POP_SECTION_IRQENTRY
607618
.endm
608619

609620
#ifdef CONFIG_SMP

0 commit comments

Comments
 (0)