xref: /xnu-8796.141.3/bsd/kern/policy_check.c (revision 1b191cb58250d0705d8a51287127505aa4bc0789)
1*1b191cb5SApple OSS Distributions #include <sys/param.h>
2*1b191cb5SApple OSS Distributions #include <sys/systm.h>          /* XXX printf() */
3*1b191cb5SApple OSS Distributions 
4*1b191cb5SApple OSS Distributions #include <sys/types.h>
5*1b191cb5SApple OSS Distributions #include <sys/fcntl.h>
6*1b191cb5SApple OSS Distributions #include <sys/file.h>
7*1b191cb5SApple OSS Distributions #include <sys/kauth.h>
8*1b191cb5SApple OSS Distributions #include <sys/mount.h>
9*1b191cb5SApple OSS Distributions #include <sys/msg.h>
10*1b191cb5SApple OSS Distributions #include <sys/proc.h>
11*1b191cb5SApple OSS Distributions #include <sys/socketvar.h>
12*1b191cb5SApple OSS Distributions #include <sys/vnode.h>
13*1b191cb5SApple OSS Distributions #include <security/mac.h>
14*1b191cb5SApple OSS Distributions #include <security/mac_policy.h>
15*1b191cb5SApple OSS Distributions 
16*1b191cb5SApple OSS Distributions #include <libkern/section_keywords.h>
17*1b191cb5SApple OSS Distributions #include <libkern/OSDebug.h>    /* OSBPrintBacktrace */
18*1b191cb5SApple OSS Distributions 
19*1b191cb5SApple OSS Distributions 
20*1b191cb5SApple OSS Distributions /* forward declaration; see bsd_init.c */
21*1b191cb5SApple OSS Distributions errno_t check_policy_init(int);
22*1b191cb5SApple OSS Distributions int get_thread_lock_count(thread_t th);         /* forced forward */
23*1b191cb5SApple OSS Distributions 
24*1b191cb5SApple OSS Distributions /*
25*1b191cb5SApple OSS Distributions  * Policy flags used when the policy is enabled
26*1b191cb5SApple OSS Distributions  *
27*1b191cb5SApple OSS Distributions  * Note:	CHECK_POLICY_CHECK is probably not very useful unless you
28*1b191cb5SApple OSS Distributions  *		are kernel debugging and set a breakpoint.
29*1b191cb5SApple OSS Distributions  */
30*1b191cb5SApple OSS Distributions #define CHECK_POLICY_CHECK      0x00000001      /* Check on calls */
31*1b191cb5SApple OSS Distributions #define CHECK_POLICY_FAIL       0x00000002      /* EPERM on fails */
32*1b191cb5SApple OSS Distributions #define CHECK_POLICY_BACKTRACE  0x00000004      /* Show call stack on fails */
33*1b191cb5SApple OSS Distributions #define CHECK_POLICY_PANIC      0x00000008      /* Panic on fails */
34*1b191cb5SApple OSS Distributions #define CHECK_POLICY_PERIODIC   0x00000010      /* Show fails periodically */
35*1b191cb5SApple OSS Distributions 
36*1b191cb5SApple OSS Distributions static int policy_flags = 0;
37*1b191cb5SApple OSS Distributions 
38*1b191cb5SApple OSS Distributions 
39*1b191cb5SApple OSS Distributions #define CHECK_SET_HOOK(x)       .mpo_##x = (mpo_##x##_t *)(void (*)(void))common_hook,
40*1b191cb5SApple OSS Distributions 
41*1b191cb5SApple OSS Distributions /*
42*1b191cb5SApple OSS Distributions  * Init; currently, we only print our arrival notice.
43*1b191cb5SApple OSS Distributions  */
44*1b191cb5SApple OSS Distributions static void
hook_policy_init(struct mac_policy_conf * mpc)45*1b191cb5SApple OSS Distributions hook_policy_init(struct mac_policy_conf *mpc)
46*1b191cb5SApple OSS Distributions {
47*1b191cb5SApple OSS Distributions 	printf("Policy '%s' = '%s' ready\n", mpc->mpc_name, mpc->mpc_fullname);
48*1b191cb5SApple OSS Distributions }
49*1b191cb5SApple OSS Distributions 
50*1b191cb5SApple OSS Distributions static void
hook_policy_initbsd(struct mac_policy_conf * mpc)51*1b191cb5SApple OSS Distributions hook_policy_initbsd(struct mac_policy_conf *mpc)
52*1b191cb5SApple OSS Distributions {
53*1b191cb5SApple OSS Distributions 	/* called with policy_grab_exclusive mutex held; exempt */
54*1b191cb5SApple OSS Distributions 	printf("hook_policy_initbsd: %s\n", mpc->mpc_name);
55*1b191cb5SApple OSS Distributions }
56*1b191cb5SApple OSS Distributions 
57*1b191cb5SApple OSS Distributions 
58*1b191cb5SApple OSS Distributions /* Implementation */
59*1b191cb5SApple OSS Distributions #define CLASS_PERIOD_LIMIT      10000
60*1b191cb5SApple OSS Distributions #define CLASS_PERIOD_MULT       20
61*1b191cb5SApple OSS Distributions 
62*1b191cb5SApple OSS Distributions static int policy_check_event = 1;
63*1b191cb5SApple OSS Distributions static int policy_check_period = 1;
64*1b191cb5SApple OSS Distributions static int policy_check_next = CLASS_PERIOD_MULT;
65*1b191cb5SApple OSS Distributions 
66*1b191cb5SApple OSS Distributions 
67*1b191cb5SApple OSS Distributions static int
common_hook(void)68*1b191cb5SApple OSS Distributions common_hook(void)
69*1b191cb5SApple OSS Distributions {
70*1b191cb5SApple OSS Distributions 	int     i;
71*1b191cb5SApple OSS Distributions 	int     rv = 0;
72*1b191cb5SApple OSS Distributions 
73*1b191cb5SApple OSS Distributions 	if ((i = get_thread_lock_count(current_thread())) != 0) {
74*1b191cb5SApple OSS Distributions 		/*
75*1b191cb5SApple OSS Distributions 		 * fail the MACF check if we hold a lock; this assumes a
76*1b191cb5SApple OSS Distributions 		 * a non-void (authorization) MACF hook.
77*1b191cb5SApple OSS Distributions 		 */
78*1b191cb5SApple OSS Distributions 		if (policy_flags & CHECK_POLICY_FAIL) {
79*1b191cb5SApple OSS Distributions 			rv = EPERM;
80*1b191cb5SApple OSS Distributions 		}
81*1b191cb5SApple OSS Distributions 
82*1b191cb5SApple OSS Distributions 		/*
83*1b191cb5SApple OSS Distributions 		 * display a backtrace if we hold a lock and we are not
84*1b191cb5SApple OSS Distributions 		 * going to panic
85*1b191cb5SApple OSS Distributions 		 */
86*1b191cb5SApple OSS Distributions 		if ((policy_flags & (CHECK_POLICY_BACKTRACE | CHECK_POLICY_PANIC)) == CHECK_POLICY_BACKTRACE) {
87*1b191cb5SApple OSS Distributions 			if (policy_flags & CHECK_POLICY_PERIODIC) {
88*1b191cb5SApple OSS Distributions 				/* at exponentially increasing intervals */
89*1b191cb5SApple OSS Distributions 				if (!(policy_check_event % policy_check_period)) {
90*1b191cb5SApple OSS Distributions 					if (policy_check_event <= policy_check_next || policy_check_period == CLASS_PERIOD_LIMIT) {
91*1b191cb5SApple OSS Distributions 						/*
92*1b191cb5SApple OSS Distributions 						 * According to Derek, we could
93*1b191cb5SApple OSS Distributions 						 * technically get a symbolicated name
94*1b191cb5SApple OSS Distributions 						 * here, if we refactered some code
95*1b191cb5SApple OSS Distributions 						 * and set the "keepsyms=1" boot
96*1b191cb5SApple OSS Distributions 						 * argument...
97*1b191cb5SApple OSS Distributions 						 */
98*1b191cb5SApple OSS Distributions 						OSReportWithBacktrace("calling MACF hook with mutex count %d (event %d) ", i, policy_check_event);
99*1b191cb5SApple OSS Distributions 					}
100*1b191cb5SApple OSS Distributions 				} else {
101*1b191cb5SApple OSS Distributions 					if (policy_check_period < CLASS_PERIOD_LIMIT) {
102*1b191cb5SApple OSS Distributions 						policy_check_next *= CLASS_PERIOD_MULT;
103*1b191cb5SApple OSS Distributions 						policy_check_period *= CLASS_PERIOD_MULT;
104*1b191cb5SApple OSS Distributions 					}
105*1b191cb5SApple OSS Distributions 				}
106*1b191cb5SApple OSS Distributions 			} else {
107*1b191cb5SApple OSS Distributions 				/* always */
108*1b191cb5SApple OSS Distributions 				OSReportWithBacktrace("calling MACF hook with mutex count %d (event %d) ", i, policy_check_event);
109*1b191cb5SApple OSS Distributions 			}
110*1b191cb5SApple OSS Distributions 		}
111*1b191cb5SApple OSS Distributions 
112*1b191cb5SApple OSS Distributions 		/* Panic */
113*1b191cb5SApple OSS Distributions 		if (policy_flags & CHECK_POLICY_PANIC) {
114*1b191cb5SApple OSS Distributions 			panic("calling MACF hook with mutex count %d", i);
115*1b191cb5SApple OSS Distributions 		}
116*1b191cb5SApple OSS Distributions 
117*1b191cb5SApple OSS Distributions 		/* count for non-fatal tracing */
118*1b191cb5SApple OSS Distributions 		policy_check_event++;
119*1b191cb5SApple OSS Distributions 	}
120*1b191cb5SApple OSS Distributions 
121*1b191cb5SApple OSS Distributions 	return rv;
122*1b191cb5SApple OSS Distributions }
123*1b191cb5SApple OSS Distributions 
124*1b191cb5SApple OSS Distributions #if (MAC_POLICY_OPS_VERSION != 82)
125*1b191cb5SApple OSS Distributions # error "struct mac_policy_ops doesn't match definition in mac_policy.h"
126*1b191cb5SApple OSS Distributions #endif
127*1b191cb5SApple OSS Distributions /*
128*1b191cb5SApple OSS Distributions  * Policy hooks; one per possible hook
129*1b191cb5SApple OSS Distributions  *
130*1b191cb5SApple OSS Distributions  * Please note that this struct initialization should be kept in sync with
131*1b191cb5SApple OSS Distributions  * security/mac_policy.h (mac_policy_ops struct definition).
132*1b191cb5SApple OSS Distributions  */
133*1b191cb5SApple OSS Distributions const static struct mac_policy_ops policy_ops = {
134*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(audit_check_postselect)
135*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(audit_check_preselect)
136*1b191cb5SApple OSS Distributions 
137*1b191cb5SApple OSS Distributions 	.mpo_reserved01 = (mpo_reserved_hook_t *)common_hook,
138*1b191cb5SApple OSS Distributions 	.mpo_reserved02 = (mpo_reserved_hook_t *)common_hook,
139*1b191cb5SApple OSS Distributions 	.mpo_reserved03 = (mpo_reserved_hook_t *)common_hook,
140*1b191cb5SApple OSS Distributions 	.mpo_reserved04 = (mpo_reserved_hook_t *)common_hook,
141*1b191cb5SApple OSS Distributions 
142*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_check_label_update_execve)
143*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_check_label_update)
144*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_check_visible)
145*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_label_associate_fork)
146*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_label_associate_kernel)
147*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_label_associate)
148*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_label_associate_user)
149*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_label_destroy)
150*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_label_externalize_audit)
151*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_label_externalize)
152*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_label_init)
153*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_label_internalize)
154*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_label_update_execve)
155*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(cred_label_update)
156*1b191cb5SApple OSS Distributions 
157*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(devfs_label_associate_device)
158*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(devfs_label_associate_directory)
159*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(devfs_label_copy)
160*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(devfs_label_destroy)
161*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(devfs_label_init)
162*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(devfs_label_update)
163*1b191cb5SApple OSS Distributions 
164*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_change_offset)
165*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_create)
166*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_dup)
167*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_fcntl)
168*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_get_offset)
169*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_get)
170*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_inherit)
171*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_ioctl)
172*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_lock)
173*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_mmap_downgrade)
174*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_mmap)
175*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_receive)
176*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_set)
177*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_label_init)
178*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_label_destroy)
179*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_label_associate)
180*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_notify_close)
181*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_launch_constraints)
182*1b191cb5SApple OSS Distributions 
183*1b191cb5SApple OSS Distributions 	.mpo_reserved07 = (mpo_reserved_hook_t *)common_hook,
184*1b191cb5SApple OSS Distributions 	.mpo_reserved08 = (mpo_reserved_hook_t *)common_hook,
185*1b191cb5SApple OSS Distributions 	.mpo_reserved09 = (mpo_reserved_hook_t *)common_hook,
186*1b191cb5SApple OSS Distributions 	.mpo_reserved10 = (mpo_reserved_hook_t *)common_hook,
187*1b191cb5SApple OSS Distributions 	.mpo_reserved11 = (mpo_reserved_hook_t *)common_hook,
188*1b191cb5SApple OSS Distributions 	.mpo_reserved12 = (mpo_reserved_hook_t *)common_hook,
189*1b191cb5SApple OSS Distributions 	.mpo_reserved13 = (mpo_reserved_hook_t *)common_hook,
190*1b191cb5SApple OSS Distributions 	.mpo_reserved14 = (mpo_reserved_hook_t *)common_hook,
191*1b191cb5SApple OSS Distributions 	.mpo_reserved15 = (mpo_reserved_hook_t *)common_hook,
192*1b191cb5SApple OSS Distributions 	.mpo_reserved16 = (mpo_reserved_hook_t *)common_hook,
193*1b191cb5SApple OSS Distributions 	.mpo_reserved17 = (mpo_reserved_hook_t *)common_hook,
194*1b191cb5SApple OSS Distributions 	.mpo_reserved18 = (mpo_reserved_hook_t *)common_hook,
195*1b191cb5SApple OSS Distributions 	.mpo_reserved19 = (mpo_reserved_hook_t *)common_hook,
196*1b191cb5SApple OSS Distributions 	.mpo_reserved20 = (mpo_reserved_hook_t *)common_hook,
197*1b191cb5SApple OSS Distributions 	.mpo_reserved21 = (mpo_reserved_hook_t *)common_hook,
198*1b191cb5SApple OSS Distributions 	.mpo_reserved22 = (mpo_reserved_hook_t *)common_hook,
199*1b191cb5SApple OSS Distributions 	.mpo_reserved23 = (mpo_reserved_hook_t *)common_hook,
200*1b191cb5SApple OSS Distributions 	.mpo_reserved24 = (mpo_reserved_hook_t *)common_hook,
201*1b191cb5SApple OSS Distributions 
202*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(necp_check_open)
203*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(necp_check_client_action)
204*1b191cb5SApple OSS Distributions 
205*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(file_check_library_validation)
206*1b191cb5SApple OSS Distributions 
207*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_setacl)
208*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_setattrlist)
209*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_setextattr)
210*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_setflags)
211*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_setmode)
212*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_setowner)
213*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_setutimes)
214*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_truncate)
215*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_getattrlistbulk)
216*1b191cb5SApple OSS Distributions 
217*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_get_task_special_port)
218*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_set_task_special_port)
219*1b191cb5SApple OSS Distributions 
220*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_swap)
221*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_unlink)
222*1b191cb5SApple OSS Distributions 
223*1b191cb5SApple OSS Distributions 	.mpo_reserved32 = (mpo_reserved_hook_t *)common_hook,
224*1b191cb5SApple OSS Distributions 	.mpo_reserved33 = (mpo_reserved_hook_t *)common_hook,
225*1b191cb5SApple OSS Distributions 	.mpo_reserved34 = (mpo_reserved_hook_t *)common_hook,
226*1b191cb5SApple OSS Distributions 	.mpo_reserved35 = (mpo_reserved_hook_t *)common_hook,
227*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_copyfile)
228*1b191cb5SApple OSS Distributions 
229*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_quotactl)
230*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_fsctl)
231*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_getattr)
232*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_label_update)
233*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_mount)
234*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_remount)
235*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_setattr)
236*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_stat)
237*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_umount)
238*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_label_associate)
239*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_label_destroy)
240*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_label_externalize)
241*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_label_init)
242*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_label_internalize)
243*1b191cb5SApple OSS Distributions 
244*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_expose_task_with_flavor)
245*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_get_task_with_flavor)
246*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_task_id_token_get_task)
247*1b191cb5SApple OSS Distributions 
248*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(pipe_check_ioctl)
249*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(pipe_check_kqfilter)
250*1b191cb5SApple OSS Distributions 	.mpo_reserved41 = (mpo_reserved_hook_t *)common_hook,
251*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(pipe_check_read)
252*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(pipe_check_select)
253*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(pipe_check_stat)
254*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(pipe_check_write)
255*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(pipe_label_associate)
256*1b191cb5SApple OSS Distributions 	.mpo_reserved42 = (mpo_reserved_hook_t *)common_hook,
257*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(pipe_label_destroy)
258*1b191cb5SApple OSS Distributions 	.mpo_reserved43 = (mpo_reserved_hook_t *)common_hook,
259*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(pipe_label_init)
260*1b191cb5SApple OSS Distributions 	.mpo_reserved44 = (mpo_reserved_hook_t *)common_hook,
261*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_syscall_mac)
262*1b191cb5SApple OSS Distributions 
263*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(policy_destroy)
264*1b191cb5SApple OSS Distributions 	/* special hooks for policy init's */
265*1b191cb5SApple OSS Distributions 	.mpo_policy_init = hook_policy_init,
266*1b191cb5SApple OSS Distributions 	.mpo_policy_initbsd = hook_policy_initbsd,
267*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(policy_syscall)
268*1b191cb5SApple OSS Distributions 
269*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_sysctlbyname)
270*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_inherit_ipc_ports)
271*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_rename)
272*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(kext_check_query)
273*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_notify_exec_complete)
274*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_notify_cs_invalidated)
275*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_syscall_unix)
276*1b191cb5SApple OSS Distributions 	.mpo_reserved45 = (mpo_reserved_hook_t *)common_hook,
277*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_set_host_special_port)
278*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_set_host_exception_port)
279*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(exc_action_check_exception_send)
280*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(exc_action_label_associate)
281*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(exc_action_label_populate)
282*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(exc_action_label_destroy)
283*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(exc_action_label_init)
284*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(exc_action_label_update)
285*1b191cb5SApple OSS Distributions 
286*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_trigger_resolve)
287*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_mount_late)
288*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_snapshot_mount)
289*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_reclaim)
290*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(skywalk_flow_check_connect)
291*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(skywalk_flow_check_listen)
292*1b191cb5SApple OSS Distributions 
293*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixsem_check_create)
294*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixsem_check_open)
295*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixsem_check_post)
296*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixsem_check_unlink)
297*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixsem_check_wait)
298*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixsem_label_associate)
299*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixsem_label_destroy)
300*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixsem_label_init)
301*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixshm_check_create)
302*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixshm_check_mmap)
303*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixshm_check_open)
304*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixshm_check_stat)
305*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixshm_check_truncate)
306*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixshm_check_unlink)
307*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixshm_label_associate)
308*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixshm_label_destroy)
309*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(posixshm_label_init)
310*1b191cb5SApple OSS Distributions 
311*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_debug)
312*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_fork)
313*1b191cb5SApple OSS Distributions 	.mpo_reserved61 = (mpo_reserved_hook_t *)common_hook,
314*1b191cb5SApple OSS Distributions 	.mpo_reserved62 = (mpo_reserved_hook_t *)common_hook,
315*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_getaudit)
316*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_getauid)
317*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_getlcid)
318*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_mprotect)
319*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_sched)
320*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_setaudit)
321*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_setauid)
322*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_setlcid)
323*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_signal)
324*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_wait)
325*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_dump_core)
326*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_remote_thread_create)
327*1b191cb5SApple OSS Distributions 
328*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_accept)
329*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_accepted)
330*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_bind)
331*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_connect)
332*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_create)
333*1b191cb5SApple OSS Distributions 	.mpo_reserved46 = (mpo_reserved_hook_t *)common_hook,
334*1b191cb5SApple OSS Distributions 	.mpo_reserved47 = (mpo_reserved_hook_t *)common_hook,
335*1b191cb5SApple OSS Distributions 	.mpo_reserved48 = (mpo_reserved_hook_t *)common_hook,
336*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_listen)
337*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_receive)
338*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_received)
339*1b191cb5SApple OSS Distributions 	.mpo_reserved49 = (mpo_reserved_hook_t *)common_hook,
340*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_send)
341*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_stat)
342*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_setsockopt)
343*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_getsockopt)
344*1b191cb5SApple OSS Distributions 
345*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_get_movable_control_port)
346*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_dyld_process_info_notify_register)
347*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_setuid)
348*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_seteuid)
349*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_setreuid)
350*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_setgid)
351*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_setegid)
352*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_setregid)
353*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_settid)
354*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_memorystatus_control)
355*1b191cb5SApple OSS Distributions 
356*1b191cb5SApple OSS Distributions 	.mpo_reserved60 = (mpo_reserved_hook_t *)common_hook,
357*1b191cb5SApple OSS Distributions 
358*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(thread_telemetry)
359*1b191cb5SApple OSS Distributions 
360*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(iokit_check_open_service)
361*1b191cb5SApple OSS Distributions 
362*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_acct)
363*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_audit)
364*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_auditctl)
365*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_auditon)
366*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_host_priv)
367*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_nfsd)
368*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_reboot)
369*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_settime)
370*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_swapoff)
371*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_swapon)
372*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(socket_check_ioctl)
373*1b191cb5SApple OSS Distributions 
374*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsg_label_associate)
375*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsg_label_destroy)
376*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsg_label_init)
377*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsg_label_recycle)
378*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsq_check_enqueue)
379*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsq_check_msgrcv)
380*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsq_check_msgrmid)
381*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsq_check_msqctl)
382*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsq_check_msqget)
383*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsq_check_msqrcv)
384*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsq_check_msqsnd)
385*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsq_label_associate)
386*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsq_label_destroy)
387*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsq_label_init)
388*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvmsq_label_recycle)
389*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvsem_check_semctl)
390*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvsem_check_semget)
391*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvsem_check_semop)
392*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvsem_label_associate)
393*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvsem_label_destroy)
394*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvsem_label_init)
395*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvsem_label_recycle)
396*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvshm_check_shmat)
397*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvshm_check_shmctl)
398*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvshm_check_shmdt)
399*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvshm_check_shmget)
400*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvshm_label_associate)
401*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvshm_label_destroy)
402*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvshm_label_init)
403*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(sysvshm_label_recycle)
404*1b191cb5SApple OSS Distributions 
405*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_notify_exit)
406*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_snapshot_revert)
407*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_getattr)
408*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_snapshot_create)
409*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(mount_check_snapshot_delete)
410*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_clone)
411*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_get_cs_info)
412*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_set_cs_info)
413*1b191cb5SApple OSS Distributions 
414*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(iokit_check_hid_control)
415*1b191cb5SApple OSS Distributions 
416*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_access)
417*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_chdir)
418*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_chroot)
419*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_create)
420*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_deleteextattr)
421*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_exchangedata)
422*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_exec)
423*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_getattrlist)
424*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_getextattr)
425*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_ioctl)
426*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_kqfilter)
427*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_label_update)
428*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_link)
429*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_listextattr)
430*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_lookup)
431*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_open)
432*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_read)
433*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_readdir)
434*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_readlink)
435*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_rename_from)
436*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_rename_to)
437*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_revoke)
438*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_select)
439*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_setattrlist)
440*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_setextattr)
441*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_setflags)
442*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_setmode)
443*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_setowner)
444*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_setutimes)
445*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_stat)
446*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_truncate)
447*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_unlink)
448*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_write)
449*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_associate_devfs)
450*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_associate_extattr)
451*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_associate_file)
452*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_associate_pipe)
453*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_associate_posixsem)
454*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_associate_posixshm)
455*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_associate_singlelabel)
456*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_associate_socket)
457*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_copy)
458*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_destroy)
459*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_externalize_audit)
460*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_externalize)
461*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_init)
462*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_internalize)
463*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_recycle)
464*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_store)
465*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_update_extattr)
466*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_label_update)
467*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_create)
468*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_signature)
469*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_uipc_bind)
470*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_uipc_connect)
471*1b191cb5SApple OSS Distributions 
472*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_run_cs_invalid)
473*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_suspend_resume)
474*1b191cb5SApple OSS Distributions 
475*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(thread_userret)
476*1b191cb5SApple OSS Distributions 
477*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(iokit_check_set_properties)
478*1b191cb5SApple OSS Distributions 
479*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_supplemental_signature)
480*1b191cb5SApple OSS Distributions 
481*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_searchfs)
482*1b191cb5SApple OSS Distributions 
483*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(priv_check)
484*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(priv_grant)
485*1b191cb5SApple OSS Distributions 
486*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_map_anon)
487*1b191cb5SApple OSS Distributions 
488*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_fsgetpath)
489*1b191cb5SApple OSS Distributions 
490*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(iokit_check_open)
491*1b191cb5SApple OSS Distributions 
492*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_ledger)
493*1b191cb5SApple OSS Distributions 
494*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_rename)
495*1b191cb5SApple OSS Distributions 
496*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_setacl)
497*1b191cb5SApple OSS Distributions 
498*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_deleteextattr)
499*1b191cb5SApple OSS Distributions 
500*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_kas_info)
501*1b191cb5SApple OSS Distributions 
502*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_check_lookup_preflight)
503*1b191cb5SApple OSS Distributions 
504*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_open)
505*1b191cb5SApple OSS Distributions 
506*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(system_check_info)
507*1b191cb5SApple OSS Distributions 
508*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(pty_notify_grant)
509*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(pty_notify_close)
510*1b191cb5SApple OSS Distributions 
511*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_find_sigs)
512*1b191cb5SApple OSS Distributions 
513*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(kext_check_load)
514*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(kext_check_unload)
515*1b191cb5SApple OSS Distributions 
516*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(proc_check_proc_info)
517*1b191cb5SApple OSS Distributions 
518*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(vnode_notify_link)
519*1b191cb5SApple OSS Distributions 
520*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(iokit_check_filter_properties)
521*1b191cb5SApple OSS Distributions 	CHECK_SET_HOOK(iokit_check_get_property)
522*1b191cb5SApple OSS Distributions };
523*1b191cb5SApple OSS Distributions 
524*1b191cb5SApple OSS Distributions /*
525*1b191cb5SApple OSS Distributions  * Policy definition
526*1b191cb5SApple OSS Distributions  */
527*1b191cb5SApple OSS Distributions static SECURITY_READ_ONLY_LATE(struct mac_policy_conf) policy_conf = {
528*1b191cb5SApple OSS Distributions 	.mpc_name               = "CHECK",
529*1b191cb5SApple OSS Distributions 	.mpc_fullname           = "Check Assumptions Policy",
530*1b191cb5SApple OSS Distributions 	.mpc_field_off          = NULL,         /* no label slot */
531*1b191cb5SApple OSS Distributions 	.mpc_labelnames         = NULL,         /* no policy label names */
532*1b191cb5SApple OSS Distributions 	.mpc_labelname_count    = 0,            /* count of label names is 0 */
533*1b191cb5SApple OSS Distributions 	.mpc_ops                = &policy_ops,  /* policy operations */
534*1b191cb5SApple OSS Distributions 	.mpc_loadtime_flags     = 0,
535*1b191cb5SApple OSS Distributions 	.mpc_runtime_flags      = 0,
536*1b191cb5SApple OSS Distributions };
537*1b191cb5SApple OSS Distributions 
538*1b191cb5SApple OSS Distributions static SECURITY_READ_ONLY_LATE(mac_policy_handle_t) policy_handle;
539*1b191cb5SApple OSS Distributions 
540*1b191cb5SApple OSS Distributions /*
541*1b191cb5SApple OSS Distributions  * Init routine; for a loadable policy, this would be called during the KEXT
542*1b191cb5SApple OSS Distributions  * initialization; we're going to call this from bsd_init() if the boot
543*1b191cb5SApple OSS Distributions  * argument for checking is present.
544*1b191cb5SApple OSS Distributions  */
545*1b191cb5SApple OSS Distributions errno_t
check_policy_init(int flags)546*1b191cb5SApple OSS Distributions check_policy_init(int flags)
547*1b191cb5SApple OSS Distributions {
548*1b191cb5SApple OSS Distributions 	/* Only instantiate the module if we have been asked to do checking */
549*1b191cb5SApple OSS Distributions 	if (!flags) {
550*1b191cb5SApple OSS Distributions 		return 0;
551*1b191cb5SApple OSS Distributions 	}
552*1b191cb5SApple OSS Distributions 
553*1b191cb5SApple OSS Distributions 	policy_flags = flags;
554*1b191cb5SApple OSS Distributions 
555*1b191cb5SApple OSS Distributions 	return mac_policy_register(&policy_conf, &policy_handle, NULL);
556*1b191cb5SApple OSS Distributions }
557