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

Function mac_socketpeer_label_alloc

freebsd/security/mac/mac_socket.c:124–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124static struct label *
125mac_socketpeer_label_alloc(int flag)
126{
127 struct label *label;
128 int error;
129
130 label = mac_labelzone_alloc(flag);
131 if (label == NULL)
132 return (NULL);
133
134 if (flag & M_WAITOK)
135 MAC_POLICY_CHECK(socketpeer_init_label, label, flag);
136 else
137 MAC_POLICY_CHECK_NOSLEEP(socketpeer_init_label, label, flag);
138 if (error) {
139 MAC_POLICY_PERFORM_NOSLEEP(socketpeer_destroy_label, label);
140 mac_labelzone_free(label);
141 return (NULL);
142 }
143 return (label);
144}
145
146int
147mac_socket_init(struct socket *so, int flag)

Callers 1

mac_socket_initFunction · 0.85

Calls 2

mac_labelzone_allocFunction · 0.85
mac_labelzone_freeFunction · 0.85

Tested by

no test coverage detected