Skip to content

Commit a850958

Browse files
keesIngo Molnar
authored andcommitted
x86/asm: Avoid generating unused kprobe sections
When !CONFIG_KPROBES, do not generate kprobe sections. This makes sure there are no unexpected sections encountered by the linker scripts. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20200821194310.3089815-23-keescook@chromium.org
1 parent 7e8c4ed commit a850958

File tree

1 file changed

+5
-1
lines changed
  • arch/x86/include/asm

1 file changed

+5
-1
lines changed

arch/x86/include/asm/asm.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,15 @@
138138
# define _ASM_EXTABLE_FAULT(from, to) \
139139
_ASM_EXTABLE_HANDLE(from, to, ex_handler_fault)
140140

141-
# define _ASM_NOKPROBE(entry) \
141+
# ifdef CONFIG_KPROBES
142+
# define _ASM_NOKPROBE(entry) \
142143
.pushsection "_kprobe_blacklist","aw" ; \
143144
_ASM_ALIGN ; \
144145
_ASM_PTR (entry); \
145146
.popsection
147+
# else
148+
# define _ASM_NOKPROBE(entry)
149+
# endif
146150

147151
#else /* ! __ASSEMBLY__ */
148152
# define _EXPAND_EXTABLE_HANDLE(x) #x

0 commit comments

Comments
 (0)