MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mac_inpcb_label_alloc

Function mac_inpcb_label_alloc

freebsd/security/mac/mac_inet.c:77–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75#include <security/mac/mac_policy.h>
76
77static struct label *
78mac_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
98int
99mac_inpcb_init(struct inpcb *inp, int flag)

Callers 1

mac_inpcb_initFunction · 0.85

Calls 2

mac_labelzone_allocFunction · 0.85
mac_labelzone_freeFunction · 0.85

Tested by

no test coverage detected