aboutsummaryrefslogtreecommitdiff
path: root/sys/security/mac
diff options
context:
space:
mode:
Diffstat (limited to 'sys/security/mac')
-rw-r--r--sys/security/mac/mac_framework.h2
-rw-r--r--sys/security/mac/mac_policy.h4
-rw-r--r--sys/security/mac/mac_process.c16
-rw-r--r--sys/security/mac/mac_vfs.c16
4 files changed, 19 insertions, 19 deletions
diff --git a/sys/security/mac/mac_framework.h b/sys/security/mac/mac_framework.h
index 44ee79fb04a3..098d503b62b0 100644
--- a/sys/security/mac/mac_framework.h
+++ b/sys/security/mac/mac_framework.h
@@ -224,6 +224,7 @@ int mac_vnode_execve_will_transition(struct ucred *cred,
struct image_params *imgp);
void mac_proc_create_swapper(struct ucred *cred);
void mac_proc_create_init(struct ucred *cred);
+void mac_proc_associate_nfsd(struct ucred *cred);
void mac_thread_userret(struct thread *td);
/*
@@ -414,7 +415,6 @@ int mac_setsockopt_label(struct ucred *cred, struct socket *so,
int mac_pipe_label_set(struct ucred *cred, struct pipepair *pp,
struct label *label);
void mac_cred_mmapped_drop_perms(struct thread *td, struct ucred *cred);
-void mac_associate_nfsd_label(struct ucred *cred);
int mac_priv_check(struct ucred *cred, int priv);
int mac_priv_grant(struct ucred *cred, int priv);
diff --git a/sys/security/mac/mac_policy.h b/sys/security/mac/mac_policy.h
index 2ff8c83bc15b..a4eff3d4ea5d 100644
--- a/sys/security/mac/mac_policy.h
+++ b/sys/security/mac/mac_policy.h
@@ -607,7 +607,7 @@ typedef int (*mpo_vnode_check_unlink_t)(struct ucred *cred,
typedef int (*mpo_vnode_check_write_t)(struct ucred *active_cred,
struct ucred *file_cred, struct vnode *vp,
struct label *vplabel);
-typedef void (*mpo_associate_nfsd_label_t)(struct ucred *cred);
+typedef void (*mpo_proc_associate_nfsd_t)(struct ucred *cred);
typedef int (*mpo_priv_check_t)(struct ucred *cred, int priv);
typedef int (*mpo_priv_grant_t)(struct ucred *cred, int priv);
@@ -765,6 +765,7 @@ struct mac_policy_ops {
mpo_vnode_execve_will_transition_t mpo_vnode_execve_will_transition;
mpo_proc_create_swapper_t mpo_proc_create_swapper;
mpo_proc_create_init_t mpo_proc_create_init;
+ mpo_proc_associate_nfsd_t mpo_proc_associate_nfsd;
mpo_cred_relabel_t mpo_cred_relabel;
mpo_placeholder_t _mpo_placeholder6;
mpo_thread_userret_t mpo_thread_userret;
@@ -898,7 +899,6 @@ struct mac_policy_ops {
mpo_vnode_check_stat_t mpo_vnode_check_stat;
mpo_vnode_check_unlink_t mpo_vnode_check_unlink;
mpo_vnode_check_write_t mpo_vnode_check_write;
- mpo_associate_nfsd_label_t mpo_associate_nfsd_label;
mpo_mbuf_create_from_firewall_t mpo_mbuf_create_from_firewall;
mpo_init_syncache_label_t mpo_init_syncache_label;
mpo_destroy_syncache_label_t mpo_destroy_syncache_label;
diff --git a/sys/security/mac/mac_process.c b/sys/security/mac/mac_process.c
index c6c5cd8b5304..6ed6d9139e74 100644
--- a/sys/security/mac/mac_process.c
+++ b/sys/security/mac/mac_process.c
@@ -192,6 +192,22 @@ mac_proc_create_init(struct ucred *cred)
MAC_PERFORM(proc_create_init, cred);
}
+/*
+ * When a thread becomes an NFS server daemon, its credential may need to be
+ * updated to reflect this so that policies can recognize when file system
+ * operations originate from the network.
+ *
+ * At some point, it would be desirable if the credential used for each NFS
+ * RPC could be set based on the RPC context (i.e., source system, etc) to
+ * provide more fine-grained access control.
+ */
+void
+mac_proc_associate_nfsd(struct ucred *cred)
+{
+
+ MAC_PERFORM(proc_associate_nfsd, cred);
+}
+
void
mac_thread_userret(struct thread *td)
{
diff --git a/sys/security/mac/mac_vfs.c b/sys/security/mac/mac_vfs.c
index 85af04577f45..0f0fb9c0a1f9 100644
--- a/sys/security/mac/mac_vfs.c
+++ b/sys/security/mac/mac_vfs.c
@@ -876,19 +876,3 @@ vn_setlabel(struct vnode *vp, struct label *intlabel, struct ucred *cred)
return (0);
}
-
-/*
- * When a thread becomes an NFS server daemon, its credential may need to be
- * updated to reflect this so that policies can recognize when file system
- * operations originate from the network.
- *
- * At some point, it would be desirable if the credential used for each NFS
- * RPC could be set based on the RPC context (i.e., source system, etc) to
- * provide more fine-grained access control.
- */
-void
-mac_associate_nfsd_label(struct ucred *cred)
-{
-
- MAC_PERFORM(associate_nfsd_label, cred);
-}