History

x86/bugs: Rename CONFIG_RETPOLINE => CONFIG_MITIGATION_RETPOLINE

Step 5/10 of the namespace unification of CPU mitigations related Kconfig options. [ mingo: Converted a few more uses in comments/messages as well. ]

Breno Leitao committed 2 years ago

Commit aefb2f21 parent ea4654e39 files · +62 −62Browse files

Unified · Split

39 files
  1. Documentation/admin-guide/hw-vuln/spectre.rst +4 −4
  2. Documentation/admin-guide/kernel-parameters.txt +2 −2
  3. arch/x86/Kconfig +3 −3
  4. arch/x86/Makefile +2 −2
  5. arch/x86/entry/vdso/Makefile +2 −2
  6. arch/x86/include/asm/disabled-features.h +1 −1
  7. arch/x86/include/asm/linkage.h +4 −4
  8. arch/x86/include/asm/nospec-branch.h +4 −4
  9. arch/x86/kernel/alternative.c +3 −3
  10. arch/x86/kernel/cpu/bugs.c +3 −3
  11. arch/x86/kernel/ftrace.c +1 −1
  12. arch/x86/kernel/kprobes/opt.c +1 −1
  13. arch/x86/kernel/vmlinux.lds.S +2 −2
  14. arch/x86/kvm/mmu/mmu.c +1 −1
  15. arch/x86/kvm/mmu/mmu_internal.h +1 −1
  16. arch/x86/kvm/svm/svm.c +1 −1
  17. arch/x86/kvm/svm/vmenter.S +2 −2
  18. arch/x86/kvm/vmx/vmx.c +1 −1
  19. arch/x86/lib/Makefile +1 −1
  20. arch/x86/net/bpf_jit_comp.c +1 −1
  21. arch/x86/net/bpf_jit_comp32.c +1 −1
  22. arch/x86/purgatory/Makefile +1 −1
  23. include/linux/compiler-gcc.h +1 −1
  24. include/linux/indirect_call_wrapper.h +1 −1
  25. include/linux/module.h +1 −1
  26. include/net/netfilter/nf_tables_core.h +1 −1
  27. include/net/tc_wrapper.h +1 −1
  28. kernel/trace/ring_buffer.c +1 −1
  29. net/netfilter/Makefile +1 −1
  30. net/netfilter/nf_tables_core.c +3 −3
  31. net/netfilter/nft_ct.c +2 −2
  32. net/netfilter/nft_lookup.c +1 −1
  33. net/sched/sch_api.c +1 −1
  34. scripts/Makefile.lib +1 −1
  35. scripts/generate_rust_target.rs +1 −1
  36. scripts/mod/modpost.c +1 −1
  37. tools/arch/x86/include/asm/disabled-features.h +1 −1
  38. tools/objtool/arch/x86/special.c +1 −1
  39. tools/objtool/check.c +1 −1
Documentation/admin-guide/hw-vuln/spectre.rst+4−4
@@ -473,8 +473,8 @@ Spectre variant 2 · 472 unmodified lines
473473 -mindirect-branch=thunk-extern -mindirect-branch-register options.
474474 If the kernel is compiled with a Clang compiler, the compiler needs
475475 to support -mretpoline-external-thunk option. The kernel config
476− CONFIG_RETPOLINE needs to be turned on, and the CPU needs to run with
477− the latest updated microcode.
476+ CONFIG_MITIGATION_RETPOLINE needs to be turned on, and the CPU needs
477+ to run with the latest updated microcode.
478478
479479 On Intel Skylake-era systems the mitigation covers most, but not all,
480480 cases. See :ref:`[3] <spec_ref3>` for more details.
@@ -609,8 +609,8 @@ kernel command line. · 128 unmodified lines
609609 Selecting 'on' will, and 'auto' may, choose a
610610 mitigation method at run time according to the
611611 CPU, the available microcode, the setting of the
612− CONFIG_RETPOLINE configuration option, and the
613− compiler with which the kernel was built.
612+ CONFIG_MITIGATION_RETPOLINE configuration option,
613+ and the compiler with which the kernel was built.
614614
615615 Selecting 'on' will also enable the mitigation
616616 against user space to user space task attacks.
Documentation/admin-guide/kernel-parameters.txt+2−2
@@ -6007,8 +6007,8 @@ · 6006 unmodified lines
60076007 Selecting 'on' will, and 'auto' may, choose a
60086008 mitigation method at run time according to the
60096009 CPU, the available microcode, the setting of the
6010− CONFIG_RETPOLINE configuration option, and the
6011− compiler with which the kernel was built.
6010+ CONFIG_MITIGATION_RETPOLINE configuration option,
6011+ and the compiler with which the kernel was built.
60126012
60136013 Selecting 'on' will also enable the mitigation
60146014 against user space to user space task attacks.
arch/x86/Kconfig+3−3
@@ -2457,7 +2457,7 @@ config CALL_PADDING · 2456 unmodified lines
24572457
24582458 config FINEIBT
24592459 def_bool y
2460− depends on X86_KERNEL_IBT && CFI_CLANG && RETPOLINE
2460+ depends on X86_KERNEL_IBT && CFI_CLANG && MITIGATION_RETPOLINE
24612461 select CALL_PADDING
24622462
24632463 config HAVE_CALL_THUNKS
@@ -2495,7 +2495,7 @@ config MITIGATION_PAGE_TABLE_ISOLATION · 31 unmodified lines
24952495
24962496 See Documentation/arch/x86/pti.rst for more details.
24972497
2498−config RETPOLINE
2498+config MITIGATION_RETPOLINE
24992499 bool "Avoid speculative indirect branches in kernel"
25002500 select OBJTOOL if HAVE_OBJTOOL
25012501 default y
@@ -2507,7 +2507,7 @@ config RETPOLINE · 5 unmodified lines
25072507
25082508 config RETHUNK
25092509 bool "Enable return-thunks"
2510− depends on RETPOLINE && CC_HAS_RETURN_THUNK
2510+ depends on MITIGATION_RETPOLINE && CC_HAS_RETURN_THUNK
25112511 select OBJTOOL if HAVE_OBJTOOL
25122512 default y if X86_64
25132513 help
arch/x86/Makefile+2−2
@@ -192,7 +192,7 @@ KBUILD_CFLAGS += -Wno-sign-compare · 191 unmodified lines
192192 KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
193193
194194 # Avoid indirect branches in kernel to deal with Spectre
195−ifdef CONFIG_RETPOLINE
195+ifdef CONFIG_MITIGATION_RETPOLINE
196196 KBUILD_CFLAGS += $(RETPOLINE_CFLAGS)
197197 # Additionally, avoid generating expensive indirect jumps which
198198 # are subject to retpolines for small number of switch cases.
@@ -301,7 +301,7 @@ vdso-install-$(CONFIG_IA32_EMULATION) += arch/x86/entry/vdso/vdso32.so.dbg · 102 unmodified lines
301301
302302 archprepare: checkbin
303303 checkbin:
304−ifdef CONFIG_RETPOLINE
304+ifdef CONFIG_MITIGATION_RETPOLINE
305305 ifeq ($(RETPOLINE_CFLAGS),)
306306 @echo "You are building kernel with non-retpoline compiler." >&2
307307 @echo "Please update your compiler." >&2
arch/x86/entry/vdso/Makefile+2−2
@@ -87,7 +87,7 @@ CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \ · 86 unmodified lines
8787 -fno-omit-frame-pointer -foptimize-sibling-calls \
8888 -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
8989
90−ifdef CONFIG_RETPOLINE
90+ifdef CONFIG_MITIGATION_RETPOLINE
9191 ifneq ($(RETPOLINE_VDSO_CFLAGS),)
9292 CFL += $(RETPOLINE_VDSO_CFLAGS)
9393 endif
@@ -164,7 +164,7 @@ KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls) · 70 unmodified lines
164164 KBUILD_CFLAGS_32 += -fno-omit-frame-pointer
165165 KBUILD_CFLAGS_32 += -DDISABLE_BRANCH_PROFILING
166166
167−ifdef CONFIG_RETPOLINE
167+ifdef CONFIG_MITIGATION_RETPOLINE
168168 ifneq ($(RETPOLINE_VDSO_CFLAGS),)
169169 KBUILD_CFLAGS_32 += $(RETPOLINE_VDSO_CFLAGS)
170170 endif
arch/x86/include/asm/disabled-features.h+1−1
@@ -50,7 +50,7 @@ · 49 unmodified lines
5050 # define DISABLE_PTI (1 << (X86_FEATURE_PTI & 31))
5151 #endif
5252
53−#ifdef CONFIG_RETPOLINE
53+#ifdef CONFIG_MITIGATION_RETPOLINE
5454 # define DISABLE_RETPOLINE 0
5555 #else
5656 # define DISABLE_RETPOLINE ((1 << (X86_FEATURE_RETPOLINE & 31)) | \
arch/x86/include/asm/linkage.h+4−4
@@ -42,25 +42,25 @@ · 41 unmodified lines
4242
4343 #if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
4444 #define RET jmp __x86_return_thunk
45−#else /* CONFIG_RETPOLINE */
45+#else /* CONFIG_MITIGATION_RETPOLINE */
4646 #ifdef CONFIG_SLS
4747 #define RET ret; int3
4848 #else
4949 #define RET ret
5050 #endif
51−#endif /* CONFIG_RETPOLINE */
51+#endif /* CONFIG_MITIGATION_RETPOLINE */
5252
5353 #else /* __ASSEMBLY__ */
5454
5555 #if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
5656 #define ASM_RET "jmp __x86_return_thunk\n\t"
57−#else /* CONFIG_RETPOLINE */
57+#else /* CONFIG_MITIGATION_RETPOLINE */
5858 #ifdef CONFIG_SLS
5959 #define ASM_RET "ret; int3\n\t"
6060 #else
6161 #define ASM_RET "ret\n\t"
6262 #endif
63−#endif /* CONFIG_RETPOLINE */
63+#endif /* CONFIG_MITIGATION_RETPOLINE */
6464
6565 #endif /* __ASSEMBLY__ */
6666
arch/x86/include/asm/nospec-branch.h+4−4
@@ -241,7 +241,7 @@ · 240 unmodified lines
241241 * instruction irrespective of kCFI.
242242 */
243243 .macro JMP_NOSPEC reg:req
244−#ifdef CONFIG_RETPOLINE
244+#ifdef CONFIG_MITIGATION_RETPOLINE
245245 __CS_PREFIX \reg
246246 jmp __x86_indirect_thunk_\reg
247247 #else
@@ -251,7 +251,7 @@ · 3 unmodified lines
251251 .endm
252252
253253 .macro CALL_NOSPEC reg:req
254−#ifdef CONFIG_RETPOLINE
254+#ifdef CONFIG_MITIGATION_RETPOLINE
255255 __CS_PREFIX \reg
256256 call __x86_indirect_thunk_\reg
257257 #else
@@ -378,7 +378,7 @@ static inline void call_depth_return_thunk(void) {} · 120 unmodified lines
378378
379379 #endif /* CONFIG_MITIGATION_CALL_DEPTH_TRACKING */
380380
381−#ifdef CONFIG_RETPOLINE
381+#ifdef CONFIG_MITIGATION_RETPOLINE
382382
383383 #define GEN(reg) \
384384 extern retpoline_thunk_t __x86_indirect_thunk_ ## reg;
@@ -399,7 +399,7 @@ static inline void call_depth_return_thunk(void) {} · 14 unmodified lines
399399
400400 /*
401401 * Inline asm uses the %V modifier which is only in newer GCC
402− * which is ensured when CONFIG_RETPOLINE is defined.
402+ * which is ensured when CONFIG_MITIGATION_RETPOLINE is defined.
403403 */
404404 # define CALL_NOSPEC \
405405 ALTERNATIVE_2( \
arch/x86/kernel/alternative.c+3−3
@@ -544,7 +544,7 @@ static inline bool is_jcc32(struct insn *insn) · 543 unmodified lines
544544 return insn->opcode.bytes[0] == 0x0f && (insn->opcode.bytes[1] & 0xf0) == 0x80;
545545 }
546546
547−#if defined(CONFIG_RETPOLINE) && defined(CONFIG_OBJTOOL)
547+#if defined(CONFIG_MITIGATION_RETPOLINE) && defined(CONFIG_OBJTOOL)
548548
549549 /*
550550 * CALL/JMP *%\reg
@@ -844,12 +844,12 @@ void __init_or_module noinline apply_returns(s32 *start, s32 *end) · 293 unmodified lines
844844 void __init_or_module noinline apply_returns(s32 *start, s32 *end) { }
845845 #endif /* CONFIG_RETHUNK */
846846
847−#else /* !CONFIG_RETPOLINE || !CONFIG_OBJTOOL */
847+#else /* !CONFIG_MITIGATION_RETPOLINE || !CONFIG_OBJTOOL */
848848
849849 void __init_or_module noinline apply_retpolines(s32 *start, s32 *end) { }
850850 void __init_or_module noinline apply_returns(s32 *start, s32 *end) { }
851851
852−#endif /* CONFIG_RETPOLINE && CONFIG_OBJTOOL */
852+#endif /* CONFIG_MITIGATION_RETPOLINE && CONFIG_OBJTOOL */
853853
854854 #ifdef CONFIG_X86_KERNEL_IBT
855855
arch/x86/kernel/cpu/bugs.c+3−3
@@ -1103,7 +1103,7 @@ static enum spectre_v2_user_mitigation spectre_v2_user_stibp __ro_after_init = · 1102 unmodified lines
11031103 static enum spectre_v2_user_mitigation spectre_v2_user_ibpb __ro_after_init =
11041104 SPECTRE_V2_USER_NONE;
11051105
1106−#ifdef CONFIG_RETPOLINE
1106+#ifdef CONFIG_MITIGATION_RETPOLINE
11071107 static bool spectre_v2_bad_module;
11081108
11091109 bool retpoline_module_ok(bool has_retpoline)
@@ -1416,7 +1416,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void) · 306 unmodified lines
14161416 cmd == SPECTRE_V2_CMD_RETPOLINE_GENERIC ||
14171417 cmd == SPECTRE_V2_CMD_EIBRS_LFENCE ||
14181418 cmd == SPECTRE_V2_CMD_EIBRS_RETPOLINE) &&
1419− !IS_ENABLED(CONFIG_RETPOLINE)) {
1419+ !IS_ENABLED(CONFIG_MITIGATION_RETPOLINE)) {
14201420 pr_err("%s selected but not compiled in. Switching to AUTO select\n",
14211421 mitigation_options[i].option);
14221422 return SPECTRE_V2_CMD_AUTO;
@@ -1470,7 +1470,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void) · 47 unmodified lines
14701470
14711471 static enum spectre_v2_mitigation __init spectre_v2_select_retpoline(void)
14721472 {
1473− if (!IS_ENABLED(CONFIG_RETPOLINE)) {
1473+ if (!IS_ENABLED(CONFIG_MITIGATION_RETPOLINE)) {
14741474 pr_err("Kernel not compiled with retpoline; no mitigation available!");
14751475 return SPECTRE_V2_NONE;
14761476 }
arch/x86/kernel/ftrace.c+1−1
@@ -307,7 +307,7 @@ union ftrace_op_code_union { · 306 unmodified lines
307307 } __attribute__((packed));
308308 };
309309
310−#define RET_SIZE (IS_ENABLED(CONFIG_RETPOLINE) ? 5 : 1 + IS_ENABLED(CONFIG_SLS))
310+#define RET_SIZE (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) ? 5 : 1 + IS_ENABLED(CONFIG_SLS))
311311
312312 static unsigned long
313313 create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
arch/x86/kernel/kprobes/opt.c+1−1
@@ -324,7 +324,7 @@ static int can_optimize(unsigned long paddr) · 323 unmodified lines
324324 * However, the kernel built with retpolines or IBT has jump
325325 * tables disabled so the check can be skipped altogether.
326326 */
327− if (!IS_ENABLED(CONFIG_RETPOLINE) &&
327+ if (!IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) &&
328328 !IS_ENABLED(CONFIG_X86_KERNEL_IBT) &&
329329 insn_is_indirect_jump(&insn))
330330 return 0;
arch/x86/kernel/vmlinux.lds.S+2−2
@@ -132,7 +132,7 @@ SECTIONS · 131 unmodified lines
132132 LOCK_TEXT
133133 KPROBES_TEXT
134134 SOFTIRQENTRY_TEXT
135−#ifdef CONFIG_RETPOLINE
135+#ifdef CONFIG_MITIGATION_RETPOLINE
136136 *(.text..__x86.indirect_thunk)
137137 *(.text..__x86.return_thunk)
138138 #endif
@@ -267,7 +267,7 @@ SECTIONS · 128 unmodified lines
267267 }
268268 #endif
269269
270−#ifdef CONFIG_RETPOLINE
270+#ifdef CONFIG_MITIGATION_RETPOLINE
271271 /*
272272 * List of instructions that call/jmp/jcc to retpoline thunks
273273 * __x86_indirect_thunk_*(). These instructions can be patched along
arch/x86/kvm/mmu/mmu.c+1−1
@@ -263,7 +263,7 @@ static unsigned long get_guest_cr3(struct kvm_vcpu *vcpu) · 262 unmodified lines
263263 static inline unsigned long kvm_mmu_get_guest_pgd(struct kvm_vcpu *vcpu,
264264 struct kvm_mmu *mmu)
265265 {
266− if (IS_ENABLED(CONFIG_RETPOLINE) && mmu->get_guest_pgd == get_guest_cr3)
266+ if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) && mmu->get_guest_pgd == get_guest_cr3)
267267 return kvm_read_cr3(vcpu);
268268
269269 return mmu->get_guest_pgd(vcpu);
arch/x86/kvm/mmu/mmu_internal.h+1−1
@@ -312,7 +312,7 @@ static inline int kvm_mmu_do_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, · 311 unmodified lines
312312 if (!prefetch)
313313 vcpu->stat.pf_taken++;
314314
315− if (IS_ENABLED(CONFIG_RETPOLINE) && fault.is_tdp)
315+ if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) && fault.is_tdp)
316316 r = kvm_tdp_page_fault(vcpu, &fault);
317317 else
318318 r = vcpu->arch.mmu->page_fault(vcpu, &fault);
arch/x86/kvm/svm/svm.c+1−1
@@ -3455,7 +3455,7 @@ int svm_invoke_exit_handler(struct kvm_vcpu *vcpu, u64 exit_code) · 3454 unmodified lines
34553455 if (!svm_check_exit_valid(exit_code))
34563456 return svm_handle_invalid_exit(vcpu, exit_code);
34573457
3458−#ifdef CONFIG_RETPOLINE
3458+#ifdef CONFIG_MITIGATION_RETPOLINE
34593459 if (exit_code == SVM_EXIT_MSR)
34603460 return msr_interception(vcpu);
34613461 else if (exit_code == SVM_EXIT_VINTR)
arch/x86/kvm/svm/vmenter.S+2−2
@@ -207,7 +207,7 @@ SYM_FUNC_START(__svm_vcpu_run) · 206 unmodified lines
207207 7: vmload %_ASM_AX
208208 8:
209209
210−#ifdef CONFIG_RETPOLINE
210+#ifdef CONFIG_MITIGATION_RETPOLINE
211211 /* IMPORTANT: Stuff the RSB immediately after VM-Exit, before RET! */
212212 FILL_RETURN_BUFFER %_ASM_AX, RSB_CLEAR_LOOPS, X86_FEATURE_RETPOLINE
213213 #endif
@@ -344,7 +344,7 @@ SYM_FUNC_START(__svm_sev_es_vcpu_run) · 130 unmodified lines
344344 /* Pop @svm to RDI, guest registers have been saved already. */
345345 pop %_ASM_DI
346346
347−#ifdef CONFIG_RETPOLINE
347+#ifdef CONFIG_MITIGATION_RETPOLINE
348348 /* IMPORTANT: Stuff the RSB immediately after VM-Exit, before RET! */
349349 FILL_RETURN_BUFFER %_ASM_AX, RSB_CLEAR_LOOPS, X86_FEATURE_RETPOLINE
350350 #endif
arch/x86/kvm/vmx/vmx.c+1−1
@@ -6544,7 +6544,7 @@ static int __vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) · 6543 unmodified lines
65446544
65456545 if (exit_reason.basic >= kvm_vmx_max_exit_handlers)
65466546 goto unexpected_vmexit;
6547−#ifdef CONFIG_RETPOLINE
6547+#ifdef CONFIG_MITIGATION_RETPOLINE
65486548 if (exit_reason.basic == EXIT_REASON_MSR_WRITE)
65496549 return kvm_emulate_wrmsr(vcpu);
65506550 else if (exit_reason.basic == EXIT_REASON_PREEMPTION_TIMER)
arch/x86/lib/Makefile+1−1
@@ -49,7 +49,7 @@ lib-$(CONFIG_ARCH_HAS_COPY_MC) += copy_mc.o copy_mc_64.o · 48 unmodified lines
4949 lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o insn-eval.o
5050 lib-$(CONFIG_RANDOMIZE_BASE) += kaslr.o
5151 lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
52−lib-$(CONFIG_RETPOLINE) += retpoline.o
52+lib-$(CONFIG_MITIGATION_RETPOLINE) += retpoline.o
5353
5454 obj-y += msr.o msr-reg.o msr-reg-export.o hweight.o
5555 obj-y += iomem.o
arch/x86/net/bpf_jit_comp.c+1−1
@@ -469,7 +469,7 @@ static void emit_indirect_jump(u8 **pprog, int reg, u8 *ip) · 468 unmodified lines
469469 emit_jump(&prog, &__x86_indirect_thunk_array[reg], ip);
470470 } else {
471471 EMIT2(0xFF, 0xE0 + reg); /* jmp *%\reg */
472− if (IS_ENABLED(CONFIG_RETPOLINE) || IS_ENABLED(CONFIG_SLS))
472+ if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) || IS_ENABLED(CONFIG_SLS))
473473 EMIT1(0xCC); /* int3 */
474474 }
475475
arch/x86/net/bpf_jit_comp32.c+1−1
@@ -1273,7 +1273,7 @@ static int emit_jmp_edx(u8 **pprog, u8 *ip) · 1272 unmodified lines
12731273 u8 *prog = *pprog;
12741274 int cnt = 0;
12751275
1276−#ifdef CONFIG_RETPOLINE
1276+#ifdef CONFIG_MITIGATION_RETPOLINE
12771277 EMIT1_off32(0xE9, (u8 *)__x86_indirect_thunk_edx - (ip + 5));
12781278 #else
12791279 EMIT2(0xFF, 0xE2);
arch/x86/purgatory/Makefile+1−1
@@ -61,7 +61,7 @@ ifdef CONFIG_STACKPROTECTOR_STRONG · 60 unmodified lines
6161 PURGATORY_CFLAGS_REMOVE += -fstack-protector-strong
6262 endif
6363
64−ifdef CONFIG_RETPOLINE
64+ifdef CONFIG_MITIGATION_RETPOLINE
6565 PURGATORY_CFLAGS_REMOVE += $(RETPOLINE_CFLAGS)
6666 endif
6767
include/linux/compiler-gcc.h+1−1
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535 (typeof(ptr)) (__ptr + (off)); \
3636 })
3737
38−#ifdef CONFIG_RETPOLINE
38+#ifdef CONFIG_MITIGATION_RETPOLINE
3939 #define __noretpoline __attribute__((__indirect_branch__("keep")))
4040 #endif
4141
include/linux/indirect_call_wrapper.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 #ifndef _LINUX_INDIRECT_CALL_WRAPPER_H
33 #define _LINUX_INDIRECT_CALL_WRAPPER_H
44
5−#ifdef CONFIG_RETPOLINE
5+#ifdef CONFIG_MITIGATION_RETPOLINE
66
77 /*
88 * INDIRECT_CALL_$NR - wrapper for indirect calls with $NR known builtin
include/linux/module.h+1−1
@@ -885,7 +885,7 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr, · 884 unmodified lines
885885 static inline void module_bug_cleanup(struct module *mod) {}
886886 #endif /* CONFIG_GENERIC_BUG */
887887
888−#ifdef CONFIG_RETPOLINE
888+#ifdef CONFIG_MITIGATION_RETPOLINE
889889 extern bool retpoline_module_ok(bool has_retpoline);
890890 #else
891891 static inline bool retpoline_module_ok(bool has_retpoline)
include/net/netfilter/nf_tables_core.h+1−1
@@ -93,7 +93,7 @@ extern const struct nft_set_type nft_set_bitmap_type; · 92 unmodified lines
9393 extern const struct nft_set_type nft_set_pipapo_type;
9494 extern const struct nft_set_type nft_set_pipapo_avx2_type;
9595
96−#ifdef CONFIG_RETPOLINE
96+#ifdef CONFIG_MITIGATION_RETPOLINE
9797 bool nft_rhash_lookup(const struct net *net, const struct nft_set *set,
9898 const u32 *key, const struct nft_set_ext **ext);
9999 bool nft_rbtree_lookup(const struct net *net, const struct nft_set *set,
include/net/tc_wrapper.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44
55 #include <net/pkt_cls.h>
66
7−#if IS_ENABLED(CONFIG_RETPOLINE)
7+#if IS_ENABLED(CONFIG_MITIGATION_RETPOLINE)
88
99 #include <linux/cpufeature.h>
1010 #include <linux/static_key.h>
kernel/trace/ring_buffer.c+1−1
@@ -1156,7 +1156,7 @@ static inline u64 rb_time_stamp(struct trace_buffer *buffer) · 1155 unmodified lines
11561156 u64 ts;
11571157
11581158 /* Skip retpolines :-( */
1159− if (IS_ENABLED(CONFIG_RETPOLINE) && likely(buffer->clock == trace_clock_local))
1159+ if (IS_ENABLED(CONFIG_MITIGATION_RETPOLINE) && likely(buffer->clock == trace_clock_local))
11601160 ts = trace_clock_local();
11611161 else
11621162 ts = buffer->clock();
net/netfilter/Makefile+1−1
@@ -101,7 +101,7 @@ endif · 100 unmodified lines
101101 endif
102102
103103 ifdef CONFIG_NFT_CT
104−ifdef CONFIG_RETPOLINE
104+ifdef CONFIG_MITIGATION_RETPOLINE
105105 nf_tables-objs += nft_ct_fast.o
106106 endif
107107 endif
net/netfilter/nf_tables_core.c+3−3
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #include <net/netfilter/nf_log.h>
2222 #include <net/netfilter/nft_meta.h>
2323
24−#if defined(CONFIG_RETPOLINE) && defined(CONFIG_X86)
24+#if defined(CONFIG_MITIGATION_RETPOLINE) && defined(CONFIG_X86)
2525
2626 static struct static_key_false nf_tables_skip_direct_calls;
2727
@@ -207,7 +207,7 @@ static void expr_call_ops_eval(const struct nft_expr *expr, · 179 unmodified lines
207207 struct nft_regs *regs,
208208 struct nft_pktinfo *pkt)
209209 {
210−#ifdef CONFIG_RETPOLINE
210+#ifdef CONFIG_MITIGATION_RETPOLINE
211211 unsigned long e;
212212
213213 if (nf_skip_indirect_calls())
@@ -236,7 +236,7 @@ static void expr_call_ops_eval(const struct nft_expr *expr, · 22 unmodified lines
236236 X(e, nft_objref_map_eval);
237237 #undef X
238238 indirect_call:
239−#endif /* CONFIG_RETPOLINE */
239+#endif /* CONFIG_MITIGATION_RETPOLINE */
240240 expr->ops->eval(expr, regs, pkt);
241241 }
242242
net/netfilter/nft_ct.c+2−2
@@ -751,7 +751,7 @@ static bool nft_ct_set_reduce(struct nft_regs_track *track, · 750 unmodified lines
751751 return false;
752752 }
753753
754−#ifdef CONFIG_RETPOLINE
754+#ifdef CONFIG_MITIGATION_RETPOLINE
755755 static const struct nft_expr_ops nft_ct_get_fast_ops = {
756756 .type = &nft_ct_type,
757757 .size = NFT_EXPR_SIZE(sizeof(struct nft_ct)),
@@ -796,7 +796,7 @@ nft_ct_select_ops(const struct nft_ctx *ctx, · 38 unmodified lines
796796 return ERR_PTR(-EINVAL);
797797
798798 if (tb[NFTA_CT_DREG]) {
799−#ifdef CONFIG_RETPOLINE
799+#ifdef CONFIG_MITIGATION_RETPOLINE
800800 u32 k = ntohl(nla_get_be32(tb[NFTA_CT_KEY]));
801801
802802 switch (k) {
net/netfilter/nft_lookup.c+1−1
@@ -24,7 +24,7 @@ struct nft_lookup { · 23 unmodified lines
2424 struct nft_set_binding binding;
2525 };
2626
27−#ifdef CONFIG_RETPOLINE
27+#ifdef CONFIG_MITIGATION_RETPOLINE
2828 bool nft_set_do_lookup(const struct net *net, const struct nft_set *set,
2929 const u32 *key, const struct nft_set_ext **ext)
3030 {
net/sched/sch_api.c+1−1
@@ -2353,7 +2353,7 @@ static struct pernet_operations psched_net_ops = { · 2352 unmodified lines
23532353 .exit = psched_net_exit,
23542354 };
23552355
2356−#if IS_ENABLED(CONFIG_RETPOLINE)
2356+#if IS_ENABLED(CONFIG_MITIGATION_RETPOLINE)
23572357 DEFINE_STATIC_KEY_FALSE(tc_skip_wrapper);
23582358 #endif
23592359
scripts/Makefile.lib+1−1
@@ -262,7 +262,7 @@ ifdef CONFIG_FTRACE_MCOUNT_USE_OBJTOOL · 261 unmodified lines
262262 objtool-args-$(CONFIG_HAVE_OBJTOOL_NOP_MCOUNT) += --mnop
263263 endif
264264 objtool-args-$(CONFIG_UNWINDER_ORC) += --orc
265−objtool-args-$(CONFIG_RETPOLINE) += --retpoline
265+objtool-args-$(CONFIG_MITIGATION_RETPOLINE) += --retpoline
266266 objtool-args-$(CONFIG_RETHUNK) += --rethunk
267267 objtool-args-$(CONFIG_SLS) += --sls
268268 objtool-args-$(CONFIG_STACK_VALIDATION) += --stackval
scripts/generate_rust_target.rs+1−1
@@ -155,7 +155,7 @@ fn main() { · 154 unmodified lines
155155 "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
156156 );
157157 let mut features = "-3dnow,-3dnowa,-mmx,+soft-float".to_string();
158− if cfg.has("RETPOLINE") {
158+ if cfg.has("MITIGATION_RETPOLINE") {
159159 features += ",+retpoline-external-thunk";
160160 }
161161 ts.push("features", features);
scripts/mod/modpost.c+1−1
@@ -1843,7 +1843,7 @@ static void add_header(struct buffer *b, struct module *mod) · 1842 unmodified lines
18431843
18441844 buf_printf(b,
18451845 "\n"
1846− "#ifdef CONFIG_RETPOLINE\n"
1846+ "#ifdef CONFIG_MITIGATION_RETPOLINE\n"
18471847 "MODULE_INFO(retpoline, \"Y\");\n"
18481848 "#endif\n");
18491849
tools/arch/x86/include/asm/disabled-features.h+1−1
@@ -50,7 +50,7 @@ · 49 unmodified lines
5050 # define DISABLE_PTI (1 << (X86_FEATURE_PTI & 31))
5151 #endif
5252
53−#ifdef CONFIG_RETPOLINE
53+#ifdef CONFIG_MITIGATION_RETPOLINE
5454 # define DISABLE_RETPOLINE 0
5555 #else
5656 # define DISABLE_RETPOLINE ((1 << (X86_FEATURE_RETPOLINE & 31)) | \
tools/objtool/arch/x86/special.c+1−1
@@ -83,7 +83,7 @@ bool arch_support_alt_relocation(struct special_alt *special_alt, · 82 unmodified lines
8383 * TODO: Once we have DWARF CFI and smarter instruction decoding logic,
8484 * ensure the same register is used in the mov and jump instructions.
8585 *
86− * NOTE: RETPOLINE made it harder still to decode dynamic jumps.
86+ * NOTE: MITIGATION_RETPOLINE made it harder still to decode dynamic jumps.
8787 */
8888 struct reloc *arch_find_switch_table(struct objtool_file *file,
8989 struct instruction *insn)
tools/objtool/check.c+1−1
@@ -3984,7 +3984,7 @@ static int validate_retpoline(struct objtool_file *file) · 3983 unmodified lines
39843984 } else
39853985 continue;
39863986 } else {
3987− WARN_INSN(insn, "indirect %s found in RETPOLINE build",
3987+ WARN_INSN(insn, "indirect %s found in MITIGATION_RETPOLINE build",
39883988 insn->type == INSN_JUMP_DYNAMIC ? "jump" : "call");
39893989 }
39903990

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t