Commit 47008e51 authored by Kees Cook's avatar Kees Cook

LSM: Introduce LSM_FLAG_LEGACY_MAJOR

This adds a flag for the current "major" LSMs to distinguish them when
we have a universal method for ordering all LSMs. It's called "legacy"
since the distinction of "major" will go away in the blob-sharing world.
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
Reviewed-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent bfeffd15
...@@ -2042,8 +2042,11 @@ extern char *lsm_names; ...@@ -2042,8 +2042,11 @@ extern char *lsm_names;
extern void security_add_hooks(struct security_hook_list *hooks, int count, extern void security_add_hooks(struct security_hook_list *hooks, int count,
char *lsm); char *lsm);
#define LSM_FLAG_LEGACY_MAJOR BIT(0)
struct lsm_info { struct lsm_info {
const char *name; /* Required. */ const char *name; /* Required. */
unsigned long flags; /* Optional: flags describing LSM */
int (*init)(void); /* Required. */ int (*init)(void); /* Required. */
}; };
......
...@@ -1729,5 +1729,6 @@ static int __init apparmor_init(void) ...@@ -1729,5 +1729,6 @@ static int __init apparmor_init(void)
DEFINE_LSM(apparmor) = { DEFINE_LSM(apparmor) = {
.name = "apparmor", .name = "apparmor",
.flags = LSM_FLAG_LEGACY_MAJOR,
.init = apparmor_init, .init = apparmor_init,
}; };
...@@ -6999,6 +6999,7 @@ void selinux_complete_init(void) ...@@ -6999,6 +6999,7 @@ void selinux_complete_init(void)
all processes and objects when they are created. */ all processes and objects when they are created. */
DEFINE_LSM(selinux) = { DEFINE_LSM(selinux) = {
.name = "selinux", .name = "selinux",
.flags = LSM_FLAG_LEGACY_MAJOR,
.init = selinux_init, .init = selinux_init,
}; };
......
...@@ -4812,5 +4812,6 @@ static __init int smack_init(void) ...@@ -4812,5 +4812,6 @@ static __init int smack_init(void)
*/ */
DEFINE_LSM(smack) = { DEFINE_LSM(smack) = {
.name = "smack", .name = "smack",
.flags = LSM_FLAG_LEGACY_MAJOR,
.init = smack_init, .init = smack_init,
}; };
...@@ -552,5 +552,6 @@ static int __init tomoyo_init(void) ...@@ -552,5 +552,6 @@ static int __init tomoyo_init(void)
DEFINE_LSM(tomoyo) = { DEFINE_LSM(tomoyo) = {
.name = "tomoyo", .name = "tomoyo",
.flags = LSM_FLAG_LEGACY_MAJOR,
.init = tomoyo_init, .init = tomoyo_init,
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment