Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

LSM: Record LSM name in struct lsm_info

In preparation for making LSM selections outside of the LSMs, include
the name of LSMs in struct lsm_info.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: James Morris <james.morris@microsoft.com>

authored by

Kees Cook and committed by
James Morris
07aed2f2 3d6e5f6d

+6
+1
include/linux/lsm_hooks.h
··· 2040 2040 char *lsm); 2041 2041 2042 2042 struct lsm_info { 2043 + const char *name; /* Required. */ 2043 2044 int (*init)(void); /* Required. */ 2044 2045 }; 2045 2046
+1
security/apparmor/lsm.c
··· 1607 1607 } 1608 1608 1609 1609 DEFINE_LSM(apparmor) = { 1610 + .name = "apparmor", 1610 1611 .init = apparmor_init, 1611 1612 };
+1
security/integrity/iint.c
··· 176 176 return 0; 177 177 } 178 178 DEFINE_LSM(integrity) = { 179 + .name = "integrity", 179 180 .init = integrity_iintcache_init, 180 181 }; 181 182
+1
security/selinux/hooks.c
··· 7203 7203 /* SELinux requires early initialization in order to label 7204 7204 all processes and objects when they are created. */ 7205 7205 DEFINE_LSM(selinux) = { 7206 + .name = "selinux", 7206 7207 .init = selinux_init, 7207 7208 }; 7208 7209
+1
security/smack/smack_lsm.c
··· 4883 4883 * all processes and objects when they are created. 4884 4884 */ 4885 4885 DEFINE_LSM(smack) = { 4886 + .name = "smack", 4886 4887 .init = smack_init, 4887 4888 };
+1
security/tomoyo/tomoyo.c
··· 551 551 } 552 552 553 553 DEFINE_LSM(tomoyo) = { 554 + .name = "tomoyo", 554 555 .init = tomoyo_init, 555 556 };