Skip to content

Commit a49f4f8

Browse files
l0kodJames Morris
authored andcommitted
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 <[email protected]> Cc: James Morris <[email protected]> Cc: Jann Horn <[email protected]> Cc: Kees Cook <[email protected]> Cc: Serge E. Hallyn <[email protected]> Signed-off-by: Mickaël Salaün <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: James Morris <[email protected]>
1 parent 83e804f commit a49f4f8

File tree

19 files changed

+62
-2
lines changed

19 files changed

+62
-2
lines changed

arch/alpha/kernel/syscalls/syscall.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,3 +482,6 @@
482482
550 common process_madvise sys_process_madvise
483483
551 common epoll_pwait2 sys_epoll_pwait2
484484
552 common mount_setattr sys_mount_setattr
485+
554 common landlock_create_ruleset sys_landlock_create_ruleset
486+
555 common landlock_add_rule sys_landlock_add_rule
487+
556 common landlock_restrict_self sys_landlock_restrict_self

arch/arm/tools/syscall.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,3 +456,6 @@
456456
440 common process_madvise sys_process_madvise
457457
441 common epoll_pwait2 sys_epoll_pwait2
458458
442 common mount_setattr sys_mount_setattr
459+
444 common landlock_create_ruleset sys_landlock_create_ruleset
460+
445 common landlock_add_rule sys_landlock_add_rule
461+
446 common landlock_restrict_self sys_landlock_restrict_self

arch/arm64/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)
3939
#define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800)
4040

41-
#define __NR_compat_syscalls 443
41+
#define __NR_compat_syscalls 447
4242
#endif
4343

4444
#define __ARCH_WANT_SYS_CLONE

arch/arm64/include/asm/unistd32.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,12 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise)
893893
__SYSCALL(__NR_epoll_pwait2, compat_sys_epoll_pwait2)
894894
#define __NR_mount_setattr 442
895895
__SYSCALL(__NR_mount_setattr, sys_mount_setattr)
896+
#define __NR_landlock_create_ruleset 444
897+
__SYSCALL(__NR_landlock_create_ruleset, sys_landlock_create_ruleset)
898+
#define __NR_landlock_add_rule 445
899+
__SYSCALL(__NR_landlock_add_rule, sys_landlock_add_rule)
900+
#define __NR_landlock_restrict_self 446
901+
__SYSCALL(__NR_landlock_restrict_self, sys_landlock_restrict_self)
896902

897903
/*
898904
* Please add new compat syscalls above this comment and update

arch/ia64/kernel/syscalls/syscall.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,3 +363,6 @@
363363
440 common process_madvise sys_process_madvise
364364
441 common epoll_pwait2 sys_epoll_pwait2
365365
442 common mount_setattr sys_mount_setattr
366+
444 common landlock_create_ruleset sys_landlock_create_ruleset
367+
445 common landlock_add_rule sys_landlock_add_rule
368+
446 common landlock_restrict_self sys_landlock_restrict_self

arch/m68k/kernel/syscalls/syscall.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,3 +442,6 @@
442442
440 common process_madvise sys_process_madvise
443443
441 common epoll_pwait2 sys_epoll_pwait2
444444
442 common mount_setattr sys_mount_setattr
445+
444 common landlock_create_ruleset sys_landlock_create_ruleset
446+
445 common landlock_add_rule sys_landlock_add_rule
447+
446 common landlock_restrict_self sys_landlock_restrict_self

arch/microblaze/kernel/syscalls/syscall.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,3 +448,6 @@
448448
440 common process_madvise sys_process_madvise
449449
441 common epoll_pwait2 sys_epoll_pwait2
450450
442 common mount_setattr sys_mount_setattr
451+
444 common landlock_create_ruleset sys_landlock_create_ruleset
452+
445 common landlock_add_rule sys_landlock_add_rule
453+
446 common landlock_restrict_self sys_landlock_restrict_self

arch/mips/kernel/syscalls/syscall_n32.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,3 +381,6 @@
381381
440 n32 process_madvise sys_process_madvise
382382
441 n32 epoll_pwait2 compat_sys_epoll_pwait2
383383
442 n32 mount_setattr sys_mount_setattr
384+
444 n32 landlock_create_ruleset sys_landlock_create_ruleset
385+
445 n32 landlock_add_rule sys_landlock_add_rule
386+
446 n32 landlock_restrict_self sys_landlock_restrict_self

arch/mips/kernel/syscalls/syscall_n64.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,3 +357,6 @@
357357
440 n64 process_madvise sys_process_madvise
358358
441 n64 epoll_pwait2 sys_epoll_pwait2
359359
442 n64 mount_setattr sys_mount_setattr
360+
444 n64 landlock_create_ruleset sys_landlock_create_ruleset
361+
445 n64 landlock_add_rule sys_landlock_add_rule
362+
446 n64 landlock_restrict_self sys_landlock_restrict_self

arch/mips/kernel/syscalls/syscall_o32.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,3 +430,6 @@
430430
440 o32 process_madvise sys_process_madvise
431431
441 o32 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
432432
442 o32 mount_setattr sys_mount_setattr
433+
444 o32 landlock_create_ruleset sys_landlock_create_ruleset
434+
445 o32 landlock_add_rule sys_landlock_add_rule
435+
446 o32 landlock_restrict_self sys_landlock_restrict_self

arch/parisc/kernel/syscalls/syscall.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,3 +440,6 @@
440440
440 common process_madvise sys_process_madvise
441441
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442442
442 common mount_setattr sys_mount_setattr
443+
444 common landlock_create_ruleset sys_landlock_create_ruleset
444+
445 common landlock_add_rule sys_landlock_add_rule
445+
446 common landlock_restrict_self sys_landlock_restrict_self

arch/powerpc/kernel/syscalls/syscall.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,3 +522,6 @@
522522
440 common process_madvise sys_process_madvise
523523
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
524524
442 common mount_setattr sys_mount_setattr
525+
444 common landlock_create_ruleset sys_landlock_create_ruleset
526+
445 common landlock_add_rule sys_landlock_add_rule
527+
446 common landlock_restrict_self sys_landlock_restrict_self

arch/s390/kernel/syscalls/syscall.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,3 +445,6 @@
445445
440 common process_madvise sys_process_madvise sys_process_madvise
446446
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
447447
442 common mount_setattr sys_mount_setattr sys_mount_setattr
448+
444 common landlock_create_ruleset sys_landlock_create_ruleset sys_landlock_create_ruleset
449+
445 common landlock_add_rule sys_landlock_add_rule sys_landlock_add_rule
450+
446 common landlock_restrict_self sys_landlock_restrict_self sys_landlock_restrict_self

arch/sh/kernel/syscalls/syscall.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,3 +445,6 @@
445445
440 common process_madvise sys_process_madvise
446446
441 common epoll_pwait2 sys_epoll_pwait2
447447
442 common mount_setattr sys_mount_setattr
448+
444 common landlock_create_ruleset sys_landlock_create_ruleset
449+
445 common landlock_add_rule sys_landlock_add_rule
450+
446 common landlock_restrict_self sys_landlock_restrict_self

arch/sparc/kernel/syscalls/syscall.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,3 +488,6 @@
488488
440 common process_madvise sys_process_madvise
489489
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
490490
442 common mount_setattr sys_mount_setattr
491+
444 common landlock_create_ruleset sys_landlock_create_ruleset
492+
445 common landlock_add_rule sys_landlock_add_rule
493+
446 common landlock_restrict_self sys_landlock_restrict_self

arch/x86/entry/syscalls/syscall_32.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,3 +447,6 @@
447447
440 i386 process_madvise sys_process_madvise
448448
441 i386 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
449449
442 i386 mount_setattr sys_mount_setattr
450+
444 i386 landlock_create_ruleset sys_landlock_create_ruleset
451+
445 i386 landlock_add_rule sys_landlock_add_rule
452+
446 i386 landlock_restrict_self sys_landlock_restrict_self

arch/x86/entry/syscalls/syscall_64.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,9 @@
364364
440 common process_madvise sys_process_madvise
365365
441 common epoll_pwait2 sys_epoll_pwait2
366366
442 common mount_setattr sys_mount_setattr
367+
444 common landlock_create_ruleset sys_landlock_create_ruleset
368+
445 common landlock_add_rule sys_landlock_add_rule
369+
446 common landlock_restrict_self sys_landlock_restrict_self
367370

368371
#
369372
# Due to a historical design error, certain syscalls are numbered differently

arch/xtensa/kernel/syscalls/syscall.tbl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,3 +413,6 @@
413413
440 common process_madvise sys_process_madvise
414414
441 common epoll_pwait2 sys_epoll_pwait2
415415
442 common mount_setattr sys_mount_setattr
416+
444 common landlock_create_ruleset sys_landlock_create_ruleset
417+
445 common landlock_add_rule sys_landlock_add_rule
418+
446 common landlock_restrict_self sys_landlock_restrict_self

include/uapi/asm-generic/unistd.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,9 +863,15 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise)
863863
__SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2)
864864
#define __NR_mount_setattr 442
865865
__SYSCALL(__NR_mount_setattr, sys_mount_setattr)
866+
#define __NR_landlock_create_ruleset 444
867+
__SYSCALL(__NR_landlock_create_ruleset, sys_landlock_create_ruleset)
868+
#define __NR_landlock_add_rule 445
869+
__SYSCALL(__NR_landlock_add_rule, sys_landlock_add_rule)
870+
#define __NR_landlock_restrict_self 446
871+
__SYSCALL(__NR_landlock_restrict_self, sys_landlock_restrict_self)
866872

867873
#undef __NR_syscalls
868-
#define __NR_syscalls 443
874+
#define __NR_syscalls 447
869875

870876
/*
871877
* 32 bit systems traditionally used different

0 commit comments

Comments
 (0)