Now that stack validation is an optional feature of objtool, add CONFIG_OBJTOOL and replace most usages of CONFIG_STACK_VALIDATION with it. CONFIG_STACK_VALIDATION can now be considered to be frame-pointer specific. CONFIG_UNWINDER_ORC is already inherently valid for live patching, so no need to "validate" it.
Unified · Split
| @@ -1302,7 +1302,7 @@ install: sub_make_done := · 1301 unmodified lines | ||
| 1302 | 1302 | # --------------------------------------------------------------------------- |
| 1303 | 1303 | # Tools |
| 1304 | 1304 | |
| 1305 | −ifdef CONFIG_STACK_VALIDATION | |
| 1305 | +ifdef CONFIG_OBJTOOL | |
| 1306 | 1306 | prepare: tools/objtool |
| 1307 | 1307 | endif |
| 1308 | 1308 | |
| @@ -1028,11 +1028,14 @@ config ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT · 1027 unmodified lines | ||
| 1028 | 1028 | depends on MMU |
| 1029 | 1029 | select ARCH_HAS_ELF_RANDOMIZE |
| 1030 | 1030 | |
| 1031 | +config HAVE_OBJTOOL | |
| 1032 | + bool | |
| 1033 | + | |
| 1031 | 1034 | config HAVE_STACK_VALIDATION |
| 1032 | 1035 | bool |
| 1033 | 1036 | help |
| 1034 | − Architecture supports the 'objtool check' host tool command, which | |
| 1035 | − performs compile-time stack metadata validation. | |
| 1037 | + Architecture supports objtool compile-time frame pointer rule | |
| 1038 | + validation. | |
| 1036 | 1039 | |
| 1037 | 1040 | config HAVE_RELIABLE_STACKTRACE |
| 1038 | 1041 | bool |
| @@ -1302,6 +1305,7 @@ config HAVE_STATIC_CALL · 263 unmodified lines | ||
| 1302 | 1305 | config HAVE_STATIC_CALL_INLINE |
| 1303 | 1306 | bool |
| 1304 | 1307 | depends on HAVE_STATIC_CALL |
| 1308 | + select OBJTOOL | |
| 1305 | 1309 | |
| 1306 | 1310 | config HAVE_PREEMPT_DYNAMIC |
| 1307 | 1311 | bool |
| @@ -188,7 +188,7 @@ config X86 · 187 unmodified lines | ||
| 188 | 188 | select HAVE_CONTEXT_TRACKING if X86_64 |
| 189 | 189 | select HAVE_CONTEXT_TRACKING_OFFSTACK if HAVE_CONTEXT_TRACKING |
| 190 | 190 | select HAVE_C_RECORDMCOUNT |
| 191 | − select HAVE_OBJTOOL_MCOUNT if STACK_VALIDATION | |
| 191 | + select HAVE_OBJTOOL_MCOUNT if HAVE_OBJTOOL | |
| 192 | 192 | select HAVE_BUILDTIME_MCOUNT_SORT |
| 193 | 193 | select HAVE_DEBUG_KMEMLEAK |
| 194 | 194 | select HAVE_DMA_CONTIGUOUS |
| @@ -231,6 +231,7 @@ config X86 · 36 unmodified lines | ||
| 231 | 231 | select HAVE_MOVE_PMD |
| 232 | 232 | select HAVE_MOVE_PUD |
| 233 | 233 | select HAVE_NMI |
| 234 | + select HAVE_OBJTOOL if X86_64 | |
| 234 | 235 | select HAVE_OPTPROBES |
| 235 | 236 | select HAVE_PCSPKR_PLATFORM |
| 236 | 237 | select HAVE_PERF_EVENTS |
| @@ -239,17 +240,17 @@ config X86 · 2 unmodified lines | ||
| 239 | 240 | select HAVE_PCI |
| 240 | 241 | select HAVE_PERF_REGS |
| 241 | 242 | select HAVE_PERF_USER_STACK_DUMP |
| 242 | − select MMU_GATHER_RCU_TABLE_FREE if PARAVIRT | |
| 243 | + select MMU_GATHER_RCU_TABLE_FREE if PARAVIRT | |
| 243 | 244 | select HAVE_POSIX_CPU_TIMERS_TASK_WORK |
| 244 | 245 | select HAVE_REGS_AND_STACK_ACCESS_API |
| 245 | − select HAVE_RELIABLE_STACKTRACE if X86_64 && (UNWINDER_FRAME_POINTER || UNWINDER_ORC) && STACK_VALIDATION | |
| 246 | + select HAVE_RELIABLE_STACKTRACE if UNWINDER_ORC || STACK_VALIDATION | |
| 246 | 247 | select HAVE_FUNCTION_ARG_ACCESS_API |
| 247 | 248 | select HAVE_SETUP_PER_CPU_AREA |
| 248 | 249 | select HAVE_SOFTIRQ_ON_OWN_STACK |
| 249 | 250 | select HAVE_STACKPROTECTOR if CC_HAS_SANE_STACKPROTECTOR |
| 250 | − select HAVE_STACK_VALIDATION if X86_64 | |
| 251 | + select HAVE_STACK_VALIDATION if HAVE_OBJTOOL | |
| 251 | 252 | select HAVE_STATIC_CALL |
| 252 | − select HAVE_STATIC_CALL_INLINE if HAVE_STACK_VALIDATION | |
| 253 | + select HAVE_STATIC_CALL_INLINE if HAVE_OBJTOOL | |
| 253 | 254 | select HAVE_PREEMPT_DYNAMIC_CALL |
| 254 | 255 | select HAVE_RSEQ |
| 255 | 256 | select HAVE_SYSCALL_TRACEPOINTS |
| @@ -268,7 +269,6 @@ config X86 · 12 unmodified lines | ||
| 268 | 269 | select RTC_MC146818_LIB |
| 269 | 270 | select SPARSE_IRQ |
| 270 | 271 | select SRCU |
| 271 | − select STACK_VALIDATION if HAVE_STACK_VALIDATION && (HAVE_STATIC_CALL_INLINE || RETPOLINE) | |
| 272 | 272 | select SYSCTL_EXCEPTION_TRACE |
| 273 | 273 | select THREAD_INFO_IN_TASK |
| 274 | 274 | select TRACE_IRQFLAGS_SUPPORT |
| @@ -459,6 +459,7 @@ config GOLDFISH · 184 unmodified lines | ||
| 459 | 459 | |
| 460 | 460 | config RETPOLINE |
| 461 | 461 | bool "Avoid speculative indirect branches in kernel" |
| 462 | + select OBJTOOL if HAVE_OBJTOOL | |
| 462 | 463 | default y |
| 463 | 464 | help |
| 464 | 465 | Compile kernel with the retpoline compiler options to guard against |
| @@ -472,6 +473,7 @@ config CC_HAS_SLS · 7 unmodified lines | ||
| 472 | 473 | config SLS |
| 473 | 474 | bool "Mitigate Straight-Line-Speculation" |
| 474 | 475 | depends on CC_HAS_SLS && X86_64 |
| 476 | + select OBJTOOL if HAVE_OBJTOOL | |
| 475 | 477 | default n |
| 476 | 478 | help |
| 477 | 479 | Compile the kernel with straight-line-speculation options to guard |
| @@ -1819,6 +1821,7 @@ config ARCH_RANDOM · 1341 unmodified lines | ||
| 1819 | 1821 | config X86_SMAP |
| 1820 | 1822 | def_bool y |
| 1821 | 1823 | prompt "Supervisor Mode Access Prevention" if EXPERT |
| 1824 | + select OBJTOOL if HAVE_OBJTOOL | |
| 1822 | 1825 | help |
| 1823 | 1826 | Supervisor Mode Access Prevention (SMAP) is a security |
| 1824 | 1827 | feature in newer Intel processors. There is a small |
| @@ -1855,9 +1858,10 @@ config CC_HAS_IBT · 30 unmodified lines | ||
| 1855 | 1858 | config X86_KERNEL_IBT |
| 1856 | 1859 | prompt "Indirect Branch Tracking" |
| 1857 | 1860 | bool |
| 1858 | − depends on X86_64 && CC_HAS_IBT && STACK_VALIDATION | |
| 1861 | + depends on X86_64 && CC_HAS_IBT && HAVE_OBJTOOL | |
| 1859 | 1862 | # https://github.com/llvm/llvm-project/commit/9d7001eba9c4cb311e03cd8cdc231f9e579f2d0f |
| 1860 | 1863 | depends on !LD_IS_LLD || LLD_VERSION >= 140000 |
| 1864 | + select OBJTOOL | |
| 1861 | 1865 | help |
| 1862 | 1866 | Build the kernel with support for Indirect Branch Tracking, a |
| 1863 | 1867 | hardware support course-grain forward-edge Control Flow Integrity |
| @@ -237,7 +237,7 @@ choice · 236 unmodified lines | ||
| 237 | 237 | config UNWINDER_ORC |
| 238 | 238 | bool "ORC unwinder" |
| 239 | 239 | depends on X86_64 |
| 240 | − select STACK_VALIDATION | |
| 240 | + select OBJTOOL | |
| 241 | 241 | help |
| 242 | 242 | This option enables the ORC (Oops Rewind Capability) unwinder for |
| 243 | 243 | unwinding kernel stack traces. It uses a custom data format which is |
| @@ -20,7 +20,7 @@ · 19 unmodified lines | ||
| 20 | 20 | _ASM_PTR "%c0 + %c1 - .\n\t" \ |
| 21 | 21 | ".popsection \n\t" |
| 22 | 22 | |
| 23 | −#ifdef CONFIG_STACK_VALIDATION | |
| 23 | +#ifdef CONFIG_OBJTOOL | |
| 24 | 24 | |
| 25 | 25 | static __always_inline bool arch_static_branch(struct static_key *key, bool branch) |
| 26 | 26 | { |
| @@ -34,7 +34,7 @@ l_yes: · 7 unmodified lines | ||
| 34 | 34 | return true; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | −#else | |
| 37 | +#else /* !CONFIG_OBJTOOL */ | |
| 38 | 38 | |
| 39 | 39 | static __always_inline bool arch_static_branch(struct static_key * const key, const bool branch) |
| 40 | 40 | { |
| @@ -48,7 +48,7 @@ l_yes: · 7 unmodified lines | ||
| 48 | 48 | return true; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | −#endif /* STACK_VALIDATION */ | |
| 51 | +#endif /* CONFIG_OBJTOOL */ | |
| 52 | 52 | |
| 53 | 53 | static __always_inline bool arch_static_branch_jump(struct static_key * const key, const bool branch) |
| 54 | 54 | { |
| @@ -338,7 +338,7 @@ next: · 337 unmodified lines | ||
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | −#if defined(CONFIG_RETPOLINE) && defined(CONFIG_STACK_VALIDATION) | |
| 341 | +#if defined(CONFIG_RETPOLINE) && defined(CONFIG_OBJTOOL) | |
| 342 | 342 | |
| 343 | 343 | /* |
| 344 | 344 | * CALL/JMP *%\reg |
| @@ -507,11 +507,11 @@ void __init_or_module noinline apply_retpolines(s32 *start, s32 *end) · 162 unmodified lines | ||
| 507 | 507 | } |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | −#else /* !RETPOLINES || !CONFIG_STACK_VALIDATION */ | |
| 510 | +#else /* !CONFIG_RETPOLINE || !CONFIG_OBJTOOL */ | |
| 511 | 511 | |
| 512 | 512 | void __init_or_module noinline apply_retpolines(s32 *start, s32 *end) { } |
| 513 | 513 | |
| 514 | −#endif /* CONFIG_RETPOLINE && CONFIG_STACK_VALIDATION */ | |
| 514 | +#endif /* CONFIG_RETPOLINE && CONFIG_OBJTOOL */ | |
| 515 | 515 | |
| 516 | 516 | #ifdef CONFIG_X86_KERNEL_IBT |
| 517 | 517 | |
| @@ -109,7 +109,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 108 unmodified lines | ||
| 109 | 109 | #endif |
| 110 | 110 | |
| 111 | 111 | /* Unreachable code */ |
| 112 | −#ifdef CONFIG_STACK_VALIDATION | |
| 112 | +#ifdef CONFIG_OBJTOOL | |
| 113 | 113 | /* |
| 114 | 114 | * These macros help objtool understand GCC code flow for unreachable code. |
| 115 | 115 | * The __COUNTER__ based labels are a hack to make each instance of the macros |
| @@ -128,10 +128,10 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 12 unmodified lines | ||
| 128 | 128 | /* Annotate a C jump table to allow objtool to follow the code flow */ |
| 129 | 129 | #define __annotate_jump_table __section(".rodata..c_jump_table") |
| 130 | 130 | |
| 131 | −#else | |
| 131 | +#else /* !CONFIG_OBJTOOL */ | |
| 132 | 132 | #define annotate_unreachable() |
| 133 | 133 | #define __annotate_jump_table |
| 134 | −#endif | |
| 134 | +#endif /* CONFIG_OBJTOOL */ | |
| 135 | 135 | |
| 136 | 136 | #ifndef unreachable |
| 137 | 137 | # define unreachable() do { \ |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | #ifndef __LINUX_INSTRUMENTATION_H |
| 3 | 3 | #define __LINUX_INSTRUMENTATION_H |
| 4 | 4 | |
| 5 | −#if defined(CONFIG_DEBUG_ENTRY) && defined(CONFIG_STACK_VALIDATION) | |
| 5 | +#ifdef CONFIG_VMLINUX_VALIDATION | |
| 6 | 6 | |
| 7 | 7 | #include <linux/stringify.h> |
| 8 | 8 | |
| @@ -53,9 +53,9 @@ · 44 unmodified lines | ||
| 53 | 53 | ".popsection\n\t" : : "i" (c)); \ |
| 54 | 54 | }) |
| 55 | 55 | #define instrumentation_end() __instrumentation_end(__COUNTER__) |
| 56 | −#else | |
| 56 | +#else /* !CONFIG_VMLINUX_VALIDATION */ | |
| 57 | 57 | # define instrumentation_begin() do { } while(0) |
| 58 | 58 | # define instrumentation_end() do { } while(0) |
| 59 | −#endif | |
| 59 | +#endif /* CONFIG_VMLINUX_VALIDATION */ | |
| 60 | 60 | |
| 61 | 61 | #endif /* __LINUX_INSTRUMENTATION_H */ |
| @@ -38,7 +38,7 @@ struct unwind_hint { · 37 unmodified lines | ||
| 38 | 38 | #define UNWIND_HINT_TYPE_REGS_PARTIAL 2 |
| 39 | 39 | #define UNWIND_HINT_TYPE_FUNC 3 |
| 40 | 40 | |
| 41 | −#ifdef CONFIG_STACK_VALIDATION | |
| 41 | +#ifdef CONFIG_OBJTOOL | |
| 42 | 42 | |
| 43 | 43 | #ifndef __ASSEMBLY__ |
| 44 | 44 | |
| @@ -157,7 +157,7 @@ struct unwind_hint { · 112 unmodified lines | ||
| 157 | 157 | |
| 158 | 158 | #endif /* __ASSEMBLY__ */ |
| 159 | 159 | |
| 160 | −#else /* !CONFIG_STACK_VALIDATION */ | |
| 160 | +#else /* !CONFIG_OBJTOOL */ | |
| 161 | 161 | |
| 162 | 162 | #ifndef __ASSEMBLY__ |
| 163 | 163 | |
| @@ -179,6 +179,6 @@ struct unwind_hint { · 15 unmodified lines | ||
| 179 | 179 | .endm |
| 180 | 180 | #endif |
| 181 | 181 | |
| 182 | −#endif /* CONFIG_STACK_VALIDATION */ | |
| 182 | +#endif /* CONFIG_OBJTOOL */ | |
| 183 | 183 | |
| 184 | 184 | #endif /* _LINUX_OBJTOOL_H */ |
| @@ -728,6 +728,7 @@ config FTRACE_MCOUNT_USE_OBJTOOL · 727 unmodified lines | ||
| 728 | 728 | depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY |
| 729 | 729 | depends on !FTRACE_MCOUNT_USE_CC |
| 730 | 730 | depends on FTRACE_MCOUNT_RECORD |
| 731 | + select OBJTOOL | |
| 731 | 732 | |
| 732 | 733 | config FTRACE_MCOUNT_USE_RECORDMCOUNT |
| 733 | 734 | def_bool y |
| @@ -485,24 +485,25 @@ config FRAME_POINTER · 484 unmodified lines | ||
| 485 | 485 | larger and slower, but it gives very useful debugging information |
| 486 | 486 | in case of kernel bugs. (precise oopses/stacktraces/warnings) |
| 487 | 487 | |
| 488 | +config OBJTOOL | |
| 489 | + bool | |
| 490 | + | |
| 488 | 491 | config STACK_VALIDATION |
| 489 | 492 | bool "Compile-time stack metadata validation" |
| 490 | − depends on HAVE_STACK_VALIDATION | |
| 493 | + depends on HAVE_STACK_VALIDATION && UNWINDER_FRAME_POINTER | |
| 494 | + select OBJTOOL | |
| 491 | 495 | default n |
| 492 | 496 | help |
| 493 | − Add compile-time checks to validate stack metadata, including frame | |
| 494 | − pointers (if CONFIG_FRAME_POINTER is enabled). This helps ensure | |
| 495 | − that runtime stack traces are more reliable. | |
| 496 | − | |
| 497 | − This is also a prerequisite for generation of ORC unwind data, which | |
| 498 | − is needed for CONFIG_UNWINDER_ORC. | |
| 497 | + Validate frame pointer rules at compile-time. This helps ensure that | |
| 498 | + runtime stack traces are more reliable. | |
| 499 | 499 | |
| 500 | 500 | For more information, see |
| 501 | 501 | tools/objtool/Documentation/stack-validation.txt. |
| 502 | 502 | |
| 503 | 503 | config VMLINUX_VALIDATION |
| 504 | 504 | bool |
| 505 | − depends on STACK_VALIDATION && DEBUG_ENTRY | |
| 505 | + depends on HAVE_OBJTOOL && DEBUG_ENTRY | |
| 506 | + select OBJTOOL | |
| 506 | 507 | default y |
| 507 | 508 | |
| 508 | 509 | config VMLINUX_MAP |
| @@ -2035,10 +2036,11 @@ config KCOV · 1526 unmodified lines | ||
| 2035 | 2036 | bool "Code coverage for fuzzing" |
| 2036 | 2037 | depends on ARCH_HAS_KCOV |
| 2037 | 2038 | depends on CC_HAS_SANCOV_TRACE_PC || GCC_PLUGINS |
| 2038 | − depends on !ARCH_WANTS_NO_INSTR || STACK_VALIDATION || \ | |
| 2039 | + depends on !ARCH_WANTS_NO_INSTR || HAVE_OBJTOOL || \ | |
| 2039 | 2040 | GCC_VERSION >= 120000 || CLANG_VERSION >= 130000 |
| 2040 | 2041 | select DEBUG_FS |
| 2041 | 2042 | select GCC_PLUGIN_SANCOV if !CC_HAS_SANCOV_TRACE_PC |
| 2043 | + select OBJTOOL if HAVE_OBJTOOL | |
| 2042 | 2044 | help |
| 2043 | 2045 | KCOV exposes kernel code coverage information in a form suitable |
| 2044 | 2046 | for coverage-guided fuzzing (randomized testing). |
| @@ -187,7 +187,8 @@ config KCSAN_WEAK_MEMORY · 186 unmodified lines | ||
| 187 | 187 | # We can either let objtool nop __tsan_func_{entry,exit}() and builtin |
| 188 | 188 | # atomics instrumentation in .noinstr.text, or use a compiler that can |
| 189 | 189 | # implement __no_kcsan to really remove all instrumentation. |
| 190 | − depends on STACK_VALIDATION || CC_IS_GCC || CLANG_VERSION >= 140000 | |
| 190 | + depends on HAVE_OBJTOOL || CC_IS_GCC || CLANG_VERSION >= 140000 | |
| 191 | + select OBJTOOL if HAVE_OBJTOOL | |
| 191 | 192 | help |
| 192 | 193 | Enable support for modeling a subset of weak memory, which allows |
| 193 | 194 | detecting a subset of data races due to missing memory barriers. |
| @@ -94,7 +94,7 @@ config UBSAN_UNREACHABLE · 93 unmodified lines | ||
| 94 | 94 | bool "Perform checking for unreachable code" |
| 95 | 95 | # objtool already handles unreachable checking and gets angry about |
| 96 | 96 | # seeing UBSan instrumentation located in unreachable places. |
| 97 | − depends on !STACK_VALIDATION | |
| 97 | + depends on !(OBJTOOL && (STACK_VALIDATION || UNWINDER_ORC || X86_SMAP)) | |
| 98 | 98 | depends on $(cc-option,-fsanitize=unreachable) |
| 99 | 99 | help |
| 100 | 100 | This option enables -fsanitize=unreachable which checks for control |
| @@ -222,7 +222,7 @@ cmd_record_mcount = $(if $(findstring $(strip $(CC_FLAGS_FTRACE)),$(_c_flags)), · 221 unmodified lines | ||
| 222 | 222 | $(sub_cmd_record_mcount)) |
| 223 | 223 | endif # CONFIG_FTRACE_MCOUNT_USE_RECORDMCOUNT |
| 224 | 224 | |
| 225 | −ifdef CONFIG_STACK_VALIDATION | |
| 225 | +ifdef CONFIG_OBJTOOL | |
| 226 | 226 | |
| 227 | 227 | objtool := $(objtree)/tools/objtool/objtool |
| 228 | 228 | |
| @@ -241,7 +241,7 @@ objtool_args = \ · 12 unmodified lines | ||
| 241 | 241 | cmd_objtool = $(if $(objtool-enabled), ; $(objtool) $(objtool_args) $@) |
| 242 | 242 | cmd_gen_objtooldep = $(if $(objtool-enabled), { echo ; echo '$@: $$(wildcard $(objtool))' ; } >> $(dot-target).cmd) |
| 243 | 243 | |
| 244 | −endif # CONFIG_STACK_VALIDATION | |
| 244 | +endif # CONFIG_OBJTOOL | |
| 245 | 245 | |
| 246 | 246 | ifneq ($(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT),) |
| 247 | 247 | |
| @@ -108,8 +108,11 @@ objtool_link() · 107 unmodified lines | ||
| 108 | 108 | local objtoolcmd; |
| 109 | 109 | local objtoolopt; |
| 110 | 110 | |
| 111 | − if is_enabled CONFIG_STACK_VALIDATION && \ | |
| 112 | − ( is_enabled CONFIG_LTO_CLANG || is_enabled CONFIG_X86_KERNEL_IBT ); then | |
| 111 | + if ! is_enabled CONFIG_OBJTOOL; then | |
| 112 | + return; | |
| 113 | + fi | |
| 114 | + | |
| 115 | + if is_enabled CONFIG_LTO_CLANG || is_enabled CONFIG_X86_KERNEL_IBT; then | |
| 113 | 116 | |
| 114 | 117 | # Don't perform vmlinux validation unless explicitly requested, |
| 115 | 118 | # but run objtool on vmlinux.o now that we have an object file. |
| @@ -126,10 +129,23 @@ objtool_link() · 10 unmodified lines | ||
| 126 | 129 | objtoolopt="${objtoolopt} --orc" |
| 127 | 130 | fi |
| 128 | 131 | |
| 132 | + if is_enabled CONFIG_RETPOLINE; then | |
| 133 | + objtoolopt="${objtoolopt} --retpoline" | |
| 134 | + fi | |
| 135 | + | |
| 136 | + if is_enabled CONFIG_SLS; then | |
| 137 | + objtoolopt="${objtoolopt} --sls" | |
| 138 | + fi | |
| 139 | + | |
| 129 | 140 | if is_enabled CONFIG_STACK_VALIDATION; then |
| 130 | 141 | objtoolopt="${objtoolopt} --stackval" |
| 131 | 142 | fi |
| 132 | 143 | |
| 144 | + if is_enabled CONFIG_X86_SMAP; then | |
| 145 | + objtoolopt="${objtoolopt} --uaccess" | |
| 146 | + fi | |
| 147 | + | |
| 148 | + | |
| 133 | 149 | objtoolopt="${objtoolopt} --lto" |
| 134 | 150 | fi |
| 135 | 151 | |
| @@ -139,18 +155,6 @@ objtool_link() · 3 unmodified lines | ||
| 139 | 155 | |
| 140 | 156 | if [ -n "${objtoolopt}" ]; then |
| 141 | 157 | |
| 142 | − if is_enabled CONFIG_RETPOLINE; then | |
| 143 | − objtoolopt="${objtoolopt} --retpoline" | |
| 144 | − fi | |
| 145 | − | |
| 146 | − if is_enabled CONFIG_SLS; then | |
| 147 | − objtoolopt="${objtoolopt} --sls" | |
| 148 | − fi | |
| 149 | − | |
| 150 | − if is_enabled CONFIG_X86_SMAP; then | |
| 151 | − objtoolopt="${objtoolopt} --uaccess" | |
| 152 | − fi | |
| 153 | − | |
| 154 | 158 | if ! is_enabled CONFIG_FRAME_POINTER; then |
| 155 | 159 | objtoolopt="${objtoolopt} --no-fp" |
| 156 | 160 | fi |
| @@ -67,7 +67,7 @@ deploy_kernel_headers () { · 66 unmodified lines | ||
| 67 | 67 | ) > debian/hdrsrcfiles |
| 68 | 68 | |
| 69 | 69 | { |
| 70 | − if is_enabled CONFIG_STACK_VALIDATION; then | |
| 70 | + if is_enabled CONFIG_OBJTOOL; then | |
| 71 | 71 | echo tools/objtool/objtool |
| 72 | 72 | fi |
| 73 | 73 | |
| @@ -38,7 +38,7 @@ struct unwind_hint { · 37 unmodified lines | ||
| 38 | 38 | #define UNWIND_HINT_TYPE_REGS_PARTIAL 2 |
| 39 | 39 | #define UNWIND_HINT_TYPE_FUNC 3 |
| 40 | 40 | |
| 41 | −#ifdef CONFIG_STACK_VALIDATION | |
| 41 | +#ifdef CONFIG_OBJTOOL | |
| 42 | 42 | |
| 43 | 43 | #ifndef __ASSEMBLY__ |
| 44 | 44 | |
| @@ -157,7 +157,7 @@ struct unwind_hint { · 112 unmodified lines | ||
| 157 | 157 | |
| 158 | 158 | #endif /* __ASSEMBLY__ */ |
| 159 | 159 | |
| 160 | −#else /* !CONFIG_STACK_VALIDATION */ | |
| 160 | +#else /* !CONFIG_OBJTOOL */ | |
| 161 | 161 | |
| 162 | 162 | #ifndef __ASSEMBLY__ |
| 163 | 163 | |
| @@ -179,6 +179,6 @@ struct unwind_hint { · 15 unmodified lines | ||
| 179 | 179 | .endm |
| 180 | 180 | #endif |
| 181 | 181 | |
| 182 | −#endif /* CONFIG_STACK_VALIDATION */ | |
| 182 | +#endif /* CONFIG_OBJTOOL */ | |
| 183 | 183 | |
| 184 | 184 | #endif /* _LINUX_OBJTOOL_H */ |