Skip to content

Commit ae80e16

Browse files
brooniectmarinas
authored andcommitted
mm: Define VM_SHADOW_STACK for arm64 when we support GCS
Use VM_HIGH_ARCH_5 for guarded control stack pages. Reviewed-by: Thiago Jung Bauermann <[email protected]> Reviewed-by: Catalin Marinas <[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 092055f commit ae80e16

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Documentation/filesystems/proc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ encoded manner. The codes are the following:
579579
mt arm64 MTE allocation tags are enabled
580580
um userfaultfd missing tracking
581581
uw userfaultfd wr-protect tracking
582-
ss shadow stack page
582+
ss shadow/guarded control stack page
583583
sl sealed
584584
== =======================================
585585

include/linux/mm.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,17 @@ extern unsigned int kobjsize(const void *objp);
367367
* for more details on the guard size.
368368
*/
369369
# define VM_SHADOW_STACK VM_HIGH_ARCH_5
370-
#else
370+
#endif
371+
372+
#if defined(CONFIG_ARM64_GCS)
373+
/*
374+
* arm64's Guarded Control Stack implements similar functionality and
375+
* has similar constraints to shadow stacks.
376+
*/
377+
# define VM_SHADOW_STACK VM_HIGH_ARCH_6
378+
#endif
379+
380+
#ifndef VM_SHADOW_STACK
371381
# define VM_SHADOW_STACK VM_NONE
372382
#endif
373383

0 commit comments

Comments
 (0)