Commit bcc9d04e authored by Mark Brown's avatar Mark Brown Committed by Catalin Marinas
Browse files

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: default avatarDavid Hildenbrand <david@redhat.com>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarDeepak Gupta <debug@rivosinc.com>
Reviewed-by: default avatarRick Edgecombe <rick.p.edgecombe@intel.com>
Reviewed-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Reviewed-by: default avatarKees Cook <kees@kernel.org>
Tested-by: default avatarKees Cook <kees@kernel.org>
Acked-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Reviewed-by: default avatarThiago Jung Bauermann <thiago.bauermann@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20241001-arm64-gcs-v13-1-222b78d87eee@kernel.org


Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 9852d85e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1954,6 +1954,7 @@ config X86_USER_SHADOW_STACK
	depends on AS_WRUSS
	depends on X86_64
	select ARCH_USES_HIGH_VMA_FLAGS
	select ARCH_HAS_USER_SHADOW_STACK
	select X86_CET
	help
	  Shadow stack protection is a hardware feature that detects function
+1 −1
Original line number Diff line number Diff line
@@ -971,7 +971,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
#ifdef CONFIG_HAVE_ARCH_USERFAULTFD_MINOR
		[ilog2(VM_UFFD_MINOR)]	= "ui",
#endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */
#ifdef CONFIG_X86_USER_SHADOW_STACK
#ifdef CONFIG_ARCH_HAS_USER_SHADOW_STACK
		[ilog2(VM_SHADOW_STACK)] = "ss",
#endif
#if defined(CONFIG_64BIT) || defined(CONFIG_PPC32)
+6 −0
Original line number Diff line number Diff line
@@ -1296,6 +1296,12 @@ config NUMA_EMU
	  into virtual nodes when booted with "numa=fake=N", where N is the
	  number of nodes. This is only useful for debugging.

config ARCH_HAS_USER_SHADOW_STACK
	bool
	help
	  The architecture has hardware support for userspace shadow call
          stacks (eg, x86 CET, arm64 GCS or RISC-V Zicfiss).

source "mm/damon/Kconfig"

endmenu