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: Kees Cook <keescook@chromium.org>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: John Johansen <john.johansen@canonical.com>
 extern void security_add_hooks(struct security_hook_list *hooks, int count,
                                char *lsm);
 
+#define LSM_FLAG_LEGACY_MAJOR  BIT(0)
+
 struct lsm_info {
        const char *name;       /* Required. */
+       unsigned long flags;    /* Optional: flags describing LSM */
        int (*init)(void);      /* Required. */
 };
 
 
 
 DEFINE_LSM(apparmor) = {
        .name = "apparmor",
+       .flags = LSM_FLAG_LEGACY_MAJOR,
        .init = apparmor_init,
 };
 
    all processes and objects when they are created. */
 DEFINE_LSM(selinux) = {
        .name = "selinux",
+       .flags = LSM_FLAG_LEGACY_MAJOR,
        .init = selinux_init,
 };
 
 
  */
 DEFINE_LSM(smack) = {
        .name = "smack",
+       .flags = LSM_FLAG_LEGACY_MAJOR,
        .init = smack_init,
 };
 
 
 DEFINE_LSM(tomoyo) = {
        .name = "tomoyo",
+       .flags = LSM_FLAG_LEGACY_MAJOR,
        .init = tomoyo_init,
 };