MCPcopy Index your code
hub / github.com/F-Stack/f-stack / mac_socket_label_alloc

Function mac_socket_label_alloc

freebsd/security/mac/mac_socket.c:102–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100 */
101
102struct label *
103mac_socket_label_alloc(int flag)
104{
105 struct label *label;
106 int error;
107
108 label = mac_labelzone_alloc(flag);
109 if (label == NULL)
110 return (NULL);
111
112 if (flag & M_WAITOK)
113 MAC_POLICY_CHECK(socket_init_label, label, flag);
114 else
115 MAC_POLICY_CHECK_NOSLEEP(socket_init_label, label, flag);
116 if (error) {
117 MAC_POLICY_PERFORM_NOSLEEP(socket_destroy_label, label);
118 mac_labelzone_free(label);
119 return (NULL);
120 }
121 return (label);
122}
123
124static struct label *
125mac_socketpeer_label_alloc(int flag)

Callers 6

sys___mac_get_fdFunction · 0.85
sys___mac_set_fdFunction · 0.85
mac_socket_initFunction · 0.85
mac_setsockopt_labelFunction · 0.85
mac_getsockopt_labelFunction · 0.85
mac_getsockopt_peerlabelFunction · 0.85

Calls 2

mac_labelzone_allocFunction · 0.85
mac_labelzone_freeFunction · 0.85

Tested by

no test coverage detected