The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=61ffc1bf8c4288c18d0ef86877e2558fa7ae3e13

commit 61ffc1bf8c4288c18d0ef86877e2558fa7ae3e13
Author:     John Baldwin <[email protected]>
AuthorDate: 2025-12-04 19:52:59 +0000
Commit:     John Baldwin <[email protected]>
CommitDate: 2025-12-04 19:52:59 +0000

    MAC: Rename mac_cred_create_swapper to mac_cred_create_kproc0
    
    Reported by:    markj
    Reviewed by:    olce
    Differential Revision:  https://reviews.freebsd.org/D54052
---
 sys/kern/init_main.c                       | 2 +-
 sys/security/mac/mac_cred.c                | 4 ++--
 sys/security/mac/mac_framework.h           | 2 +-
 sys/security/mac/mac_policy.h              | 4 ++--
 sys/security/mac_biba/mac_biba.c           | 4 ++--
 sys/security/mac_lomac/mac_lomac.c         | 4 ++--
 sys/security/mac_mls/mac_mls.c             | 4 ++--
 sys/security/mac_partition/mac_partition.c | 4 ++--
 sys/security/mac_stub/mac_stub.c           | 4 ++--
 sys/security/mac_test/mac_test.c           | 8 ++++----
 10 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index a2898f75a795..3075b2224963 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -560,7 +560,7 @@ proc0_init(void *dummy __unused)
        audit_cred_kproc0(newcred);
 #endif
 #ifdef MAC
-       mac_cred_create_swapper(newcred);
+       mac_cred_create_kproc0(newcred);
 #endif
        /* Create sigacts. */
        p->p_sigacts = sigacts_alloc();
diff --git a/sys/security/mac/mac_cred.c b/sys/security/mac/mac_cred.c
index 5066de277176..b1239c3e7c65 100644
--- a/sys/security/mac/mac_cred.c
+++ b/sys/security/mac/mac_cred.c
@@ -132,10 +132,10 @@ mac_cred_associate_nfsd(struct ucred *cred)
  * processes and threads are spawned.
  */
 void
-mac_cred_create_swapper(struct ucred *cred)
+mac_cred_create_kproc0(struct ucred *cred)
 {
 
-       MAC_POLICY_PERFORM_NOSLEEP(cred_create_swapper, cred);
+       MAC_POLICY_PERFORM_NOSLEEP(cred_create_kproc0, cred);
 }
 
 /*
diff --git a/sys/security/mac/mac_framework.h b/sys/security/mac/mac_framework.h
index af827c33ee58..1233cd30f211 100644
--- a/sys/security/mac/mac_framework.h
+++ b/sys/security/mac/mac_framework.h
@@ -134,7 +134,7 @@ int mac_cred_check_setuid(struct ucred *cred, uid_t uid);
 int    mac_cred_check_visible(struct ucred *cr1, struct ucred *cr2);
 void   mac_cred_copy(struct ucred *cr1, struct ucred *cr2);
 void   mac_cred_create_init(struct ucred *cred);
-void   mac_cred_create_swapper(struct ucred *cred);
+void   mac_cred_create_kproc0(struct ucred *cred);
 void   mac_cred_destroy(struct ucred *);
 void   mac_cred_init(struct ucred *);
 
diff --git a/sys/security/mac/mac_policy.h b/sys/security/mac/mac_policy.h
index 66e489060804..f0a1f0863c96 100644
--- a/sys/security/mac/mac_policy.h
+++ b/sys/security/mac/mac_policy.h
@@ -167,7 +167,7 @@ typedef int (*mpo_cred_check_visible_t)(struct ucred *cr1,
 typedef void   (*mpo_cred_copy_label_t)(struct label *src,
                    struct label *dest);
 typedef void   (*mpo_cred_create_init_t)(struct ucred *cred);
-typedef void   (*mpo_cred_create_swapper_t)(struct ucred *cred);
+typedef void   (*mpo_cred_create_kproc0_t)(struct ucred *cred);
 typedef void   (*mpo_cred_destroy_label_t)(struct label *label);
 typedef int    (*mpo_cred_externalize_label_t)(struct label *label,
                    char *element_name, struct sbuf *sb, int *claimed);
@@ -738,7 +738,7 @@ struct mac_policy_ops {
        mpo_cred_check_setresgid_t              mpo_cred_check_setresgid;
        mpo_cred_check_visible_t                mpo_cred_check_visible;
        mpo_cred_copy_label_t                   mpo_cred_copy_label;
-       mpo_cred_create_swapper_t               mpo_cred_create_swapper;
+       mpo_cred_create_kproc0_t                mpo_cred_create_kproc0;
        mpo_cred_create_init_t                  mpo_cred_create_init;
        mpo_cred_destroy_label_t                mpo_cred_destroy_label;
        mpo_cred_externalize_label_t            mpo_cred_externalize_label;
diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c
index aac7a0545ab8..a3304e761423 100644
--- a/sys/security/mac_biba/mac_biba.c
+++ b/sys/security/mac_biba/mac_biba.c
@@ -912,7 +912,7 @@ biba_cred_create_init(struct ucred *cred)
 }
 
 static void
-biba_cred_create_swapper(struct ucred *cred)
+biba_cred_create_kproc0(struct ucred *cred)
 {
        struct mac_biba *dest;
 
@@ -3574,7 +3574,7 @@ static struct mac_policy_ops mac_biba_ops =
        .mpo_cred_check_visible = biba_cred_check_visible,
        .mpo_cred_copy_label = biba_copy_label,
        .mpo_cred_create_init = biba_cred_create_init,
-       .mpo_cred_create_swapper = biba_cred_create_swapper,
+       .mpo_cred_create_kproc0 = biba_cred_create_kproc0,
        .mpo_cred_destroy_label = biba_destroy_label,
        .mpo_cred_externalize_label = biba_externalize_label,
        .mpo_cred_init_label = biba_init_label,
diff --git a/sys/security/mac_lomac/mac_lomac.c 
b/sys/security/mac_lomac/mac_lomac.c
index 23a996469bc0..8b0473151690 100644
--- a/sys/security/mac_lomac/mac_lomac.c
+++ b/sys/security/mac_lomac/mac_lomac.c
@@ -1008,7 +1008,7 @@ lomac_cred_create_init(struct ucred *cred)
 }
 
 static void
-lomac_cred_create_swapper(struct ucred *cred)
+lomac_cred_create_kproc0(struct ucred *cred)
 {
        struct mac_lomac *dest;
 
@@ -2910,7 +2910,7 @@ static struct mac_policy_ops lomac_ops =
        .mpo_cred_check_relabel = lomac_cred_check_relabel,
        .mpo_cred_check_visible = lomac_cred_check_visible,
        .mpo_cred_copy_label = lomac_copy_label,
-       .mpo_cred_create_swapper = lomac_cred_create_swapper,
+       .mpo_cred_create_kproc0 = lomac_cred_create_kproc0,
        .mpo_cred_create_init = lomac_cred_create_init,
        .mpo_cred_destroy_label = lomac_destroy_label,
        .mpo_cred_externalize_label = lomac_externalize_label,
diff --git a/sys/security/mac_mls/mac_mls.c b/sys/security/mac_mls/mac_mls.c
index 54a32b6d564d..fa6643038326 100644
--- a/sys/security/mac_mls/mac_mls.c
+++ b/sys/security/mac_mls/mac_mls.c
@@ -875,7 +875,7 @@ mls_cred_create_init(struct ucred *cred)
 }
 
 static void
-mls_cred_create_swapper(struct ucred *cred)
+mls_cred_create_kproc0(struct ucred *cred)
 {
        struct mac_mls *dest;
 
@@ -3203,7 +3203,7 @@ static struct mac_policy_ops mls_ops =
        .mpo_cred_check_visible = mls_cred_check_visible,
        .mpo_cred_copy_label = mls_copy_label,
        .mpo_cred_create_init = mls_cred_create_init,
-       .mpo_cred_create_swapper = mls_cred_create_swapper,
+       .mpo_cred_create_kproc0 = mls_cred_create_kproc0,
        .mpo_cred_destroy_label = mls_destroy_label,
        .mpo_cred_externalize_label = mls_externalize_label,
        .mpo_cred_init_label = mls_init_label,
diff --git a/sys/security/mac_partition/mac_partition.c 
b/sys/security/mac_partition/mac_partition.c
index 2f0189b79ace..7c51f951be31 100644
--- a/sys/security/mac_partition/mac_partition.c
+++ b/sys/security/mac_partition/mac_partition.c
@@ -159,7 +159,7 @@ partition_cred_create_init(struct ucred *cred)
 }
 
 static void
-partition_cred_create_swapper(struct ucred *cred)
+partition_cred_create_kproc0(struct ucred *cred)
 {
 
        SLOT_SET(cred->cr_label, 0);
@@ -298,7 +298,7 @@ static struct mac_policy_ops partition_ops =
        .mpo_cred_check_visible = partition_cred_check_visible,
        .mpo_cred_copy_label = partition_cred_copy_label,
        .mpo_cred_create_init = partition_cred_create_init,
-       .mpo_cred_create_swapper = partition_cred_create_swapper,
+       .mpo_cred_create_kproc0 = partition_cred_create_kproc0,
        .mpo_cred_destroy_label = partition_cred_destroy_label,
        .mpo_cred_externalize_label = partition_cred_externalize_label,
        .mpo_cred_init_label = partition_cred_init_label,
diff --git a/sys/security/mac_stub/mac_stub.c b/sys/security/mac_stub/mac_stub.c
index a3b0dd01a76b..ac5d5b58e5db 100644
--- a/sys/security/mac_stub/mac_stub.c
+++ b/sys/security/mac_stub/mac_stub.c
@@ -319,7 +319,7 @@ stub_cred_create_init(struct ucred *cred)
 }
 
 static void
-stub_cred_create_swapper(struct ucred *cred)
+stub_cred_create_kproc0(struct ucred *cred)
 {
 
 }
@@ -1720,7 +1720,7 @@ static struct mac_policy_ops stub_ops =
        .mpo_cred_check_visible = stub_cred_check_visible,
        .mpo_cred_copy_label = stub_copy_label,
        .mpo_cred_create_init = stub_cred_create_init,
-       .mpo_cred_create_swapper = stub_cred_create_swapper,
+       .mpo_cred_create_kproc0 = stub_cred_create_kproc0,
        .mpo_cred_destroy_label = stub_destroy_label,
        .mpo_cred_externalize_label = stub_externalize_label,
        .mpo_cred_init_label = stub_init_label,
diff --git a/sys/security/mac_test/mac_test.c b/sys/security/mac_test/mac_test.c
index 890b8328055e..c447eeef010d 100644
--- a/sys/security/mac_test/mac_test.c
+++ b/sys/security/mac_test/mac_test.c
@@ -416,13 +416,13 @@ test_cred_create_init(struct ucred *cred)
        COUNTER_INC(cred_create_init);
 }
 
-COUNTER_DECL(cred_create_swapper);
+COUNTER_DECL(cred_create_kproc0);
 static void
-test_cred_create_swapper(struct ucred *cred)
+test_cred_create_kproc0(struct ucred *cred)
 {
 
        LABEL_CHECK(cred->cr_label, MAGIC_CRED);
-       COUNTER_INC(cred_create_swapper);
+       COUNTER_INC(cred_create_kproc0);
 }
 
 COUNTER_DECL(cred_destroy_label);
@@ -3074,7 +3074,7 @@ static struct mac_policy_ops test_ops =
        .mpo_cred_check_visible = test_cred_check_visible,
        .mpo_cred_copy_label = test_cred_copy_label,
        .mpo_cred_create_init = test_cred_create_init,
-       .mpo_cred_create_swapper = test_cred_create_swapper,
+       .mpo_cred_create_kproc0 = test_cred_create_kproc0,
        .mpo_cred_destroy_label = test_cred_destroy_label,
        .mpo_cred_externalize_label = test_cred_externalize_label,
        .mpo_cred_init_label = test_cred_init_label,

Reply via email to