Skip to contentSkip to conversation

arch: Reserve map_shadow_stack() syscall number for all architectures

PATCH In review Sohil Mehta 6 participants 11 messages Sep 14, 2023 – Oct 6, 2023

Subsystems (16)
Arm (32-bit) x86 PowerPC MIPS +12 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arch: Reserve map_shadow_stack() syscall number for all architectures

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.

---
v2:
- Skip syscall table changes to tools/. They will be handled separetely by the perf folks.
- Map Powerpc to sys_ni_syscall (Rick Edgecombe)

---
 arch/alpha/kernel/syscalls/syscall.tbl      | 1 +
 arch/arm/tools/syscall.tbl                  | 1 +
 arch/arm64/include/asm/unistd.h             | 2 +-
 arch/arm64/include/asm/unistd32.h           | 2 ++
 arch/ia64/kernel/syscalls/syscall.tbl       | 1 +
 arch/m68k/kernel/syscalls/syscall.tbl       | 1 +
 arch/microblaze/kernel/syscalls/syscall.tbl | 1 +
 arch/mips/kernel/syscalls/syscall_n32.tbl   | 1 +
 arch/mips/kernel/syscalls/syscall_n64.tbl   | 1 +
 arch/mips/kernel/syscalls/syscall_o32.tbl   | 1 +
 arch/parisc/kernel/syscalls/syscall.tbl     | 1 +
 arch/powerpc/kernel/syscalls/syscall.tbl    | 1 +
 arch/s390/kernel/syscalls/syscall.tbl       | 1 +
 arch/sh/kernel/syscalls/syscall.tbl         | 1 +
 arch/sparc/kernel/syscalls/syscall.tbl      | 1 +
 arch/x86/entry/syscalls/syscall_32.tbl      | 1 +
 arch/xtensa/kernel/syscalls/syscall.tbl     | 1 +
 include/uapi/asm-generic/unistd.h           | 5 ++++-
 18 files changed, 22 insertions(+), 2 deletions(-)
arch/alpha/kernel/syscalls/syscall.tbl +1 -0
index ad37569d0507..6e8479c96e65 100644
@@ -492,3 +492,4 @@
 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
arch/arm/tools/syscall.tbl +1 -0
index c572d6c3dee0..6d494dfbf5e4 100644
@@ -466,3 +466,4 @@
 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
arch/arm64/include/asm/unistd.h +1 -1
index bd77253b62e0..6a28fb91b85d 100644
@@ -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
arch/arm64/include/asm/unistd32.h +2 -0
index 78b68311ec81..a201d842ec82 100644
@@ -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
arch/ia64/kernel/syscalls/syscall.tbl +1 -0
index 83d8609aec03..be02ce9d376f 100644
@@ -373,3 +373,4 @@
 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
arch/m68k/kernel/syscalls/syscall.tbl +1 -0
index 259ceb125367..bee2d2f7f82c 100644
@@ -452,3 +452,4 @@
 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
arch/microblaze/kernel/syscalls/syscall.tbl +1 -0
index a3798c2637fd..09eda7ed91b0 100644
@@ -458,3 +458,4 @@
 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
arch/mips/kernel/syscalls/syscall_n32.tbl +1 -0
index 152034b8e0a0..3c02cc3886ca 100644
@@ -391,3 +391,4 @@
 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
arch/mips/kernel/syscalls/syscall_n64.tbl +1 -0
index cb5e757f6621..aa9ed6a7cb48 100644
@@ -367,3 +367,4 @@
 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
arch/mips/kernel/syscalls/syscall_o32.tbl +1 -0
index 1a646813afdc..756f6feb21c2 100644
@@ -440,3 +440,4 @@
 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
arch/parisc/kernel/syscalls/syscall.tbl +1 -0
index e97c175b56f9..c80eedbe0170 100644
@@ -451,3 +451,4 @@
 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
arch/powerpc/kernel/syscalls/syscall.tbl +1 -0
index 20e50586e8a2..87a54acf8346 100644
@@ -539,3 +539,4 @@
 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
arch/s390/kernel/syscalls/syscall.tbl +1 -0
index 0122cc156952..22249c07e556 100644
@@ -455,3 +455,4 @@
 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
arch/sh/kernel/syscalls/syscall.tbl +1 -0
index e90d585c4d3e..5ccfe6fbb6b1 100644
@@ -455,3 +455,4 @@
 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
arch/sparc/kernel/syscalls/syscall.tbl +1 -0
index 4ed06c71c43f..b2d664edebdd 100644
@@ -498,3 +498,4 @@
 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
arch/x86/entry/syscalls/syscall_32.tbl +1 -0
index 2d0b1bd866ea..743a7ef5a4b9 100644
@@ -457,3 +457,4 @@
 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
arch/xtensa/kernel/syscalls/syscall.tbl +1 -0
index fc1a4f3c81d9..94e6bcc2bec7 100644
@@ -423,3 +423,4 @@
 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
include/uapi/asm-generic/unistd.h +4 -1
index abe087c53b4b..203ae30d7761 100644
@@ -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
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 18 lines · Sohil Mehta

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().

Quoted 6 lines

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.

reviewer Acked-by on v2 1/1
#2 lore raw
In reply to Sohil Mehta
Quoted 12 lines · Sohil Mehta

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.

Quoted 5 lines

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.

Mapping it to sys_map_shadow_stack() would work fine, but I'm happy with sys_ni_syscall as I don't see powerpc implementing map_shadow_stack() any time soon.

cheers

author Reviewed-by Rick Edgecombe Acked-by Michael Ellerman on v2 1/1
#3 lore raw
In reply to Sohil Mehta
Quoted 18 lines · Sohil Mehta

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.

Quoted 8 lines

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

---

Gentle ping...

Are there any additional comments? It applies cleanly on 6.6-rc4.

Or does it seem ready to be merged? It has the following acknowledgements until now:

Quoted 19 lines
 arch/alpha/kernel/syscalls/syscall.tbl      | 1 +
 arch/arm/tools/syscall.tbl                  | 1 +
 arch/arm64/include/asm/unistd.h             | 2 +-
 arch/arm64/include/asm/unistd32.h           | 2 ++
 arch/ia64/kernel/syscalls/syscall.tbl       | 1 +
 arch/m68k/kernel/syscalls/syscall.tbl       | 1 +
 arch/microblaze/kernel/syscalls/syscall.tbl | 1 +
 arch/mips/kernel/syscalls/syscall_n32.tbl   | 1 +
 arch/mips/kernel/syscalls/syscall_n64.tbl   | 1 +
 arch/mips/kernel/syscalls/syscall_o32.tbl   | 1 +
 arch/parisc/kernel/syscalls/syscall.tbl     | 1 +
 arch/powerpc/kernel/syscalls/syscall.tbl    | 1 +
 arch/s390/kernel/syscalls/syscall.tbl       | 1 +
 arch/sh/kernel/syscalls/syscall.tbl         | 1 +
 arch/sparc/kernel/syscalls/syscall.tbl      | 1 +
 arch/x86/entry/syscalls/syscall_32.tbl      | 1 +
 arch/xtensa/kernel/syscalls/syscall.tbl     | 1 +
 include/uapi/asm-generic/unistd.h           | 5 ++++-
 18 files changed, 22 insertions(+), 2 deletions(-)
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/alpha/kernel/syscalls/syscall.tbl

Quoted 178 lines

index ad37569d0507..6e8479c96e65 100644

arch/alpha/kernel/syscalls/syscall.tbl +1 -0
@@ -492,3 +492,4 @@
 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
arch/arm/tools/syscall.tbl +1 -0
index c572d6c3dee0..6d494dfbf5e4 100644
@@ -466,3 +466,4 @@
 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
arch/arm64/include/asm/unistd.h +1 -1
index bd77253b62e0..6a28fb91b85d 100644
@@ -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
arch/arm64/include/asm/unistd32.h +2 -0
index 78b68311ec81..a201d842ec82 100644
@@ -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
arch/ia64/kernel/syscalls/syscall.tbl +1 -0
index 83d8609aec03..be02ce9d376f 100644
@@ -373,3 +373,4 @@
 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
arch/m68k/kernel/syscalls/syscall.tbl +1 -0
index 259ceb125367..bee2d2f7f82c 100644
@@ -452,3 +452,4 @@
 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
arch/microblaze/kernel/syscalls/syscall.tbl +1 -0
index a3798c2637fd..09eda7ed91b0 100644
@@ -458,3 +458,4 @@
 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
arch/mips/kernel/syscalls/syscall_n32.tbl +1 -0
index 152034b8e0a0..3c02cc3886ca 100644
@@ -391,3 +391,4 @@
 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
arch/mips/kernel/syscalls/syscall_n64.tbl +1 -0
index cb5e757f6621..aa9ed6a7cb48 100644
@@ -367,3 +367,4 @@
 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
arch/mips/kernel/syscalls/syscall_o32.tbl +1 -0
index 1a646813afdc..756f6feb21c2 100644
@@ -440,3 +440,4 @@
 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
arch/parisc/kernel/syscalls/syscall.tbl +1 -0
index e97c175b56f9..c80eedbe0170 100644
@@ -451,3 +451,4 @@
 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
arch/powerpc/kernel/syscalls/syscall.tbl +1 -0
index 20e50586e8a2..87a54acf8346 100644
@@ -539,3 +539,4 @@
 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
arch/s390/kernel/syscalls/syscall.tbl +1 -0
index 0122cc156952..22249c07e556 100644
@@ -455,3 +455,4 @@
 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
arch/sh/kernel/syscalls/syscall.tbl +1 -0
index e90d585c4d3e..5ccfe6fbb6b1 100644
@@ -455,3 +455,4 @@
 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
arch/sparc/kernel/syscalls/syscall.tbl +1 -0
index 4ed06c71c43f..b2d664edebdd 100644
@@ -498,3 +498,4 @@
 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
arch/x86/entry/syscalls/syscall_32.tbl +1 -0
index 2d0b1bd866ea..743a7ef5a4b9 100644
@@ -457,3 +457,4 @@
 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
arch/xtensa/kernel/syscalls/syscall.tbl +1 -0
index fc1a4f3c81d9..94e6bcc2bec7 100644
@@ -423,3 +423,4 @@
 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
include/uapi/asm-generic/unistd.h +4 -1
index abe087c53b4b..203ae30d7761 100644
@@ -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
maintainer Reviewed-by
#4 lore raw
Quoted 30 lines · Sohil Mehta
Quoted 18 lines · Sohil Mehta

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.

Quoted 8 lines

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

---

Gentle ping...

Quoted 8 lines

Are there any additional comments? It applies cleanly on 6.6-rc4.

Or does it seem ready to be merged? It has the following acknowledgements until now:

If you like, I can pick this up for 6.7 through the asm-generic tree. If you think this should be part of 6.6, I would suggest to merge it through the tree that originally contained the syscall code.

Arnd

#5 lore raw
Quoted 6 lines · Arnd Bergmann
Quoted 5 lines · Sohil Mehta

Gentle ping...

Are there any additional comments? It applies cleanly on 6.6-rc4.

Quoted 9 lines
Quoted 6 lines

Or does it seem ready to be merged? It has the following acknowledgements until now:

Thanks Arnd.

Quoted 5 lines

If you like, I can pick this up for 6.7 through the asm-generic tree. If you think this should be part of 6.6, I would suggest to merge it through the tree that originally contained the syscall code.

Dave, Ingo, would you prefer to take this patch through 6.6 or defer it until 6.7?

It's not necessarily a fix but it does help finish up the shstk syscall added with 6.6. Also, it might help reduce some merge conflicts later if newer syscalls are being added during the 6.7 window.

Sohil

#6 lore raw
Quoted 10 lines · Sohil Mehta
Quoted 5 lines

If you like, I can pick this up for 6.7 through the asm-generic tree. If you think this should be part of 6.6, I would suggest to merge it through the tree that originally contained the syscall code.

Dave, Ingo, would you prefer to take this patch through 6.6 or defer it
until 6.7?

Quoted 5 lines

It's not necessarily a fix but it does help finish up the shstk syscall
added with 6.6. Also, it might help reduce some merge conflicts later if
newer syscalls are being added during the 6.7 window.

Hi Arnd,

It doesn't look like anyone is pouncing on the syscall number in linux- next currently. It might be nice to have this patch go through linux- next since it touches so many architectures. And it sounds like x86 folk are ok with this, so if you could pick it up for 6.7 that would be great. Thanks!

maintainer
#7 lore raw
Quoted 17 lines · Rick P
Quoted 10 lines · Sohil Mehta
Quoted 5 lines

If you like, I can pick this up for 6.7 through the asm-generic tree. If you think this should be part of 6.6, I would suggest to merge it through the tree that originally contained the syscall code.

Dave, Ingo, would you prefer to take this patch through 6.6 or defer it
until 6.7?

Quoted 5 lines

It's not necessarily a fix but it does help finish up the shstk syscall
added with 6.6. Also, it might help reduce some merge conflicts later if
newer syscalls are being added during the 6.7 window.

Quoted 7 lines

Hi Arnd,

It doesn't look like anyone is pouncing on the syscall number in linux- next currently. It might be nice to have this patch go through linux- next since it touches so many architectures. And it sounds like x86 folk are ok with this, so if you could pick it up for 6.7 that would be great. Thanks!

Ok, I picked it up now, should be in linux-next starting next week.

Arnd

#8 lore raw
Quoted 11 lines · Arnd Bergmann
Quoted 7 lines · Rick P

Hi Arnd,

It doesn't look like anyone is pouncing on the syscall number in linux- next currently. It might be nice to have this patch go through linux- next since it touches so many architectures. And it sounds like x86 folk are ok with this, so if you could pick it up for 6.7 that would be great. Thanks!

Ok, I picked it up now, should be in linux-next starting next week.

Great, thanks Arnd and Rick!

Sohil

maintainer Acked-by on v2 1/1
#9 lore raw
In reply to Sohil Mehta
Quoted 21 lines · Sohil Mehta

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.

Quoted 6 lines
 arch/m68k/kernel/syscalls/syscall.tbl       | 1 +

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
maintainer Acked-by on v2 1/1
#10 lore raw
In reply to Sohil Mehta
Quoted 30 lines · Sohil Mehta

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.

---
v2:
- Skip syscall table changes to tools/. They will be handled separetely by the perf folks.
- Map Powerpc to sys_ni_syscall (Rick Edgecombe)

Quoted 5 lines
---
 arch/alpha/kernel/syscalls/syscall.tbl      | 1 +
 arch/arm/tools/syscall.tbl                  | 1 +
 arch/arm64/include/asm/unistd.h             | 2 +-
 arch/arm64/include/asm/unistd32.h           | 2 ++

For arm64 (compat):