Skip to content

Commit 02c7d5b

Browse files
dkaplan2bp3tk0v
authored andcommitted
x86/pti: Add attack vector controls for PTI
Disable PTI mitigation if user->kernel attack vector mitigations are disabled. Signed-off-by: David Kaplan <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/[email protected]
1 parent 0cdd2c4 commit 02c7d5b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/x86/mm/pti.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <asm/desc.h>
3939
#include <asm/sections.h>
4040
#include <asm/set_memory.h>
41+
#include <asm/bugs.h>
4142

4243
#undef pr_fmt
4344
#define pr_fmt(fmt) "Kernel/User page tables isolation: " fmt
@@ -84,7 +85,8 @@ void __init pti_check_boottime_disable(void)
8485
return;
8586
}
8687

87-
if (cpu_mitigations_off())
88+
if (pti_mode == PTI_AUTO &&
89+
!cpu_attack_vector_mitigated(CPU_MITIGATE_USER_KERNEL))
8890
pti_mode = PTI_FORCE_OFF;
8991
if (pti_mode == PTI_FORCE_OFF) {
9092
pti_print_if_insecure("disabled on command line.");

0 commit comments

Comments
 (0)