]> Gentwo Git Trees - linux/.git/commit
lsm: replace the name field with a pointer to the lsm_id struct
authorPaul Moore <paul@paul-moore.com>
Wed, 12 Feb 2025 19:45:06 +0000 (14:45 -0500)
committerPaul Moore <paul@paul-moore.com>
Wed, 22 Oct 2025 23:24:18 +0000 (19:24 -0400)
commit9f9dc69e06ecbc61e7a50b823b82a78daf130dc0
treead4279cddfd5f5b196c63340b0c6e0d0f1fb849e
parentfaabedcd6e88ca1f65ef45d711d2e0c7288fd551
lsm: replace the name field with a pointer to the lsm_id struct

Reduce the duplication between the lsm_id struct and the DEFINE_LSM()
definition by linking the lsm_id struct directly into the individual
LSM's DEFINE_LSM() instance.

Linking the lsm_id into the LSM definition also allows us to simplify
the security_add_hooks() function by removing the code which populates
the lsm_idlist[] array and moving it into the normal LSM startup code
where the LSM list is parsed and the individual LSMs are enabled,
making for a cleaner implementation with less overhead at boot.

Reviewed-by: Kees Cook <kees@kernel.org>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
16 files changed:
include/linux/lsm_hooks.h
security/apparmor/lsm.c
security/bpf/hooks.c
security/commoncap.c
security/integrity/evm/evm_main.c
security/integrity/ima/ima_main.c
security/ipe/ipe.c
security/landlock/setup.c
security/loadpin/loadpin.c
security/lockdown/lockdown.c
security/lsm_init.c
security/safesetid/lsm.c
security/selinux/hooks.c
security/smack/smack_lsm.c
security/tomoyo/tomoyo.c
security/yama/yama_lsm.c