提交 a49f4f81 编写于 作者: M Mickaël Salaün 提交者: James Morris

arch: Wire up Landlock syscalls

Wire up the following system calls for all architectures:
* landlock_create_ruleset(2)
* landlock_add_rule(2)
* landlock_restrict_self(2)

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: James Morris <jmorris@namei.org>
Cc: Jann Horn <jannh@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Serge E. Hallyn <serge@hallyn.com>
Signed-off-by: NMickaël Salaün <mic@linux.microsoft.com>
Link: https://lore.kernel.org/r/20210422154123.13086-10-mic@digikod.netSigned-off-by: NJames Morris <jamorris@linux.microsoft.com>
上级 83e804f0
...@@ -482,3 +482,6 @@ ...@@ -482,3 +482,6 @@
550 common process_madvise sys_process_madvise 550 common process_madvise sys_process_madvise
551 common epoll_pwait2 sys_epoll_pwait2 551 common epoll_pwait2 sys_epoll_pwait2
552 common mount_setattr sys_mount_setattr 552 common mount_setattr sys_mount_setattr
554 common landlock_create_ruleset sys_landlock_create_ruleset
555 common landlock_add_rule sys_landlock_add_rule
556 common landlock_restrict_self sys_landlock_restrict_self
...@@ -456,3 +456,6 @@ ...@@ -456,3 +456,6 @@
440 common process_madvise sys_process_madvise 440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr 442 common mount_setattr sys_mount_setattr
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
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5) #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)
#define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800) #define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800)
#define __NR_compat_syscalls 443 #define __NR_compat_syscalls 447
#endif #endif
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
......
...@@ -893,6 +893,12 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise) ...@@ -893,6 +893,12 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise)
__SYSCALL(__NR_epoll_pwait2, compat_sys_epoll_pwait2) __SYSCALL(__NR_epoll_pwait2, compat_sys_epoll_pwait2)
#define __NR_mount_setattr 442 #define __NR_mount_setattr 442
__SYSCALL(__NR_mount_setattr, sys_mount_setattr) __SYSCALL(__NR_mount_setattr, sys_mount_setattr)
#define __NR_landlock_create_ruleset 444
__SYSCALL(__NR_landlock_create_ruleset, sys_landlock_create_ruleset)
#define __NR_landlock_add_rule 445
__SYSCALL(__NR_landlock_add_rule, sys_landlock_add_rule)
#define __NR_landlock_restrict_self 446
__SYSCALL(__NR_landlock_restrict_self, sys_landlock_restrict_self)
/* /*
* Please add new compat syscalls above this comment and update * Please add new compat syscalls above this comment and update
......
...@@ -363,3 +363,6 @@ ...@@ -363,3 +363,6 @@
440 common process_madvise sys_process_madvise 440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr 442 common mount_setattr sys_mount_setattr
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
...@@ -442,3 +442,6 @@ ...@@ -442,3 +442,6 @@
440 common process_madvise sys_process_madvise 440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr 442 common mount_setattr sys_mount_setattr
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
...@@ -448,3 +448,6 @@ ...@@ -448,3 +448,6 @@
440 common process_madvise sys_process_madvise 440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr 442 common mount_setattr sys_mount_setattr
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
...@@ -381,3 +381,6 @@ ...@@ -381,3 +381,6 @@
440 n32 process_madvise sys_process_madvise 440 n32 process_madvise sys_process_madvise
441 n32 epoll_pwait2 compat_sys_epoll_pwait2 441 n32 epoll_pwait2 compat_sys_epoll_pwait2
442 n32 mount_setattr sys_mount_setattr 442 n32 mount_setattr sys_mount_setattr
444 n32 landlock_create_ruleset sys_landlock_create_ruleset
445 n32 landlock_add_rule sys_landlock_add_rule
446 n32 landlock_restrict_self sys_landlock_restrict_self
...@@ -357,3 +357,6 @@ ...@@ -357,3 +357,6 @@
440 n64 process_madvise sys_process_madvise 440 n64 process_madvise sys_process_madvise
441 n64 epoll_pwait2 sys_epoll_pwait2 441 n64 epoll_pwait2 sys_epoll_pwait2
442 n64 mount_setattr sys_mount_setattr 442 n64 mount_setattr sys_mount_setattr
444 n64 landlock_create_ruleset sys_landlock_create_ruleset
445 n64 landlock_add_rule sys_landlock_add_rule
446 n64 landlock_restrict_self sys_landlock_restrict_self
...@@ -430,3 +430,6 @@ ...@@ -430,3 +430,6 @@
440 o32 process_madvise sys_process_madvise 440 o32 process_madvise sys_process_madvise
441 o32 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 441 o32 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 o32 mount_setattr sys_mount_setattr 442 o32 mount_setattr sys_mount_setattr
444 o32 landlock_create_ruleset sys_landlock_create_ruleset
445 o32 landlock_add_rule sys_landlock_add_rule
446 o32 landlock_restrict_self sys_landlock_restrict_self
...@@ -440,3 +440,6 @@ ...@@ -440,3 +440,6 @@
440 common process_madvise sys_process_madvise 440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr 442 common mount_setattr sys_mount_setattr
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
...@@ -522,3 +522,6 @@ ...@@ -522,3 +522,6 @@
440 common process_madvise sys_process_madvise 440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr 442 common mount_setattr sys_mount_setattr
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
...@@ -445,3 +445,6 @@ ...@@ -445,3 +445,6 @@
440 common process_madvise sys_process_madvise sys_process_madvise 440 common process_madvise sys_process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr sys_mount_setattr 442 common mount_setattr sys_mount_setattr sys_mount_setattr
444 common landlock_create_ruleset sys_landlock_create_ruleset sys_landlock_create_ruleset
445 common landlock_add_rule sys_landlock_add_rule sys_landlock_add_rule
446 common landlock_restrict_self sys_landlock_restrict_self sys_landlock_restrict_self
...@@ -445,3 +445,6 @@ ...@@ -445,3 +445,6 @@
440 common process_madvise sys_process_madvise 440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr 442 common mount_setattr sys_mount_setattr
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
...@@ -488,3 +488,6 @@ ...@@ -488,3 +488,6 @@
440 common process_madvise sys_process_madvise 440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr 442 common mount_setattr sys_mount_setattr
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,3 +447,6 @@ ...@@ -447,3 +447,6 @@
440 i386 process_madvise sys_process_madvise 440 i386 process_madvise sys_process_madvise
441 i386 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 441 i386 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 i386 mount_setattr sys_mount_setattr 442 i386 mount_setattr sys_mount_setattr
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
...@@ -364,6 +364,9 @@ ...@@ -364,6 +364,9 @@
440 common process_madvise sys_process_madvise 440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr 442 common mount_setattr sys_mount_setattr
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
# #
# Due to a historical design error, certain syscalls are numbered differently # Due to a historical design error, certain syscalls are numbered differently
......
...@@ -413,3 +413,6 @@ ...@@ -413,3 +413,6 @@
440 common process_madvise sys_process_madvise 440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr 442 common mount_setattr sys_mount_setattr
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
...@@ -863,9 +863,15 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise) ...@@ -863,9 +863,15 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise)
__SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2) __SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2)
#define __NR_mount_setattr 442 #define __NR_mount_setattr 442
__SYSCALL(__NR_mount_setattr, sys_mount_setattr) __SYSCALL(__NR_mount_setattr, sys_mount_setattr)
#define __NR_landlock_create_ruleset 444
__SYSCALL(__NR_landlock_create_ruleset, sys_landlock_create_ruleset)
#define __NR_landlock_add_rule 445
__SYSCALL(__NR_landlock_add_rule, sys_landlock_add_rule)
#define __NR_landlock_restrict_self 446
__SYSCALL(__NR_landlock_restrict_self, sys_landlock_restrict_self)
#undef __NR_syscalls #undef __NR_syscalls
#define __NR_syscalls 443 #define __NR_syscalls 447
/* /*
* 32 bit systems traditionally used different * 32 bit systems traditionally used different
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册