]> Git Repo - linux.git/commitdiff
arch: Reserve map_shadow_stack() syscall number for all architectures
authorSohil Mehta <[email protected]>
Thu, 14 Sep 2023 18:58:03 +0000 (18:58 +0000)
committerArnd Bergmann <[email protected]>
Fri, 6 Oct 2023 20:26:51 +0000 (22:26 +0200)
commit c35559f94ebc ("x86/shstk: Introduce map_shadow_stack syscall")
recently added support for map_shadow_stack() but it is limited to x86
only for now. There is a possibility that other architectures (namely,
arm64 and RISC-V), that are implementing equivalent support for shadow
stacks, might need to add support for it.

Independent of that, reserving arch-specific syscall numbers in the
syscall tables of all architectures is good practice and would help
avoid future conflicts. map_shadow_stack() is marked as a conditional
syscall in sys_ni.c. Adding it to the syscall tables of other
architectures is harmless and would return ENOSYS when exercised.

Note, map_shadow_stack() was assigned #453 during the merge process
since #452 was taken by fchmodat2().

For Powerpc, map it to sys_ni_syscall() as is the norm for Powerpc
syscall tables.

For Alpha, map_shadow_stack() takes up #563 as Alpha still diverges from
the common syscall numbering system in the other architectures.

Link: https://lore.kernel.org/lkml/[email protected]/
Link: https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Sohil Mehta <[email protected]>
Reviewed-by: Rick Edgecombe <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Acked-by: Michael Ellerman <[email protected]> (powerpc)
Acked-by: Catalin Marinas <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
17 files changed:
arch/alpha/kernel/syscalls/syscall.tbl
arch/arm/tools/syscall.tbl
arch/arm64/include/asm/unistd.h
arch/arm64/include/asm/unistd32.h
arch/m68k/kernel/syscalls/syscall.tbl
arch/microblaze/kernel/syscalls/syscall.tbl
arch/mips/kernel/syscalls/syscall_n32.tbl
arch/mips/kernel/syscalls/syscall_n64.tbl
arch/mips/kernel/syscalls/syscall_o32.tbl
arch/parisc/kernel/syscalls/syscall.tbl
arch/powerpc/kernel/syscalls/syscall.tbl
arch/s390/kernel/syscalls/syscall.tbl
arch/sh/kernel/syscalls/syscall.tbl
arch/sparc/kernel/syscalls/syscall.tbl
arch/x86/entry/syscalls/syscall_32.tbl
arch/xtensa/kernel/syscalls/syscall.tbl
include/uapi/asm-generic/unistd.h

index 26a32f8e47d59dae2376ec74fd377e61d3b3b7ec..5d05ab716a748c7f83d6c657f600da9cc57485f7 100644 (file)
 560    common  set_mempolicy_home_node         sys_ni_syscall
 561    common  cachestat                       sys_cachestat
 562    common  fchmodat2                       sys_fchmodat2
+563    common  map_shadow_stack                sys_map_shadow_stack
index 04d8e491d8b46f1701e9985d6c103a34f1511fc1..45ec6e1dc87207dea030bccf4f9b95b987145b31 100644 (file)
 450    common  set_mempolicy_home_node         sys_set_mempolicy_home_node
 451    common  cachestat                       sys_cachestat
 452    common  fchmodat2                       sys_fchmodat2
+453    common  map_shadow_stack                sys_map_shadow_stack
index bd77253b62e01c051bcaed6425013b95db82a29a..6a28fb91b85de9f8afd15099158f91f07c6bcf69 100644 (file)
@@ -39,7 +39,7 @@
 #define __ARM_NR_compat_set_tls                (__ARM_NR_COMPAT_BASE + 5)
 #define __ARM_NR_COMPAT_END            (__ARM_NR_COMPAT_BASE + 0x800)
 
-#define __NR_compat_syscalls           453
+#define __NR_compat_syscalls           454
 #endif
 
 #define __ARCH_WANT_SYS_CLONE
index 9110be82dfaa973b058564ecbc7a6a7bcffcf906..0774d9cbe56327b2435c2ff87b5db765ab63a47b 100644 (file)
@@ -911,6 +911,8 @@ __SYSCALL(__NR_set_mempolicy_home_node, sys_set_mempolicy_home_node)
 __SYSCALL(__NR_cachestat, sys_cachestat)
 #define __NR_fchmodat2 452
 __SYSCALL(__NR_fchmodat2, sys_fchmodat2)
+#define __NR_map_shadow_stack 453
+__SYSCALL(__NR_map_shadow_stack, sys_map_shadow_stack)
 
 /*
  * Please add new compat syscalls above this comment and update
index f9d1f2d3f0670a983d9700b2f2e9858800d5a167..12d0ce43b094fd630acb9e1f7d58d3daa91eed77 100644 (file)
 450    common  set_mempolicy_home_node         sys_set_mempolicy_home_node
 451    common  cachestat                       sys_cachestat
 452    common  fchmodat2                       sys_fchmodat2
+453    common  map_shadow_stack                sys_map_shadow_stack
index 185fe73d9bbf7e858de6815f08b8c24c1044739b..de8219c4300c8dcf09b7c3ee8aa95e58b6873c67 100644 (file)
 450    common  set_mempolicy_home_node         sys_set_mempolicy_home_node
 451    common  cachestat                       sys_cachestat
 452    common  fchmodat2                       sys_fchmodat2
+453    common  map_shadow_stack                sys_map_shadow_stack
index 08f33e7c2896132bb6dd13a6525a515fa56ce7e4..a5096a064fb4241052f2304e5da1400d5facd0a0 100644 (file)
 450    n32     set_mempolicy_home_node         sys_set_mempolicy_home_node
 451    n32     cachestat                       sys_cachestat
 452    n32     fchmodat2                       sys_fchmodat2
+453    n32     map_shadow_stack                sys_map_shadow_stack
index 80be0e98ea0c5488ef27a08637e8a12b991c6eae..0044031d9c7001d2883ab2097a8969b3b21b44fc 100644 (file)
 450    common  set_mempolicy_home_node         sys_set_mempolicy_home_node
 451    n64     cachestat                       sys_cachestat
 452    n64     fchmodat2                       sys_fchmodat2
+453    n64     map_shadow_stack                sys_map_shadow_stack
index 310c7e839b6975eb60eb61e247bd22351a95ee0b..cf44a6ac38fac6ce5a36c229a3708f0f8e301fc0 100644 (file)
 450    o32     set_mempolicy_home_node         sys_set_mempolicy_home_node
 451    o32     cachestat                       sys_cachestat
 452    o32     fchmodat2                       sys_fchmodat2
+453    o32     map_shadow_stack                sys_map_shadow_stack
index 5410ff9456ae5c8ccc4f8040b45a3a930e2c01fb..4048ed480a04183f101008989b70d7f54431573a 100644 (file)
 450    common  set_mempolicy_home_node         sys_set_mempolicy_home_node
 451    common  cachestat                       sys_cachestat
 452    common  fchmodat2                       sys_fchmodat2
+453    common  map_shadow_stack                sys_map_shadow_stack
index e1412519b4ad9ae2a38750a1c4e3dce63ce83ecb..d845e14c38f31efd1cb5073e49e32b337df3de65 100644 (file)
 450    nospu   set_mempolicy_home_node         sys_set_mempolicy_home_node
 451    common  cachestat                       sys_cachestat
 452    common  fchmodat2                       sys_fchmodat2
+453    common  map_shadow_stack                sys_ni_syscall
index cc0bc144b6616226b7df2aa717a7e57b798756d5..416645f1c1fbf95b73fd116fa77f5edf9ed0c79c 100644 (file)
 450  common    set_mempolicy_home_node sys_set_mempolicy_home_node     sys_set_mempolicy_home_node
 451  common    cachestat               sys_cachestat                   sys_cachestat
 452  common    fchmodat2               sys_fchmodat2                   sys_fchmodat2
+453  common    map_shadow_stack        sys_map_shadow_stack            sys_map_shadow_stack
index 17ca589768498e91f160005147aba363b042a780..bf36587b87b5ecd5709f4178ab92b342e22cee1a 100644 (file)
 450    common  set_mempolicy_home_node         sys_set_mempolicy_home_node
 451    common  cachestat                       sys_cachestat
 452    common  fchmodat2                       sys_fchmodat2
+453    common  map_shadow_stack                sys_map_shadow_stack
index 3f72970cf9837ef6793fb309c922ca4613b9bfec..f45f8c5ed076854b99d727a0984fce720e4e545b 100644 (file)
 450    common  set_mempolicy_home_node         sys_set_mempolicy_home_node
 451    common  cachestat                       sys_cachestat
 452    common  fchmodat2                       sys_fchmodat2
+453    common  map_shadow_stack                sys_map_shadow_stack
index 6d0286bbbe276d4bda23a695b82e28a3e041cffe..54748f6d7c45177ac98b9056990c7b59601a723b 100644 (file)
 450    i386    set_mempolicy_home_node         sys_set_mempolicy_home_node
 451    i386    cachestat               sys_cachestat
 452    i386    fchmodat2               sys_fchmodat2
+453    i386    map_shadow_stack        sys_map_shadow_stack
index 351521b2e84162f40a8dd511059dd31b12824adf..10a7eecbedf097fb8134fd89ac1c4d47a3ad8998 100644 (file)
 450    common  set_mempolicy_home_node         sys_set_mempolicy_home_node
 451    common  cachestat                       sys_cachestat
 452    common  fchmodat2                       sys_fchmodat2
+453    common  map_shadow_stack                sys_map_shadow_stack
index 76d94644539127e5ba6228b2250ebd96aff92cdf..00df5af71ca134568991874a8b3d18c008d215a5 100644 (file)
@@ -823,8 +823,11 @@ __SYSCALL(__NR_cachestat, sys_cachestat)
 #define __NR_fchmodat2 452
 __SYSCALL(__NR_fchmodat2, sys_fchmodat2)
 
+#define __NR_map_shadow_stack 453
+__SYSCALL(__NR_map_shadow_stack, sys_map_shadow_stack)
+
 #undef __NR_syscalls
-#define __NR_syscalls 453
+#define __NR_syscalls 454
 
 /*
  * 32 bit systems traditionally used different
This page took 0.087318 seconds and 4 git commands to generate.