Lines Matching refs:mpc
348 mac_policy_getlabeled(struct mac_policy_conf *mpc) in mac_policy_getlabeled() argument
353 if (mpc->mpc_ops->mpo_ ## method != NULL) \ in mac_policy_getlabeled()
390 struct mac_policy_conf *mpc; in mac_policy_update() local
396 LIST_FOREACH(mpc, &mac_static_policy_list, mpc_list) { in mac_policy_update()
397 mac_labeled |= mac_policy_getlabeled(mpc); in mac_policy_update()
400 LIST_FOREACH(mpc, &mac_policy_list, mpc_list) { in mac_policy_update()
401 mac_labeled |= mac_policy_getlabeled(mpc); in mac_policy_update()
475 mac_policy_fastpath_register(struct mac_policy_conf *mpc) in mac_policy_fastpath_register() argument
483 ops = (uintptr_t **)mpc->mpc_ops; in mac_policy_fastpath_register()
492 mac_policy_fastpath_unregister(struct mac_policy_conf *mpc) in mac_policy_fastpath_unregister() argument
500 ops = (uintptr_t **)mpc->mpc_ops; in mac_policy_fastpath_unregister()
511 mac_policy_register(struct mac_policy_conf *mpc) in mac_policy_register() argument
531 !(mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_UNLOADOK)); in mac_policy_register()
535 if (strcmp(tmpc->mpc_name, mpc->mpc_name) == 0) { in mac_policy_register()
542 if (strcmp(tmpc->mpc_name, mpc->mpc_name) == 0) { in mac_policy_register()
548 if (mpc->mpc_field_off != NULL) { in mac_policy_register()
556 *mpc->mpc_field_off = slot; in mac_policy_register()
558 mpc->mpc_runtime_flags |= MPC_RUNTIME_FLAG_REGISTERED; in mac_policy_register()
567 LIST_INSERT_HEAD(&mac_static_policy_list, mpc, mpc_list); in mac_policy_register()
569 LIST_INSERT_HEAD(&mac_policy_list, mpc, mpc_list); in mac_policy_register()
578 if (mpc->mpc_ops->mpo_init != NULL) in mac_policy_register()
579 (*(mpc->mpc_ops->mpo_init))(mpc); in mac_policy_register()
581 mac_policy_fastpath_register(mpc); in mac_policy_register()
585 SDT_PROBE1(mac, , policy, register, mpc); in mac_policy_register()
586 printf("Security policy loaded: %s (%s)\n", mpc->mpc_fullname, in mac_policy_register()
587 mpc->mpc_name); in mac_policy_register()
595 mac_policy_unregister(struct mac_policy_conf *mpc) in mac_policy_unregister() argument
603 if ((mpc->mpc_runtime_flags & MPC_RUNTIME_FLAG_REGISTERED) == 0) { in mac_policy_unregister()
611 if (mpc->mpc_field_off != NULL) { in mac_policy_unregister()
620 if ((mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_UNLOADOK) == 0) { in mac_policy_unregister()
625 mac_policy_fastpath_unregister(mpc); in mac_policy_unregister()
627 if (mpc->mpc_ops->mpo_destroy != NULL) in mac_policy_unregister()
628 (*(mpc->mpc_ops->mpo_destroy))(mpc); in mac_policy_unregister()
630 LIST_REMOVE(mpc, mpc_list); in mac_policy_unregister()
631 mpc->mpc_runtime_flags &= ~MPC_RUNTIME_FLAG_REGISTERED; in mac_policy_unregister()
635 SDT_PROBE1(mac, , policy, unregister, mpc); in mac_policy_unregister()
636 printf("Security policy unload: %s (%s)\n", mpc->mpc_fullname, in mac_policy_unregister()
637 mpc->mpc_name); in mac_policy_unregister()
648 struct mac_policy_conf *mpc; in mac_policy_modevent() local
652 mpc = (struct mac_policy_conf *) data; in mac_policy_modevent()
661 SDT_PROBE2(mac, , policy, modevent, type, mpc); in mac_policy_modevent()
664 if (mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_NOTLATE && in mac_policy_modevent()
667 "after booting\n", mpc->mpc_name); in mac_policy_modevent()
671 error = mac_policy_register(mpc); in mac_policy_modevent()
675 if ((mpc->mpc_runtime_flags & MPC_RUNTIME_FLAG_REGISTERED) in mac_policy_modevent()
677 error = mac_policy_unregister(mpc); in mac_policy_modevent()