History

Merge tag 'x86_core_for_v6.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull more x86 updates from Borislav Petkov: - Remove a bunch of asm implementing condition flags testing in KVM's emulator in favor of int3_emulate_jcc() which is written in C - Replace KVM fastops with C-based stubs which avoids problems with the fastop infra related to latter not adhering to the C ABI due to their special calling convention and, more importantly, bypassing compiler control-flow integrity checking because they're written in asm - Remove wrongly used static branches and other ugliness accumulated over time in hyperv's hypercall implementation with a proper static function call to the correct hypervisor call variant - Add some fixes and modifications to allow running FRED-enabled kernels in KVM even on non-FRED hardware - Add kCFI improvements like validating indirect calls and prepare for enabling kCFI with GCC. Add cmdline params documentation and other code cleanups - Use the single-byte 0xd6 insn as the official #UD single-byte undefined opcode instruction as agreed upon by both x86 vendors - Other smaller cleanups and touchups all over the place * tag 'x86_core_for_v6.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits) x86,retpoline: Optimize patch_retpoline() x86,ibt: Use UDB instead of 0xEA x86/cfi: Remove __noinitretpoline and __noretpoline x86/cfi: Add "debug" option to "cfi=" bootparam x86/cfi: Standardize on common "CFI:" prefix for CFI reports x86/cfi: Document the "cfi=" bootparam options x86/traps: Clarify KCFI instruction layout compiler_types.h: Move __nocfi out of compiler-specific header objtool: Validate kCFI calls x86/fred: KVM: VMX: Always use FRED for IRQs when CONFIG_X86_FRED=y x86/fred: Play nice with invoking asm_fred_entry_from_kvm() on non-FRED hardware x86/fred: Install system vector handlers even if FRED isn't fully enabled x86/hyperv: Use direct call to hypercall-page x86/hyperv: Clean up hv_do_hypercall() KVM: x86: Remove fastops KVM: x86: Convert em_salc() to C KVM: x86: Introduce EM_ASM_3WCL KVM: x86: Introduce EM_ASM_1SRC2 KVM: x86: Introduce EM_ASM_2CL KVM: x86: Introduce EM_ASM_2W ...

Linus Torvalds committed 1 year ago

Commit 9591fdb2 parents 2f0a750 4a1e02b36 files · +728 −665Browse files

Showing the changes to include/linux (6 of 36 files). Show all

Unified · Split

6 files
  1. include/linux/compiler-clang.h +0 −5
  2. include/linux/compiler-gcc.h +0 −4
  3. include/linux/compiler_types.h +3 −1
  4. include/linux/init.h +0 −8
  5. include/linux/objtool.h +10 −0
  6. include/linux/objtool_types.h +1 −0
include/linux/compiler-clang.h+0−5
@@ -115,11 +115,6 @@ · 114 unmodified lines
115115 # define __noscs __attribute__((__no_sanitize__("shadow-call-stack")))
116116 #endif
117117
118−#if __has_feature(kcfi)
119−/* Disable CFI checking inside a function. */
120−#define __nocfi __attribute__((__no_sanitize__("kcfi")))
121−#endif
122−
123118 /*
124119 * Turn individual warnings and errors on and off locally, depending
125120 * on version.
include/linux/compiler-gcc.h+0−4
@@ -35,10 +35,6 @@ · 34 unmodified lines
3535 (typeof(ptr)) (__ptr + (off)); \
3636 })
3737
38−#ifdef CONFIG_MITIGATION_RETPOLINE
39−#define __noretpoline __attribute__((__indirect_branch__("keep")))
40−#endif
41−
4238 #if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__)
4339 #define __latent_entropy __attribute__((latent_entropy))
4440 #endif
include/linux/compiler_types.h+3−1
@@ -455,7 +455,9 @@ struct ftrace_likely_data { · 454 unmodified lines
455455 # define __noscs
456456 #endif
457457
458−#ifndef __nocfi
458+#if defined(CONFIG_CFI)
459+# define __nocfi __attribute__((__no_sanitize__("kcfi")))
460+#else
459461 # define __nocfi
460462 #endif
461463
include/linux/init.h+0−8
@@ -7,13 +7,6 @@ · 6 unmodified lines
77 #include <linux/stringify.h>
88 #include <linux/types.h>
99
10−/* Built-in __init functions needn't be compiled with retpoline */
11−#if defined(__noretpoline) && !defined(MODULE)
12−#define __noinitretpoline __noretpoline
13−#else
14−#define __noinitretpoline
15−#endif
16−
1710 /* These macros are used to mark some functions or
1811 * initialized data (doesn't apply to uninitialized data)
1912 * as `initialization' functions. The kernel can take this
@@ -50,7 +43,6 @@ · 30 unmodified lines
5043 /* These are for everybody (although not all archs will actually
5144 discard it in modules) */
5245 #define __init __section(".init.text") __cold __latent_entropy \
53− __noinitretpoline \
5446 __no_kstack_erase
5547 #define __initdata __section(".init.data")
5648 #define __initconst __section(".init.rodata")
include/linux/objtool.h+10−0
@@ -184,6 +184,15 @@ · 183 unmodified lines
184184 * WARN using UD2.
185185 */
186186 #define ANNOTATE_REACHABLE(label) __ASM_ANNOTATE(label, ANNOTYPE_REACHABLE)
187+/*
188+ * This should not be used; it annotates away CFI violations. There are a few
189+ * valid use cases like kexec handover to the next kernel image, and there is
190+ * no security concern there.
191+ *
192+ * There are also a few real issues annotated away, like EFI because we can't
193+ * control the EFI code.
194+ */
195+#define ANNOTATE_NOCFI_SYM(sym) asm(__ASM_ANNOTATE(sym, ANNOTYPE_NOCFI))
187196
188197 #else
189198 #define ANNOTATE_NOENDBR ANNOTATE type=ANNOTYPE_NOENDBR
@@ -194,6 +203,7 @@ · 4 unmodified lines
194203 #define ANNOTATE_INTRA_FUNCTION_CALL ANNOTATE type=ANNOTYPE_INTRA_FUNCTION_CALL
195204 #define ANNOTATE_UNRET_BEGIN ANNOTATE type=ANNOTYPE_UNRET_BEGIN
196205 #define ANNOTATE_REACHABLE ANNOTATE type=ANNOTYPE_REACHABLE
206+#define ANNOTATE_NOCFI_SYM ANNOTATE type=ANNOTYPE_NOCFI
197207 #endif
198208
199209 #if defined(CONFIG_NOINSTR_VALIDATION) && \
include/linux/objtool_types.h+1−0
@@ -65,5 +65,6 @@ struct unwind_hint { · 64 unmodified lines
6565 #define ANNOTYPE_IGNORE_ALTS 6
6666 #define ANNOTYPE_INTRA_FUNCTION_CALL 7
6767 #define ANNOTYPE_REACHABLE 8
68+#define ANNOTYPE_NOCFI 9
6869
6970 #endif /* _LINUX_OBJTOOL_TYPES_H */

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