| 75 | #include <security/mac/mac_policy.h> |
| 76 | |
| 77 | static struct label * |
| 78 | mac_inpcb_label_alloc(int flag) |
| 79 | { |
| 80 | struct label *label; |
| 81 | int error; |
| 82 | |
| 83 | label = mac_labelzone_alloc(flag); |
| 84 | if (label == NULL) |
| 85 | return (NULL); |
| 86 | if (flag & M_WAITOK) |
| 87 | MAC_POLICY_CHECK(inpcb_init_label, label, flag); |
| 88 | else |
| 89 | MAC_POLICY_CHECK_NOSLEEP(inpcb_init_label, label, flag); |
| 90 | if (error) { |
| 91 | MAC_POLICY_PERFORM_NOSLEEP(inpcb_destroy_label, label); |
| 92 | mac_labelzone_free(label); |
| 93 | return (NULL); |
| 94 | } |
| 95 | return (label); |
| 96 | } |
| 97 | |
| 98 | int |
| 99 | mac_inpcb_init(struct inpcb *inp, int flag) |
no test coverage detected