Skip to content

Commit a60f7b6

Browse files
hansendcKAGA-KOKO
authored andcommitted
generic syscalls: Wire up memory protection keys syscalls
These new syscalls are implemented as generic code, so enable them for architectures like arm64 which use the generic syscall table. According to Arnd: Even if the support is x86 specific for the forseeable future, it may be good to reserve the number just in case. The other architecture specific syscall lists are usually left to the individual arch maintainers, most a lot of the newer architectures share this table. Signed-off-by: Dave Hansen <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Cc: [email protected] Cc: Dave Hansen <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
1 parent f9afc61 commit a60f7b6

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

include/linux/syscalls.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,4 +898,12 @@ asmlinkage long sys_copy_file_range(int fd_in, loff_t __user *off_in,
898898

899899
asmlinkage long sys_mlock2(unsigned long start, size_t len, int flags);
900900

901+
asmlinkage long sys_pkey_mprotect(unsigned long start, size_t len,
902+
unsigned long prot, int pkey);
903+
asmlinkage long sys_pkey_alloc(unsigned long flags, unsigned long init_val);
904+
asmlinkage long sys_pkey_free(int pkey);
905+
//asmlinkage long sys_pkey_get(int pkey, unsigned long flags);
906+
//asmlinkage long sys_pkey_set(int pkey, unsigned long access_rights,
907+
// unsigned long flags);
908+
901909
#endif

include/uapi/asm-generic/unistd.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,9 +724,19 @@ __SYSCALL(__NR_copy_file_range, sys_copy_file_range)
724724
__SC_COMP(__NR_preadv2, sys_preadv2, compat_sys_preadv2)
725725
#define __NR_pwritev2 287
726726
__SC_COMP(__NR_pwritev2, sys_pwritev2, compat_sys_pwritev2)
727+
#define __NR_pkey_mprotect 288
728+
__SYSCALL(__NR_pkey_mprotect, sys_pkey_mprotect)
729+
#define __NR_pkey_alloc 289
730+
__SYSCALL(__NR_pkey_alloc, sys_pkey_alloc)
731+
#define __NR_pkey_free 290
732+
__SYSCALL(__NR_pkey_free, sys_pkey_free)
733+
#define __NR_pkey_get 291
734+
//__SYSCALL(__NR_pkey_get, sys_pkey_get)
735+
#define __NR_pkey_set 292
736+
//__SYSCALL(__NR_pkey_set, sys_pkey_set)
727737

728738
#undef __NR_syscalls
729-
#define __NR_syscalls 288
739+
#define __NR_syscalls 291
730740

731741
/*
732742
* All syscalls below here should go away really,

0 commit comments

Comments
 (0)