Lines Matching refs:mpc

354 mac_policy_getlabeled(struct mac_policy_conf *mpc)  in mac_policy_getlabeled()  argument
359 if (mpc->mpc_ops->mpo_ ## method != NULL) \ in mac_policy_getlabeled()
396 struct mac_policy_conf *mpc; in mac_policy_update() local
402 LIST_FOREACH(mpc, &mac_static_policy_list, mpc_list) { in mac_policy_update()
403 mac_labeled |= mac_policy_getlabeled(mpc); in mac_policy_update()
406 LIST_FOREACH(mpc, &mac_policy_list, mpc_list) { in mac_policy_update()
407 mac_labeled |= mac_policy_getlabeled(mpc); in mac_policy_update()
487 mac_policy_fastpath_register(struct mac_policy_conf *mpc) in mac_policy_fastpath_register() argument
495 ops = (uintptr_t **)mpc->mpc_ops; in mac_policy_fastpath_register()
504 mac_policy_fastpath_unregister(struct mac_policy_conf *mpc) in mac_policy_fastpath_unregister() argument
512 ops = (uintptr_t **)mpc->mpc_ops; in mac_policy_fastpath_unregister()
523 mac_policy_register(struct mac_policy_conf *mpc) in mac_policy_register() argument
544 !(mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_UNLOADOK)); in mac_policy_register()
551 if (strcmp(tmpc->mpc_name, mpc->mpc_name) == 0) { in mac_policy_register()
556 if (mpc->mpc_field_off != NULL) { in mac_policy_register()
564 *mpc->mpc_field_off = slot; in mac_policy_register()
566 mpc->mpc_runtime_flags |= MPC_RUNTIME_FLAG_REGISTERED; in mac_policy_register()
574 LIST_INSERT_HEAD(mpc_list, mpc, mpc_list); in mac_policy_register()
576 LIST_INSERT_AFTER(last_mpc, mpc, mpc_list); in mac_policy_register()
584 if (mpc->mpc_ops->mpo_init != NULL) in mac_policy_register()
585 (*(mpc->mpc_ops->mpo_init))(mpc); in mac_policy_register()
587 mac_policy_fastpath_register(mpc); in mac_policy_register()
591 SDT_PROBE1(mac, , policy, register, mpc); in mac_policy_register()
592 printf("Security policy loaded: %s (%s)\n", mpc->mpc_fullname, in mac_policy_register()
593 mpc->mpc_name); in mac_policy_register()
601 mac_policy_unregister(struct mac_policy_conf *mpc) in mac_policy_unregister() argument
609 if ((mpc->mpc_runtime_flags & MPC_RUNTIME_FLAG_REGISTERED) == 0) { in mac_policy_unregister()
617 if (mpc->mpc_field_off != NULL) { in mac_policy_unregister()
626 if ((mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_UNLOADOK) == 0) { in mac_policy_unregister()
631 mac_policy_fastpath_unregister(mpc); in mac_policy_unregister()
633 if (mpc->mpc_ops->mpo_destroy != NULL) in mac_policy_unregister()
634 (*(mpc->mpc_ops->mpo_destroy))(mpc); in mac_policy_unregister()
636 LIST_REMOVE(mpc, mpc_list); in mac_policy_unregister()
637 mpc->mpc_runtime_flags &= ~MPC_RUNTIME_FLAG_REGISTERED; in mac_policy_unregister()
641 SDT_PROBE1(mac, , policy, unregister, mpc); in mac_policy_unregister()
642 printf("Security policy unload: %s (%s)\n", mpc->mpc_fullname, in mac_policy_unregister()
643 mpc->mpc_name); in mac_policy_unregister()
654 struct mac_policy_conf *mpc; in mac_policy_modevent() local
658 mpc = (struct mac_policy_conf *) data; in mac_policy_modevent()
667 SDT_PROBE2(mac, , policy, modevent, type, mpc); in mac_policy_modevent()
670 if (mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_NOTLATE && in mac_policy_modevent()
673 "after booting\n", mpc->mpc_name); in mac_policy_modevent()
677 error = mac_policy_register(mpc); in mac_policy_modevent()
681 if ((mpc->mpc_runtime_flags & MPC_RUNTIME_FLAG_REGISTERED) in mac_policy_modevent()
683 error = mac_policy_unregister(mpc); in mac_policy_modevent()