Lines Matching refs:mpc

349 mac_policy_getlabeled(struct mac_policy_conf *mpc)  in mac_policy_getlabeled()  argument
354 if (mpc->mpc_ops->mpo_ ## method != NULL) \ in mac_policy_getlabeled()
391 struct mac_policy_conf *mpc; in mac_policy_update() local
397 LIST_FOREACH(mpc, &mac_static_policy_list, mpc_list) { in mac_policy_update()
398 mac_labeled |= mac_policy_getlabeled(mpc); in mac_policy_update()
401 LIST_FOREACH(mpc, &mac_policy_list, mpc_list) { in mac_policy_update()
402 mac_labeled |= mac_policy_getlabeled(mpc); in mac_policy_update()
482 mac_policy_fastpath_register(struct mac_policy_conf *mpc) in mac_policy_fastpath_register() argument
490 ops = (uintptr_t **)mpc->mpc_ops; in mac_policy_fastpath_register()
499 mac_policy_fastpath_unregister(struct mac_policy_conf *mpc) in mac_policy_fastpath_unregister() argument
507 ops = (uintptr_t **)mpc->mpc_ops; in mac_policy_fastpath_unregister()
518 mac_policy_register(struct mac_policy_conf *mpc) in mac_policy_register() argument
539 !(mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_UNLOADOK)); in mac_policy_register()
546 if (strcmp(tmpc->mpc_name, mpc->mpc_name) == 0) { in mac_policy_register()
551 if (mpc->mpc_field_off != NULL) { in mac_policy_register()
559 *mpc->mpc_field_off = slot; in mac_policy_register()
561 mpc->mpc_runtime_flags |= MPC_RUNTIME_FLAG_REGISTERED; in mac_policy_register()
569 LIST_INSERT_HEAD(mpc_list, mpc, mpc_list); in mac_policy_register()
571 LIST_INSERT_AFTER(last_mpc, mpc, mpc_list); in mac_policy_register()
579 if (mpc->mpc_ops->mpo_init != NULL) in mac_policy_register()
580 (*(mpc->mpc_ops->mpo_init))(mpc); in mac_policy_register()
582 mac_policy_fastpath_register(mpc); in mac_policy_register()
586 SDT_PROBE1(mac, , policy, register, mpc); in mac_policy_register()
587 printf("Security policy loaded: %s (%s)\n", mpc->mpc_fullname, in mac_policy_register()
588 mpc->mpc_name); in mac_policy_register()
596 mac_policy_unregister(struct mac_policy_conf *mpc) in mac_policy_unregister() argument
604 if ((mpc->mpc_runtime_flags & MPC_RUNTIME_FLAG_REGISTERED) == 0) { in mac_policy_unregister()
612 if (mpc->mpc_field_off != NULL) { in mac_policy_unregister()
621 if ((mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_UNLOADOK) == 0) { in mac_policy_unregister()
626 mac_policy_fastpath_unregister(mpc); in mac_policy_unregister()
628 if (mpc->mpc_ops->mpo_destroy != NULL) in mac_policy_unregister()
629 (*(mpc->mpc_ops->mpo_destroy))(mpc); in mac_policy_unregister()
631 LIST_REMOVE(mpc, mpc_list); in mac_policy_unregister()
632 mpc->mpc_runtime_flags &= ~MPC_RUNTIME_FLAG_REGISTERED; in mac_policy_unregister()
636 SDT_PROBE1(mac, , policy, unregister, mpc); in mac_policy_unregister()
637 printf("Security policy unload: %s (%s)\n", mpc->mpc_fullname, in mac_policy_unregister()
638 mpc->mpc_name); in mac_policy_unregister()
649 struct mac_policy_conf *mpc; in mac_policy_modevent() local
653 mpc = (struct mac_policy_conf *) data; in mac_policy_modevent()
662 SDT_PROBE2(mac, , policy, modevent, type, mpc); in mac_policy_modevent()
665 if (mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_NOTLATE && in mac_policy_modevent()
668 "after booting\n", mpc->mpc_name); in mac_policy_modevent()
672 error = mac_policy_register(mpc); in mac_policy_modevent()
676 if ((mpc->mpc_runtime_flags & MPC_RUNTIME_FLAG_REGISTERED) in mac_policy_modevent()
678 error = mac_policy_unregister(mpc); in mac_policy_modevent()