Commit 07aed2f2 authored by Kees Cook's avatar Kees Cook Committed by James Morris
Browse files

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: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
Signed-off-by: default avatarJames Morris <james.morris@microsoft.com>
parent 3d6e5f6d
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -2040,6 +2040,7 @@ extern void security_add_hooks(struct security_hook_list *hooks, int count,
				char *lsm);
				char *lsm);


struct lsm_info {
struct lsm_info {
	const char *name;	/* Required. */
	int (*init)(void);	/* Required. */
	int (*init)(void);	/* Required. */
};
};


+1 −0
Original line number Original line Diff line number Diff line
@@ -1607,5 +1607,6 @@ alloc_out:
}
}


DEFINE_LSM(apparmor) = {
DEFINE_LSM(apparmor) = {
	.name = "apparmor",
	.init = apparmor_init,
	.init = apparmor_init,
};
};
+1 −0
Original line number Original line Diff line number Diff line
@@ -176,6 +176,7 @@ static int __init integrity_iintcache_init(void)
	return 0;
	return 0;
}
}
DEFINE_LSM(integrity) = {
DEFINE_LSM(integrity) = {
	.name = "integrity",
	.init = integrity_iintcache_init,
	.init = integrity_iintcache_init,
};
};


+1 −0
Original line number Original line Diff line number Diff line
@@ -7203,6 +7203,7 @@ void selinux_complete_init(void)
/* SELinux requires early initialization in order to label
/* SELinux requires early initialization in order to label
   all processes and objects when they are created. */
   all processes and objects when they are created. */
DEFINE_LSM(selinux) = {
DEFINE_LSM(selinux) = {
	.name = "selinux",
	.init = selinux_init,
	.init = selinux_init,
};
};


+1 −0
Original line number Original line Diff line number Diff line
@@ -4883,5 +4883,6 @@ static __init int smack_init(void)
 * all processes and objects when they are created.
 * all processes and objects when they are created.
 */
 */
DEFINE_LSM(smack) = {
DEFINE_LSM(smack) = {
	.name = "smack",
	.init = smack_init,
	.init = smack_init,
};
};
Loading