Skip to content

Commit bcc9d04

Browse files
brooniectmarinas
authored andcommitted
mm: Introduce ARCH_HAS_USER_SHADOW_STACK
Since multiple architectures have support for shadow stacks and we need to select support for this feature in several places in the generic code provide a generic config option that the architectures can select. Suggested-by: David Hildenbrand <[email protected]> Acked-by: David Hildenbrand <[email protected]> Reviewed-by: Deepak Gupta <[email protected]> Reviewed-by: Rick Edgecombe <[email protected]> Reviewed-by: Mike Rapoport (IBM) <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Reviewed-by: Kees Cook <[email protected]> Tested-by: Kees Cook <[email protected]> Acked-by: Shuah Khan <[email protected]> Reviewed-by: Thiago Jung Bauermann <[email protected]> Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 9852d85 commit bcc9d04

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,7 @@ config X86_USER_SHADOW_STACK
19541954
depends on AS_WRUSS
19551955
depends on X86_64
19561956
select ARCH_USES_HIGH_VMA_FLAGS
1957+
select ARCH_HAS_USER_SHADOW_STACK
19571958
select X86_CET
19581959
help
19591960
Shadow stack protection is a hardware feature that detects function

fs/proc/task_mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
971971
#ifdef CONFIG_HAVE_ARCH_USERFAULTFD_MINOR
972972
[ilog2(VM_UFFD_MINOR)] = "ui",
973973
#endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */
974-
#ifdef CONFIG_X86_USER_SHADOW_STACK
974+
#ifdef CONFIG_ARCH_HAS_USER_SHADOW_STACK
975975
[ilog2(VM_SHADOW_STACK)] = "ss",
976976
#endif
977977
#if defined(CONFIG_64BIT) || defined(CONFIG_PPC32)

mm/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,12 @@ config NUMA_EMU
12961296
into virtual nodes when booted with "numa=fake=N", where N is the
12971297
number of nodes. This is only useful for debugging.
12981298

1299+
config ARCH_HAS_USER_SHADOW_STACK
1300+
bool
1301+
help
1302+
The architecture has hardware support for userspace shadow call
1303+
stacks (eg, x86 CET, arm64 GCS or RISC-V Zicfiss).
1304+
12991305
source "mm/damon/Kconfig"
13001306

13011307
endmenu

0 commit comments

Comments
 (0)