Lines Matching refs:mpc
542 struct mac_policy_conf *mpc;
563 mpc = mac_get_mpc(i);
564 if ((mpc != NULL) && (mpc->mpc_ops->mpo_policy_initbsd != NULL))
565 (*(mpc->mpc_ops->mpo_policy_initbsd))(mpc);
583 struct mac_policy_conf *mpc;
587 mpc = mac_get_mpc(handle);
589 if (mpc->mpc_labelnames == NULL)
592 if (mpc->mpc_labelname_count == 0)
607 mpc->mpc_labelname_count, M_MACTEMP, M_WAITOK | M_ZERO);
608 for (idx = 0; idx < mpc->mpc_labelname_count; idx++)
615 mpc->mpc_labelname_count, M_MACTEMP, M_WAITOK);
616 for (idx = 0; idx < mpc->mpc_labelname_count; idx++)
623 for (idx = 0; idx < mpc->mpc_labelname_count; idx++) {
625 if (*(name = mpc->mpc_labelnames[idx]) == '?')
647 strlcpy(mle->mle_name, mpc->mpc_labelnames[idx],
663 for (idx = mle_free; idx < mpc->mpc_labelname_count; idx++)
666 for (idx = mll_free; idx < mpc->mpc_labelname_count; idx++)
684 struct mac_policy_conf *mpc;
686 mpc = mac_get_mpc(handle);
688 if (mpc->mpc_labelnames == NULL)
691 if (mpc->mpc_labelname_count == 0)
783 mac_policy_register(struct mac_policy_conf *mpc, mac_policy_handle_t *handlep,
794 if (mpc->mpc_name == NULL)
797 if (mpc->mpc_fullname == NULL)
800 if (mpc->mpc_labelname_count > MAC_MAX_MANAGED_NAMESPACES)
803 if (mpc->mpc_ops == NULL)
809 if (mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_NOTLATE) {
811 mpc->mpc_name);
845 if (mac_policy_list.entries[i].mpc == NULL)
848 if (strcmp(mac_policy_list.entries[i].mpc->mpc_name,
849 mpc->mpc_name) == 0) {
855 if (mpc->mpc_field_off != NULL) {
863 *mpc->mpc_field_off = slot;
865 mpc->mpc_runtime_flags |= MPC_RUNTIME_FLAG_REGISTERED;
871 mpc->mpc_data = (void *)kalloc(mmd->size);
872 if (mpc->mpc_data != NULL) {
873 memcpy(mpc->mpc_data, mmd, mmd->size);
876 mac_policy_fixup_mmd_list(mpc->mpc_data);
882 if (mac_policy_list.entries[i].mpc == NULL) {
897 ((mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_UNLOADOK) == 0 &&
903 mac_policy_list.entries[*handlep].mpc = mpc;
911 printf ("calling mpo_policy_init for %s\n", mpc->mpc_name);
912 if (mpc->mpc_ops->mpo_policy_init != NULL)
913 (*(mpc->mpc_ops->mpo_policy_init))(mpc);
915 if (mac_late && mpc->mpc_ops->mpo_policy_initbsd != NULL) {
916 printf ("calling mpo_policy_initbsd for %s\n", mpc->mpc_name);
917 (*(mpc->mpc_ops->mpo_policy_initbsd))(mpc);
927 printf("Security policy loaded: %s (%s)\n", mpc->mpc_fullname,
928 mpc->mpc_name);
942 struct mac_policy_conf *mpc;
950 mpc = mac_get_mpc(handle);
951 if ((mpc->mpc_runtime_flags & MPC_RUNTIME_FLAG_REGISTERED) == 0) {
960 if (mpc->mpc_field_off != NULL) {
969 if ((mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_UNLOADOK) == 0) {
985 if (mpc->mpc_field_off != NULL) {
986 mac_slot_offsets_free |= (1 << *mpc->mpc_field_off);
989 if (mpc->mpc_ops->mpo_policy_destroy != NULL)
990 (*(mpc->mpc_ops->mpo_policy_destroy))(mpc);
992 mpc->mpc_runtime_flags &= ~MPC_RUNTIME_FLAG_REGISTERED;
997 if (mpc->mpc_data) {
998 struct mac_module_data *mmd = mpc->mpc_data;
1000 mpc->mpc_data = NULL;
1003 printf("Security policy unload: %s (%s)\n", mpc->mpc_fullname,
1004 mpc->mpc_name);
1104 struct mac_policy_conf *mpc;
1133 mpc = mac_policy_list.entries[mll->mll_handle].mpc;
1134 if (mpc == NULL)
1137 ((char *)mpc->mpc_ops + mpo_externalize_off);
1214 struct mac_policy_conf *mpc;
1231 mpc = mac_policy_list.entries[mll->mll_handle].mpc;
1232 if (mpc == NULL)
1235 ((char *)mpc->mpc_ops + mpo_internalize_off);
2021 struct mac_policy_conf *mpc;
2036 mpc = mac_policy_list.entries[i].mpc;
2037 if (mpc == NULL)
2040 if (strcmp(mpc->mpc_name, target) == 0 &&
2041 mpc->mpc_ops->mpo_policy_syscall != NULL) {
2042 error = mpc->mpc_ops->mpo_policy_syscall(p,
2049 mpc = mac_policy_list.entries[i].mpc;
2050 if (mpc == NULL)
2053 if (strcmp(mpc->mpc_name, target) == 0 &&
2054 mpc->mpc_ops->mpo_policy_syscall != NULL) {
2055 error = mpc->mpc_ops->mpo_policy_syscall(p,
2136 mac_policy_register(struct mac_policy_conf *mpc __unused,