History

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. Link: https://lore.kernel.org/lkml/20230515212255.GA562920@debug.ba.rivosinc.com/ Link: https://lore.kernel.org/lkml/b402b80b-a7c6-4ef0-b977-c0f5f582b78a@sirena.org.uk/

Sohil Mehta committed 3 years ago

Commit 2fd0eba1 parent ccab21117 files · +21 −2Browse files

Showing the changes to include/uapi (1 of 17 files). Show all

Unified · Split

include/uapi/asm-generic/unistd.h+4−1
@@ -823,8 +823,11 @@ __SYSCALL(__NR_cachestat, sys_cachestat) · 822 unmodified lines
823#define __NR_fchmodat2 452823#define __NR_fchmodat2 452
824__SYSCALL(__NR_fchmodat2, sys_fchmodat2)824__SYSCALL(__NR_fchmodat2, sys_fchmodat2)
825 825
826#define __NR_map_shadow_stack 453
827__SYSCALL(__NR_map_shadow_stack, sys_map_shadow_stack)
828
826#undef __NR_syscalls829#undef __NR_syscalls
827#define __NR_syscalls 453830#define __NR_syscalls 454
828 831
829/*832/*
830 * 32 bit systems traditionally used different833 * 32 bit systems traditionally used different

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t