linux-stable/security/selinux
Casey Schaufler f3b8788cde LSM: Identify modules by more than name
Create a struct lsm_id to contain identifying information about Linux
Security Modules (LSMs). At inception this contains the name of the
module and an identifier associated with the security module.  Change
the security_add_hooks() interface to use this structure.  Change the
individual modules to maintain their own struct lsm_id and pass it to
security_add_hooks().

The values are for LSM identifiers are defined in a new UAPI
header file linux/lsm.h. Each existing LSM has been updated to
include it's LSMID in the lsm_id.

The LSM ID values are sequential, with the oldest module
LSM_ID_CAPABILITY being the lowest value and the existing modules
numbered in the order they were included in the main line kernel.
This is an arbitrary convention for assigning the values, but
none better presents itself. The value 0 is defined as being invalid.
The values 1-99 are reserved for any special case uses which may
arise in the future. This may include attributes of the LSM
infrastructure itself, possibly related to namespacing or network
attribute management. A special range is identified for such attributes
to help reduce confusion for developers unfamiliar with LSMs.

LSM attribute values are defined for the attributes presented by
modules that are available today. As with the LSM IDs, The value 0
is defined as being invalid. The values 1-99 are reserved for any
special case uses which may arise in the future.

Cc: linux-security-module <linux-security-module@vger.kernel.org>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Reviewed-by: Mickael Salaun <mic@digikod.net>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Nacked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
[PM: forward ported beyond v6.6 due merge window changes]
Signed-off-by: Paul Moore <paul@paul-moore.com>
2023-11-12 22:54:42 -05:00
..
include selinux: revert SECINITSID_INIT support 2023-08-09 10:51:13 -04:00
ss selinux: simplify avtab_insert_node() prototype 2023-10-03 17:07:07 -04:00
.gitignore
Kconfig selinux: improve debug configuration 2023-09-13 13:46:57 -04:00
Makefile selinux: improve debug configuration 2023-09-13 13:46:57 -04:00
avc.c selinux: update my email address 2023-07-19 11:27:02 -04:00
hooks.c LSM: Identify modules by more than name 2023-11-12 22:54:42 -05:00
ibpkey.c selinux: stop passing selinux_state pointers and their offspring 2023-03-14 15:22:45 -04:00
ima.c selinux: adjust typos in comments 2023-05-08 16:44:01 -04:00
netif.c selinux: avoid implicit conversions in the netif code 2023-07-18 18:29:48 -04:00
netlabel.c selinux: prevent KMSAN warning in selinux_inet_conn_request() 2023-08-15 18:23:22 -04:00
netlink.c selinux: mark some global variables __ro_after_init 2021-01-12 10:08:55 -05:00
netnode.c selinux: stop passing selinux_state pointers and their offspring 2023-03-14 15:22:45 -04:00
netport.c selinux: stop passing selinux_state pointers and their offspring 2023-03-14 15:22:45 -04:00
nlmsgtab.c selinux: use unsigned iterator in nlmsgtab code 2023-08-09 19:07:49 -04:00
selinuxfs.c selinux: convert to new timestamp accessors 2023-10-18 14:08:31 +02:00
status.c selinux: avoid implicit conversions regarding enforcing status 2023-07-18 18:29:50 -04:00
xfrm.c selinux: de-brand SELinux 2023-07-18 18:42:57 -04:00