]> Git Repo - linux.git/commitdiff
arch, mm: wire up memfd_secret system call where relevant
authorMike Rapoport <[email protected]>
Thu, 8 Jul 2021 01:08:11 +0000 (18:08 -0700)
committerLinus Torvalds <[email protected]>
Thu, 8 Jul 2021 18:48:21 +0000 (11:48 -0700)
Wire up memfd_secret system call on architectures that define
ARCH_HAS_SET_DIRECT_MAP, namely arm64, risc-v and x86.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Mike Rapoport <[email protected]>
Acked-by: Palmer Dabbelt <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Acked-by: Catalin Marinas <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Acked-by: James Bottomley <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Christopher Lameter <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Elena Reshetova <[email protected]>
Cc: Hagen Paul Pfeifer <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: "Kirill A. Shutemov" <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Michael Kerrisk <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rick Edgecombe <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: Shakeel Butt <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Tycho Andersen <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: kernel test robot <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
arch/arm64/include/uapi/asm/unistd.h
arch/riscv/include/asm/unistd.h
arch/x86/entry/syscalls/syscall_32.tbl
arch/x86/entry/syscalls/syscall_64.tbl
include/linux/syscalls.h
include/uapi/asm-generic/unistd.h
scripts/checksyscalls.sh

index f83a70e07df85ca5029a1e91cde93b8e0dd9fb7e..ce2ee8f1e361091e462cd658257709bf09fc9c84 100644 (file)
@@ -20,5 +20,6 @@
 #define __ARCH_WANT_SET_GET_RLIMIT
 #define __ARCH_WANT_TIME32_SYSCALLS
 #define __ARCH_WANT_SYS_CLONE3
+#define __ARCH_WANT_MEMFD_SECRET
 
 #include <asm-generic/unistd.h>
index 977ee6181dabf4801725767e55af92336915a3f5..6c316093a1e59457b0e03d5493cc02a65b50801c 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #define __ARCH_WANT_SYS_CLONE
+#define __ARCH_WANT_MEMFD_SECRET
 
 #include <uapi/asm/unistd.h>
 
index fba2f615119a26d29b96777e4c1da84faf85caea..ce763a12311cc603455328d1f71852e0b7a948b9 100644 (file)
 444    i386    landlock_create_ruleset sys_landlock_create_ruleset
 445    i386    landlock_add_rule       sys_landlock_add_rule
 446    i386    landlock_restrict_self  sys_landlock_restrict_self
+447    i386    memfd_secret            sys_memfd_secret
index af973e400053de3fdc9b3cfa765b2be2b99cff8c..f6b57799c1ea2db1552baacb7f9ff3f0a6cd80d0 100644 (file)
 444    common  landlock_create_ruleset sys_landlock_create_ruleset
 445    common  landlock_add_rule       sys_landlock_add_rule
 446    common  landlock_restrict_self  sys_landlock_restrict_self
+447    common  memfd_secret            sys_memfd_secret
 
 #
 # Due to a historical design error, certain syscalls are numbered differently
index 586128d5c3b86326b2761a6e33e082aa862905a7..69c9a7010081b39e41659e3f6280528be0792ca9 100644 (file)
@@ -1050,6 +1050,7 @@ asmlinkage long sys_landlock_create_ruleset(const struct landlock_ruleset_attr _
 asmlinkage long sys_landlock_add_rule(int ruleset_fd, enum landlock_rule_type rule_type,
                const void __user *rule_attr, __u32 flags);
 asmlinkage long sys_landlock_restrict_self(int ruleset_fd, __u32 flags);
+asmlinkage long sys_memfd_secret(unsigned int flags);
 
 /*
  * Architecture-specific system calls
index f211961ce1da69ac38995531e22a411238be5233..a9d6fcd95f42aa2623a541dc950edd23172aefed 100644 (file)
@@ -873,8 +873,13 @@ __SYSCALL(__NR_landlock_add_rule, sys_landlock_add_rule)
 #define __NR_landlock_restrict_self 446
 __SYSCALL(__NR_landlock_restrict_self, sys_landlock_restrict_self)
 
+#ifdef __ARCH_WANT_MEMFD_SECRET
+#define __NR_memfd_secret 447
+__SYSCALL(__NR_memfd_secret, sys_memfd_secret)
+#endif
+
 #undef __NR_syscalls
-#define __NR_syscalls 447
+#define __NR_syscalls 448
 
 /*
  * 32 bit systems traditionally used different
index a18b47695f55f1521569884c56ba6864558a1e4c..b7609958ee3640b53f025f0010366b6f24958e0c 100755 (executable)
@@ -40,6 +40,10 @@ cat << EOF
 #define __IGNORE_setrlimit     /* setrlimit */
 #endif
 
+#ifndef __ARCH_WANT_MEMFD_SECRET
+#define __IGNORE_memfd_secret
+#endif
+
 /* Missing flags argument */
 #define __IGNORE_renameat      /* renameat2 */
 
This page took 0.109228 seconds and 4 git commands to generate.