Skip to content

Commit 07aed2f

Browse files
keesJames Morris
authored andcommitted
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>
1 parent 3d6e5f6 commit 07aed2f

File tree

6 files changed

+6
-0
lines changed

6 files changed

+6
-0
lines changed

include/linux/lsm_hooks.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,6 +2040,7 @@ extern void security_add_hooks(struct security_hook_list *hooks, int count,
20402040
char *lsm);
20412041

20422042
struct lsm_info {
2043+
const char *name; /* Required. */
20432044
int (*init)(void); /* Required. */
20442045
};
20452046

security/apparmor/lsm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,5 +1607,6 @@ static int __init apparmor_init(void)
16071607
}
16081608

16091609
DEFINE_LSM(apparmor) = {
1610+
.name = "apparmor",
16101611
.init = apparmor_init,
16111612
};

security/integrity/iint.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ static int __init integrity_iintcache_init(void)
176176
return 0;
177177
}
178178
DEFINE_LSM(integrity) = {
179+
.name = "integrity",
179180
.init = integrity_iintcache_init,
180181
};
181182

security/selinux/hooks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7203,6 +7203,7 @@ void selinux_complete_init(void)
72037203
/* SELinux requires early initialization in order to label
72047204
all processes and objects when they are created. */
72057205
DEFINE_LSM(selinux) = {
7206+
.name = "selinux",
72067207
.init = selinux_init,
72077208
};
72087209

security/smack/smack_lsm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4883,5 +4883,6 @@ static __init int smack_init(void)
48834883
* all processes and objects when they are created.
48844884
*/
48854885
DEFINE_LSM(smack) = {
4886+
.name = "smack",
48864887
.init = smack_init,
48874888
};

security/tomoyo/tomoyo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,5 +551,6 @@ static int __init tomoyo_init(void)
551551
}
552552

553553
DEFINE_LSM(tomoyo) = {
554+
.name = "tomoyo",
554555
.init = tomoyo_init,
555556
};

0 commit comments

Comments
 (0)