]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
lsm: rename exists_ordered_lsm() to lsm_order_exists()
authorPaul Moore <paul@paul-moore.com>
Sun, 13 Jul 2025 21:37:56 +0000 (17:37 -0400)
committerPaul Moore <paul@paul-moore.com>
Wed, 22 Oct 2025 23:24:20 +0000 (19:24 -0400)
Also add a header comment block to the function.

Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: John Johansen <john.johhansen@canonical.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/lsm_init.c

index 9bfc35b44b63a5a9bf308ec1268e76d15658b1bf..4b66a8cfe8eb3e138b9f0ee1baf2bc8bb6ffcea6 100644 (file)
@@ -108,8 +108,11 @@ static inline bool lsm_is_enabled(struct lsm_info *lsm)
        return (lsm->enabled ? *lsm->enabled : false);
 }
 
-/* Is an LSM already listed in the ordered LSMs list? */
-static bool __init exists_ordered_lsm(struct lsm_info *lsm)
+/**
+ * lsm_order_exists - Determine if a LSM exists in the ordered list
+ * @lsm: LSM definition
+ */
+static bool __init lsm_order_exists(struct lsm_info *lsm)
 {
        struct lsm_info **check;
 
@@ -126,7 +129,7 @@ static int last_lsm __initdata;
 static void __init append_ordered_lsm(struct lsm_info *lsm, const char *from)
 {
        /* Ignore duplicate selections. */
-       if (exists_ordered_lsm(lsm))
+       if (lsm_order_exists(lsm))
                return;
 
        if (WARN(last_lsm == MAX_LSM_COUNT, "%s: out of LSM static calls!?\n", from))
@@ -269,7 +272,7 @@ static void __init ordered_lsm_parse(const char *order, const char *origin)
        /* Process "security=", if given. */
        if (lsm_order_legacy) {
                lsm_for_each_raw(lsm) {
-                       if (exists_ordered_lsm(lsm))
+                       if (lsm_order_exists(lsm))
                                continue;
                        if (strcmp(lsm->id->name, lsm_order_legacy) == 0)
                                append_ordered_lsm(lsm, "security=");
@@ -284,7 +287,7 @@ static void __init ordered_lsm_parse(const char *order, const char *origin)
 
        /* Disable all LSMs not in the ordered list. */
        lsm_for_each_raw(lsm) {
-               if (exists_ordered_lsm(lsm))
+               if (lsm_order_exists(lsm))
                        continue;
                lsm_enabled_set(lsm, false);
                init_debug("%s skipped: %s (not in requested order)\n",