LSM: wireup Linux Security Module syscalls

Wireup lsm_get_self_attr, lsm_set_self_attr and lsm_list_modules
system calls.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: linux-api@vger.kernel.org
Reviewed-by: Mickaël Salaün <mic@digikod.net>
[PM: forward ported beyond v6.6 due merge window changes]
Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
Casey Schaufler 2023-09-12 13:56:51 -07:00 committed by Paul Moore
parent ad4aff9ec2
commit 5f42375904
22 changed files with 72 additions and 2 deletions

View File

@ -496,3 +496,6 @@
564 common futex_wake sys_futex_wake
565 common futex_wait sys_futex_wait
566 common futex_requeue sys_futex_requeue
567 common lsm_get_self_attr sys_lsm_get_self_attr
568 common lsm_set_self_attr sys_lsm_set_self_attr
569 common lsm_list_modules sys_lsm_list_modules

View File

@ -470,3 +470,6 @@
454 common futex_wake sys_futex_wake
455 common futex_wait sys_futex_wait
456 common futex_requeue sys_futex_requeue
457 common lsm_get_self_attr sys_lsm_get_self_attr
458 common lsm_set_self_attr sys_lsm_set_self_attr
459 common lsm_list_modules sys_lsm_list_modules

View File

@ -39,7 +39,7 @@
#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)
#define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800)
#define __NR_compat_syscalls 457
#define __NR_compat_syscalls 460
#endif
#define __ARCH_WANT_SYS_CLONE

View File

@ -919,6 +919,12 @@ __SYSCALL(__NR_futex_wake, sys_futex_wake)
__SYSCALL(__NR_futex_wait, sys_futex_wait)
#define __NR_futex_requeue 456
__SYSCALL(__NR_futex_requeue, sys_futex_requeue)
#define __NR_lsm_get_self_attr 457
__SYSCALL(__NR_lsm_get_self_attr, sys_lsm_get_self_attr)
#define __NR_lsm_set_self_attr 458
__SYSCALL(__NR_lsm_set_self_attr, sys_lsm_set_self_attr)
#define __NR_lsm_list_modules 459
__SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules)
/*
* Please add new compat syscalls above this comment and update

View File

@ -456,3 +456,6 @@
454 common futex_wake sys_futex_wake
455 common futex_wait sys_futex_wait
456 common futex_requeue sys_futex_requeue
457 common lsm_get_self_attr sys_lsm_get_self_attr
458 common lsm_set_self_attr sys_lsm_set_self_attr
459 common lsm_list_modules sys_lsm_list_modules

View File

@ -462,3 +462,6 @@
454 common futex_wake sys_futex_wake
455 common futex_wait sys_futex_wait
456 common futex_requeue sys_futex_requeue
457 common lsm_get_self_attr sys_lsm_get_self_attr
458 common lsm_set_self_attr sys_lsm_set_self_attr
459 common lsm_list_modules sys_lsm_list_modules

View File

@ -395,3 +395,6 @@
454 n32 futex_wake sys_futex_wake
455 n32 futex_wait sys_futex_wait
456 n32 futex_requeue sys_futex_requeue
457 n32 lsm_get_self_attr sys_lsm_get_self_attr
458 n32 lsm_set_self_attr sys_lsm_set_self_attr
459 n32 lsm_list_modules sys_lsm_list_modules

View File

@ -371,3 +371,6 @@
454 n64 futex_wake sys_futex_wake
455 n64 futex_wait sys_futex_wait
456 n64 futex_requeue sys_futex_requeue
457 n64 lsm_get_self_attr sys_lsm_get_self_attr
458 n64 lsm_set_self_attr sys_lsm_set_self_attr
459 n64 lsm_list_modules sys_lsm_list_modules

View File

@ -444,3 +444,6 @@
454 o32 futex_wake sys_futex_wake
455 o32 futex_wait sys_futex_wait
456 o32 futex_requeue sys_futex_requeue
457 o32 lsm_get_self_attr sys_lsm_get_self_attr
458 032 lsm_set_self_attr sys_lsm_set_self_attr
459 o32 lsm_list_modules sys_lsm_list_modules

View File

@ -455,3 +455,6 @@
454 common futex_wake sys_futex_wake
455 common futex_wait sys_futex_wait
456 common futex_requeue sys_futex_requeue
457 common lsm_get_self_attr sys_lsm_get_self_attr
458 common lsm_set_self_attr sys_lsm_set_self_attr
459 common lsm_list_modules sys_lsm_list_modules

View File

@ -543,3 +543,6 @@
454 common futex_wake sys_futex_wake
455 common futex_wait sys_futex_wait
456 common futex_requeue sys_futex_requeue
457 common lsm_get_self_attr sys_lsm_get_self_attr
458 common lsm_set_self_attr sys_lsm_set_self_attr
459 common lsm_list_modules sys_lsm_list_modules

View File

@ -459,3 +459,6 @@
454 common futex_wake sys_futex_wake sys_futex_wake
455 common futex_wait sys_futex_wait sys_futex_wait
456 common futex_requeue sys_futex_requeue sys_futex_requeue
457 common lsm_get_self_attr sys_lsm_get_self_attr sys_lsm_get_self_attr
458 common lsm_set_self_attr sys_lsm_set_self_attr sys_lsm_set_self_attr
459 common lsm_list_modules sys_lsm_list_modules sys_lsm_list_modules

View File

@ -459,3 +459,6 @@
454 common futex_wake sys_futex_wake
455 common futex_wait sys_futex_wait
456 common futex_requeue sys_futex_requeue
457 common lsm_get_self_attr sys_lsm_get_self_attr
458 common lsm_set_self_attr sys_lsm_set_self_attr
459 common lsm_list_modules sys_lsm_list_modules

View File

@ -502,3 +502,6 @@
454 common futex_wake sys_futex_wake
455 common futex_wait sys_futex_wait
456 common futex_requeue sys_futex_requeue
457 common lsm_get_self_attr sys_lsm_get_self_attr
458 common lsm_set_self_attr sys_lsm_set_self_attr
459 common lsm_list_modules sys_lsm_list_modules

View File

@ -461,3 +461,6 @@
454 i386 futex_wake sys_futex_wake
455 i386 futex_wait sys_futex_wait
456 i386 futex_requeue sys_futex_requeue
457 i386 lsm_get_self_attr sys_lsm_get_self_attr
458 i386 lsm_set_self_attr sys_lsm_set_self_attr
459 i386 lsm_list_modules sys_lsm_list_modules

View File

@ -378,6 +378,9 @@
454 common futex_wake sys_futex_wake
455 common futex_wait sys_futex_wait
456 common futex_requeue sys_futex_requeue
457 common lsm_get_self_attr sys_lsm_get_self_attr
458 common lsm_set_self_attr sys_lsm_set_self_attr
459 common lsm_list_modules sys_lsm_list_modules
#
# Due to a historical design error, certain syscalls are numbered differently

View File

@ -427,3 +427,6 @@
454 common futex_wake sys_futex_wake
455 common futex_wait sys_futex_wait
456 common futex_requeue sys_futex_requeue
457 common lsm_get_self_attr sys_lsm_get_self_attr
458 common lsm_set_self_attr sys_lsm_set_self_attr
459 common lsm_list_modules sys_lsm_list_modules

View File

@ -829,8 +829,15 @@ __SYSCALL(__NR_futex_wait, sys_futex_wait)
#define __NR_futex_requeue 456
__SYSCALL(__NR_futex_requeue, sys_futex_requeue)
#define __NR_lsm_get_self_attr 457
__SYSCALL(__NR_lsm_get_self_attr, sys_lsm_get_self_attr)
#define __NR_lsm_set_self_attr 458
__SYSCALL(__NR_lsm_set_self_attr, sys_lsm_set_self_attr)
#define __NR_lsm_list_modules 459
__SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules)
#undef __NR_syscalls
#define __NR_syscalls 457
#define __NR_syscalls 460
/*
* 32 bit systems traditionally used different

View File

@ -367,3 +367,6 @@
450 common set_mempolicy_home_node sys_set_mempolicy_home_node
451 n64 cachestat sys_cachestat
452 n64 fchmodat2 sys_fchmodat2
453 n64 lsm_get_self_attr sys_lsm_get_self_attr
454 n64 lsm_set_self_attr sys_lsm_set_self_attr
455 n64 lsm_list_modules sys_lsm_list_modules

View File

@ -539,3 +539,6 @@
450 nospu set_mempolicy_home_node sys_set_mempolicy_home_node
451 common cachestat sys_cachestat
452 common fchmodat2 sys_fchmodat2
453 common lsm_get_self_attr sys_lsm_get_self_attr
454 common lsm_set_self_attr sys_lsm_set_self_attr
455 common lsm_list_modules sys_lsm_list_modules

View File

@ -455,3 +455,6 @@
450 common set_mempolicy_home_node sys_set_mempolicy_home_node sys_set_mempolicy_home_node
451 common cachestat sys_cachestat sys_cachestat
452 common fchmodat2 sys_fchmodat2 sys_fchmodat2
453 common lsm_get_self_attr sys_lsm_get_self_attr sys_lsm_get_self_attr
454 common lsm_set_self_attr sys_lsm_set_self_attr sys_lsm_set_self_attr
455 common lsm_list_modules sys_lsm_list_modules sys_lsm_list_modules

View File

@ -375,6 +375,9 @@
451 common cachestat sys_cachestat
452 common fchmodat2 sys_fchmodat2
453 64 map_shadow_stack sys_map_shadow_stack
454 common lsm_get_self_attr sys_lsm_get_self_attr
455 common lsm_set_self_attr sys_lsm_set_self_attr
456 common lsm_list_modules sys_lsm_list_modules
#
# Due to a historical design error, certain syscalls are numbered differently