Lines Matching full:struct
69 struct acl;
70 struct auditinfo;
71 struct auditinfo_addr;
72 struct bpf_d;
73 struct cdev;
74 struct componentname;
75 struct db_command;
76 struct devfs_dirent;
77 struct ifnet;
78 struct image_params;
79 struct inpcb;
80 struct ip6q;
81 struct ipq;
82 struct kdb_dbbe;
83 struct ksem;
84 struct label;
85 struct mac_policy_conf;
86 struct mbuf;
87 struct mount;
88 struct msg;
89 struct msqid_kernel;
90 struct pipepair;
91 struct proc;
92 struct sbuf;
93 struct semid_kernel;
94 struct shmfd;
95 struct shmid_kernel;
96 struct sockaddr;
97 struct socket;
98 struct sysctl_oid;
99 struct sysctl_req;
100 struct thread;
101 struct ucred;
102 struct vattr;
103 struct vnode;
105 struct in_addr;
106 struct in6_addr;
111 typedef void (*mpo_destroy_t)(struct mac_policy_conf *mpc);
112 typedef void (*mpo_init_t)(struct mac_policy_conf *mpc);
118 typedef int (*mpo_syscall_t)(struct thread *td, int call, void *arg);
128 typedef int (*mpo_bpfdesc_check_receive_t)(struct bpf_d *d,
129 struct label *dlabel, struct ifnet *ifp,
130 struct label *ifplabel);
131 typedef void (*mpo_bpfdesc_create_t)(struct ucred *cred,
132 struct bpf_d *d, struct label *dlabel);
133 typedef void (*mpo_bpfdesc_create_mbuf_t)(struct bpf_d *d,
134 struct label *dlabel, struct mbuf *m,
135 struct label *mlabel);
136 typedef void (*mpo_bpfdesc_destroy_label_t)(struct label *label);
137 typedef void (*mpo_bpfdesc_init_label_t)(struct label *label);
139 typedef void (*mpo_cred_associate_nfsd_t)(struct ucred *cred);
140 typedef int (*mpo_cred_check_relabel_t)(struct ucred *cred,
141 struct label *newlabel);
142 typedef int (*mpo_cred_check_setaudit_t)(struct ucred *cred,
143 struct auditinfo *ai);
144 typedef int (*mpo_cred_check_setaudit_addr_t)(struct ucred *cred,
145 struct auditinfo_addr *aia);
146 typedef int (*mpo_cred_check_setauid_t)(struct ucred *cred, uid_t auid);
149 const struct ucred *old_cred, struct ucred *new_cred);
151 typedef int (*mpo_cred_check_setegid_t)(struct ucred *cred, gid_t egid);
152 typedef int (*mpo_cred_check_seteuid_t)(struct ucred *cred, uid_t euid);
153 typedef int (*mpo_cred_check_setgid_t)(struct ucred *cred, gid_t gid);
154 typedef int (*mpo_cred_check_setgroups_t)(struct ucred *cred, int ngroups,
156 typedef int (*mpo_cred_check_setregid_t)(struct ucred *cred, gid_t rgid,
158 typedef int (*mpo_cred_check_setresgid_t)(struct ucred *cred, gid_t rgid,
160 typedef int (*mpo_cred_check_setresuid_t)(struct ucred *cred, uid_t ruid,
162 typedef int (*mpo_cred_check_setreuid_t)(struct ucred *cred, uid_t ruid,
164 typedef int (*mpo_cred_check_setuid_t)(struct ucred *cred, uid_t uid);
165 typedef int (*mpo_cred_check_visible_t)(struct ucred *cr1,
166 struct ucred *cr2);
167 typedef void (*mpo_cred_copy_label_t)(struct label *src,
168 struct label *dest);
169 typedef void (*mpo_cred_create_init_t)(struct ucred *cred);
170 typedef void (*mpo_cred_create_swapper_t)(struct ucred *cred);
171 typedef void (*mpo_cred_destroy_label_t)(struct label *label);
172 typedef int (*mpo_cred_externalize_label_t)(struct label *label,
173 char *element_name, struct sbuf *sb, int *claimed);
174 typedef void (*mpo_cred_init_label_t)(struct label *label);
175 typedef int (*mpo_cred_internalize_label_t)(struct label *label,
177 typedef void (*mpo_cred_relabel_t)(struct ucred *cred,
178 struct label *newlabel);
180 typedef int (*mpo_ddb_command_register_t)(struct db_command_table *table,
181 struct db_command *cmd);
182 typedef int (*mpo_ddb_command_exec_t)(struct db_command *cmd,
186 typedef void (*mpo_devfs_create_device_t)(struct ucred *cred,
187 struct mount *mp, struct cdev *dev,
188 struct devfs_dirent *de, struct label *delabel);
189 typedef void (*mpo_devfs_create_directory_t)(struct mount *mp,
190 char *dirname, int dirnamelen, struct devfs_dirent *de,
191 struct label *delabel);
192 typedef void (*mpo_devfs_create_symlink_t)(struct ucred *cred,
193 struct mount *mp, struct devfs_dirent *dd,
194 struct label *ddlabel, struct devfs_dirent *de,
195 struct label *delabel);
196 typedef void (*mpo_devfs_destroy_label_t)(struct label *label);
197 typedef void (*mpo_devfs_init_label_t)(struct label *label);
198 typedef void (*mpo_devfs_update_t)(struct mount *mp,
199 struct devfs_dirent *de, struct label *delabel,
200 struct vnode *vp, struct label *vplabel);
201 typedef void (*mpo_devfs_vnode_associate_t)(struct mount *mp,
202 struct label *mplabel, struct devfs_dirent *de,
203 struct label *delabel, struct vnode *vp,
204 struct label *vplabel);
206 typedef int (*mpo_ifnet_check_relabel_t)(struct ucred *cred,
207 struct ifnet *ifp, struct label *ifplabel,
208 struct label *newlabel);
209 typedef int (*mpo_ifnet_check_transmit_t)(struct ifnet *ifp,
210 struct label *ifplabel, struct mbuf *m,
211 struct label *mlabel);
212 typedef void (*mpo_ifnet_copy_label_t)(struct label *src,
213 struct label *dest);
214 typedef void (*mpo_ifnet_create_t)(struct ifnet *ifp,
215 struct label *ifplabel);
216 typedef void (*mpo_ifnet_create_mbuf_t)(struct ifnet *ifp,
217 struct label *ifplabel, struct mbuf *m,
218 struct label *mlabel);
219 typedef void (*mpo_ifnet_destroy_label_t)(struct label *label);
220 typedef int (*mpo_ifnet_externalize_label_t)(struct label *label,
221 char *element_name, struct sbuf *sb, int *claimed);
222 typedef void (*mpo_ifnet_init_label_t)(struct label *label);
223 typedef int (*mpo_ifnet_internalize_label_t)(struct label *label,
225 typedef void (*mpo_ifnet_relabel_t)(struct ucred *cred, struct ifnet *ifp,
226 struct label *ifplabel, struct label *newlabel);
228 typedef int (*mpo_inpcb_check_deliver_t)(struct inpcb *inp,
229 struct label *inplabel, struct mbuf *m,
230 struct label *mlabel);
231 typedef int (*mpo_inpcb_check_visible_t)(struct ucred *cred,
232 struct inpcb *inp, struct label *inplabel);
233 typedef void (*mpo_inpcb_create_t)(struct socket *so,
234 struct label *solabel, struct inpcb *inp,
235 struct label *inplabel);
236 typedef void (*mpo_inpcb_create_mbuf_t)(struct inpcb *inp,
237 struct label *inplabel, struct mbuf *m,
238 struct label *mlabel);
239 typedef void (*mpo_inpcb_destroy_label_t)(struct label *label);
240 typedef int (*mpo_inpcb_init_label_t)(struct label *label, int flag);
241 typedef void (*mpo_inpcb_sosetlabel_t)(struct socket *so,
242 struct label *label, struct inpcb *inp,
243 struct label *inplabel);
245 typedef void (*mpo_ip6q_create_t)(struct mbuf *m, struct label *mlabel,
246 struct ip6q *q6, struct label *q6label);
247 typedef void (*mpo_ip6q_destroy_label_t)(struct label *label);
248 typedef int (*mpo_ip6q_init_label_t)(struct label *label, int flag);
249 typedef int (*mpo_ip6q_match_t)(struct mbuf *m, struct label *mlabel,
250 struct ip6q *q6, struct label *q6label);
251 typedef void (*mpo_ip6q_reassemble)(struct ip6q *q6, struct label *q6label,
252 struct mbuf *m, struct label *mlabel);
253 typedef void (*mpo_ip6q_update_t)(struct mbuf *m, struct label *mlabel,
254 struct ip6q *q6, struct label *q6label);
257 typedef int (*mpo_ip4_check_jail_t)(struct ucred *cred,
258 const struct in_addr *ia, struct ifnet *ifp);
259 typedef int (*mpo_ip6_check_jail_t)(struct ucred *cred,
260 const struct in6_addr *ia6, struct ifnet *ifp);
262 typedef void (*mpo_ipq_create_t)(struct mbuf *m, struct label *mlabel,
263 struct ipq *q, struct label *qlabel);
264 typedef void (*mpo_ipq_destroy_label_t)(struct label *label);
265 typedef int (*mpo_ipq_init_label_t)(struct label *label, int flag);
266 typedef int (*mpo_ipq_match_t)(struct mbuf *m, struct label *mlabel,
267 struct ipq *q, struct label *qlabel);
268 typedef void (*mpo_ipq_reassemble)(struct ipq *q, struct label *qlabel,
269 struct mbuf *m, struct label *mlabel);
270 typedef void (*mpo_ipq_update_t)(struct mbuf *m, struct label *mlabel,
271 struct ipq *q, struct label *qlabel);
273 typedef int (*mpo_kdb_check_backend_t)(struct kdb_dbbe *be);
275 typedef int (*mpo_kenv_check_dump_t)(struct ucred *cred);
276 typedef int (*mpo_kenv_check_get_t)(struct ucred *cred, char *name);
277 typedef int (*mpo_kenv_check_set_t)(struct ucred *cred, char *name,
279 typedef int (*mpo_kenv_check_unset_t)(struct ucred *cred, char *name);
281 typedef int (*mpo_kld_check_load_t)(struct ucred *cred, struct vnode *vp,
282 struct label *vplabel);
283 typedef int (*mpo_kld_check_stat_t)(struct ucred *cred);
285 typedef void (*mpo_mbuf_copy_label_t)(struct label *src,
286 struct label *dest);
287 typedef void (*mpo_mbuf_destroy_label_t)(struct label *label);
288 typedef int (*mpo_mbuf_init_label_t)(struct label *label, int flag);
290 typedef int (*mpo_mount_check_stat_t)(struct ucred *cred,
291 struct mount *mp, struct label *mplabel);
292 typedef void (*mpo_mount_create_t)(struct ucred *cred, struct mount *mp,
293 struct label *mplabel);
294 typedef void (*mpo_mount_destroy_label_t)(struct label *label);
295 typedef void (*mpo_mount_init_label_t)(struct label *label);
297 typedef void (*mpo_netinet_arp_send_t)(struct ifnet *ifp,
298 struct label *ifplabel, struct mbuf *m,
299 struct label *mlabel);
300 typedef void (*mpo_netinet_firewall_reply_t)(struct mbuf *mrecv,
301 struct label *mrecvlabel, struct mbuf *msend,
302 struct label *msendlabel);
303 typedef void (*mpo_netinet_firewall_send_t)(struct mbuf *m,
304 struct label *mlabel);
305 typedef void (*mpo_netinet_fragment_t)(struct mbuf *m,
306 struct label *mlabel, struct mbuf *frag,
307 struct label *fraglabel);
308 typedef void (*mpo_netinet_icmp_reply_t)(struct mbuf *mrecv,
309 struct label *mrecvlabel, struct mbuf *msend,
310 struct label *msendlabel);
311 typedef void (*mpo_netinet_icmp_replyinplace_t)(struct mbuf *m,
312 struct label *mlabel);
313 typedef void (*mpo_netinet_igmp_send_t)(struct ifnet *ifp,
314 struct label *ifplabel, struct mbuf *m,
315 struct label *mlabel);
316 typedef void (*mpo_netinet_tcp_reply_t)(struct mbuf *m,
317 struct label *mlabel);
319 typedef void (*mpo_netinet6_nd6_send_t)(struct ifnet *ifp,
320 struct label *ifplabel, struct mbuf *m,
321 struct label *mlabel);
323 typedef int (*mpo_pipe_check_ioctl_t)(struct ucred *cred,
324 struct pipepair *pp, struct label *pplabel,
326 typedef int (*mpo_pipe_check_poll_t)(struct ucred *cred,
327 struct pipepair *pp, struct label *pplabel);
328 typedef int (*mpo_pipe_check_read_t)(struct ucred *cred,
329 struct pipepair *pp, struct label *pplabel);
330 typedef int (*mpo_pipe_check_relabel_t)(struct ucred *cred,
331 struct pipepair *pp, struct label *pplabel,
332 struct label *newlabel);
333 typedef int (*mpo_pipe_check_stat_t)(struct ucred *cred,
334 struct pipepair *pp, struct label *pplabel);
335 typedef int (*mpo_pipe_check_write_t)(struct ucred *cred,
336 struct pipepair *pp, struct label *pplabel);
337 typedef void (*mpo_pipe_copy_label_t)(struct label *src,
338 struct label *dest);
339 typedef void (*mpo_pipe_create_t)(struct ucred *cred, struct pipepair *pp,
340 struct label *pplabel);
341 typedef void (*mpo_pipe_destroy_label_t)(struct label *label);
342 typedef int (*mpo_pipe_externalize_label_t)(struct label *label,
343 char *element_name, struct sbuf *sb, int *claimed);
344 typedef void (*mpo_pipe_init_label_t)(struct label *label);
345 typedef int (*mpo_pipe_internalize_label_t)(struct label *label,
347 typedef void (*mpo_pipe_relabel_t)(struct ucred *cred, struct pipepair *pp,
348 struct label *oldlabel, struct label *newlabel);
350 typedef int (*mpo_posixsem_check_getvalue_t)(struct ucred *active_cred,
351 struct ucred *file_cred, struct ksem *ks,
352 struct label *kslabel);
353 typedef int (*mpo_posixsem_check_open_t)(struct ucred *cred,
354 struct ksem *ks, struct label *kslabel);
355 typedef int (*mpo_posixsem_check_post_t)(struct ucred *active_cred,
356 struct ucred *file_cred, struct ksem *ks,
357 struct label *kslabel);
358 typedef int (*mpo_posixsem_check_setmode_t)(struct ucred *cred,
359 struct ksem *ks, struct label *shmlabel,
361 typedef int (*mpo_posixsem_check_setowner_t)(struct ucred *cred,
362 struct ksem *ks, struct label *shmlabel,
364 typedef int (*mpo_posixsem_check_stat_t)(struct ucred *active_cred,
365 struct ucred *file_cred, struct ksem *ks,
366 struct label *kslabel);
367 typedef int (*mpo_posixsem_check_unlink_t)(struct ucred *cred,
368 struct ksem *ks, struct label *kslabel);
369 typedef int (*mpo_posixsem_check_wait_t)(struct ucred *active_cred,
370 struct ucred *file_cred, struct ksem *ks,
371 struct label *kslabel);
372 typedef void (*mpo_posixsem_create_t)(struct ucred *cred,
373 struct ksem *ks, struct label *kslabel);
374 typedef void (*mpo_posixsem_destroy_label_t)(struct label *label);
375 typedef void (*mpo_posixsem_init_label_t)(struct label *label);
377 typedef int (*mpo_posixshm_check_create_t)(struct ucred *cred,
379 typedef int (*mpo_posixshm_check_mmap_t)(struct ucred *cred,
380 struct shmfd *shmfd, struct label *shmlabel, int prot,
382 typedef int (*mpo_posixshm_check_open_t)(struct ucred *cred,
383 struct shmfd *shmfd, struct label *shmlabel,
385 typedef int (*mpo_posixshm_check_read_t)(struct ucred *active_cred,
386 struct ucred *file_cred, struct shmfd *shmfd,
387 struct label *shmlabel);
388 typedef int (*mpo_posixshm_check_setmode_t)(struct ucred *cred,
389 struct shmfd *shmfd, struct label *shmlabel,
391 typedef int (*mpo_posixshm_check_setowner_t)(struct ucred *cred,
392 struct shmfd *shmfd, struct label *shmlabel,
394 typedef int (*mpo_posixshm_check_stat_t)(struct ucred *active_cred,
395 struct ucred *file_cred, struct shmfd *shmfd,
396 struct label *shmlabel);
397 typedef int (*mpo_posixshm_check_truncate_t)(struct ucred *active_cred,
398 struct ucred *file_cred, struct shmfd *shmfd,
399 struct label *shmlabel);
400 typedef int (*mpo_posixshm_check_unlink_t)(struct ucred *cred,
401 struct shmfd *shmfd, struct label *shmlabel);
402 typedef int (*mpo_posixshm_check_write_t)(struct ucred *active_cred,
403 struct ucred *file_cred, struct shmfd *shmfd,
404 struct label *shmlabel);
405 typedef void (*mpo_posixshm_create_t)(struct ucred *cred,
406 struct shmfd *shmfd, struct label *shmlabel);
407 typedef void (*mpo_posixshm_destroy_label_t)(struct label *label);
408 typedef void (*mpo_posixshm_init_label_t)(struct label *label);
410 typedef int (*mpo_priv_check_t)(struct ucred *cred, int priv);
411 typedef int (*mpo_priv_grant_t)(struct ucred *cred, int priv);
413 typedef int (*mpo_proc_check_debug_t)(struct ucred *cred,
414 struct proc *p);
415 typedef int (*mpo_proc_check_sched_t)(struct ucred *cred,
416 struct proc *p);
417 typedef int (*mpo_proc_check_signal_t)(struct ucred *cred,
418 struct proc *proc, int signum);
419 typedef int (*mpo_proc_check_wait_t)(struct ucred *cred,
420 struct proc *proc);
421 typedef void (*mpo_proc_destroy_label_t)(struct label *label);
422 typedef void (*mpo_proc_init_label_t)(struct label *label);
424 typedef int (*mpo_socket_check_accept_t)(struct ucred *cred,
425 struct socket *so, struct label *solabel);
426 typedef int (*mpo_socket_check_bind_t)(struct ucred *cred,
427 struct socket *so, struct label *solabel,
428 struct sockaddr *sa);
429 typedef int (*mpo_socket_check_connect_t)(struct ucred *cred,
430 struct socket *so, struct label *solabel,
431 struct sockaddr *sa);
432 typedef int (*mpo_socket_check_create_t)(struct ucred *cred, int domain,
434 typedef int (*mpo_socket_check_deliver_t)(struct socket *so,
435 struct label *solabel, struct mbuf *m,
436 struct label *mlabel);
437 typedef int (*mpo_socket_check_listen_t)(struct ucred *cred,
438 struct socket *so, struct label *solabel);
439 typedef int (*mpo_socket_check_poll_t)(struct ucred *cred,
440 struct socket *so, struct label *solabel);
441 typedef int (*mpo_socket_check_receive_t)(struct ucred *cred,
442 struct socket *so, struct label *solabel);
443 typedef int (*mpo_socket_check_relabel_t)(struct ucred *cred,
444 struct socket *so, struct label *solabel,
445 struct label *newlabel);
446 typedef int (*mpo_socket_check_send_t)(struct ucred *cred,
447 struct socket *so, struct label *solabel);
448 typedef int (*mpo_socket_check_stat_t)(struct ucred *cred,
449 struct socket *so, struct label *solabel);
450 typedef int (*mpo_socket_check_visible_t)(struct ucred *cred,
451 struct socket *so, struct label *solabel);
452 typedef void (*mpo_socket_copy_label_t)(struct label *src,
453 struct label *dest);
454 typedef void (*mpo_socket_create_t)(struct ucred *cred, struct socket *so,
455 struct label *solabel);
456 typedef void (*mpo_socket_create_mbuf_t)(struct socket *so,
457 struct label *solabel, struct mbuf *m,
458 struct label *mlabel);
459 typedef void (*mpo_socket_destroy_label_t)(struct label *label);
460 typedef int (*mpo_socket_externalize_label_t)(struct label *label,
461 char *element_name, struct sbuf *sb, int *claimed);
462 typedef int (*mpo_socket_init_label_t)(struct label *label, int flag);
463 typedef int (*mpo_socket_internalize_label_t)(struct label *label,
465 typedef void (*mpo_socket_newconn_t)(struct socket *oldso,
466 struct label *oldsolabel, struct socket *newso,
467 struct label *newsolabel);
468 typedef void (*mpo_socket_relabel_t)(struct ucred *cred, struct socket *so,
469 struct label *oldlabel, struct label *newlabel);
471 typedef void (*mpo_socketpeer_destroy_label_t)(struct label *label);
472 typedef int (*mpo_socketpeer_externalize_label_t)(struct label *label,
473 char *element_name, struct sbuf *sb, int *claimed);
474 typedef int (*mpo_socketpeer_init_label_t)(struct label *label,
476 typedef void (*mpo_socketpeer_set_from_mbuf_t)(struct mbuf *m,
477 struct label *mlabel, struct socket *so,
478 struct label *sopeerlabel);
479 typedef void (*mpo_socketpeer_set_from_socket_t)(struct socket *oldso,
480 struct label *oldsolabel, struct socket *newso,
481 struct label *newsopeerlabel);
483 typedef void (*mpo_syncache_create_t)(struct label *label,
484 struct inpcb *inp);
485 typedef void (*mpo_syncache_create_mbuf_t)(struct label *sc_label,
486 struct mbuf *m, struct label *mlabel);
487 typedef void (*mpo_syncache_destroy_label_t)(struct label *label);
488 typedef int (*mpo_syncache_init_label_t)(struct label *label, int flag);
490 typedef int (*mpo_system_check_acct_t)(struct ucred *cred,
491 struct vnode *vp, struct label *vplabel);
492 typedef int (*mpo_system_check_audit_t)(struct ucred *cred, void *record,
494 typedef int (*mpo_system_check_auditctl_t)(struct ucred *cred,
495 struct vnode *vp, struct label *vplabel);
496 typedef int (*mpo_system_check_auditon_t)(struct ucred *cred, int cmd);
497 typedef int (*mpo_system_check_reboot_t)(struct ucred *cred, int howto);
498 typedef int (*mpo_system_check_swapon_t)(struct ucred *cred,
499 struct vnode *vp, struct label *vplabel);
500 typedef int (*mpo_system_check_swapoff_t)(struct ucred *cred,
501 struct vnode *vp, struct label *vplabel);
502 typedef int (*mpo_system_check_sysctl_t)(struct ucred *cred,
503 struct sysctl_oid *oidp, void *arg1, int arg2,
504 struct sysctl_req *req);
506 typedef void (*mpo_sysvmsg_cleanup_t)(struct label *msglabel);
507 typedef void (*mpo_sysvmsg_create_t)(struct ucred *cred,
508 struct msqid_kernel *msqkptr, struct label *msqlabel,
509 struct msg *msgptr, struct label *msglabel);
510 typedef void (*mpo_sysvmsg_destroy_label_t)(struct label *label);
511 typedef void (*mpo_sysvmsg_init_label_t)(struct label *label);
513 typedef int (*mpo_sysvmsq_check_msgmsq_t)(struct ucred *cred,
514 struct msg *msgptr, struct label *msglabel,
515 struct msqid_kernel *msqkptr, struct label *msqklabel);
516 typedef int (*mpo_sysvmsq_check_msgrcv_t)(struct ucred *cred,
517 struct msg *msgptr, struct label *msglabel);
518 typedef int (*mpo_sysvmsq_check_msgrmid_t)(struct ucred *cred,
519 struct msg *msgptr, struct label *msglabel);
520 typedef int (*mpo_sysvmsq_check_msqget_t)(struct ucred *cred,
521 struct msqid_kernel *msqkptr, struct label *msqklabel);
522 typedef int (*mpo_sysvmsq_check_msqctl_t)(struct ucred *cred,
523 struct msqid_kernel *msqkptr, struct label *msqklabel,
525 typedef int (*mpo_sysvmsq_check_msqrcv_t)(struct ucred *cred,
526 struct msqid_kernel *msqkptr, struct label *msqklabel);
527 typedef int (*mpo_sysvmsq_check_msqsnd_t)(struct ucred *cred,
528 struct msqid_kernel *msqkptr, struct label *msqklabel);
529 typedef void (*mpo_sysvmsq_cleanup_t)(struct label *msqlabel);
530 typedef void (*mpo_sysvmsq_create_t)(struct ucred *cred,
531 struct msqid_kernel *msqkptr, struct label *msqlabel);
532 typedef void (*mpo_sysvmsq_destroy_label_t)(struct label *label);
533 typedef void (*mpo_sysvmsq_init_label_t)(struct label *label);
535 typedef int (*mpo_sysvsem_check_semctl_t)(struct ucred *cred,
536 struct semid_kernel *semakptr, struct label *semaklabel,
538 typedef int (*mpo_sysvsem_check_semget_t)(struct ucred *cred,
539 struct semid_kernel *semakptr, struct label *semaklabel);
540 typedef int (*mpo_sysvsem_check_semop_t)(struct ucred *cred,
541 struct semid_kernel *semakptr, struct label *semaklabel,
543 typedef void (*mpo_sysvsem_cleanup_t)(struct label *semalabel);
544 typedef void (*mpo_sysvsem_create_t)(struct ucred *cred,
545 struct semid_kernel *semakptr, struct label *semalabel);
546 typedef void (*mpo_sysvsem_destroy_label_t)(struct label *label);
547 typedef void (*mpo_sysvsem_init_label_t)(struct label *label);
549 typedef int (*mpo_sysvshm_check_shmat_t)(struct ucred *cred,
550 struct shmid_kernel *shmsegptr,
551 struct label *shmseglabel, int shmflg);
552 typedef int (*mpo_sysvshm_check_shmctl_t)(struct ucred *cred,
553 struct shmid_kernel *shmsegptr,
554 struct label *shmseglabel, int cmd);
555 typedef int (*mpo_sysvshm_check_shmdt_t)(struct ucred *cred,
556 struct shmid_kernel *shmsegptr,
557 struct label *shmseglabel);
558 typedef int (*mpo_sysvshm_check_shmget_t)(struct ucred *cred,
559 struct shmid_kernel *shmsegptr,
560 struct label *shmseglabel, int shmflg);
561 typedef void (*mpo_sysvshm_cleanup_t)(struct label *shmlabel);
562 typedef void (*mpo_sysvshm_create_t)(struct ucred *cred,
563 struct shmid_kernel *shmsegptr, struct label *shmlabel);
564 typedef void (*mpo_sysvshm_destroy_label_t)(struct label *label);
565 typedef void (*mpo_sysvshm_init_label_t)(struct label *label);
567 typedef void (*mpo_thread_userret_t)(struct thread *thread);
569 typedef int (*mpo_vnode_associate_extattr_t)(struct mount *mp,
570 struct label *mplabel, struct vnode *vp,
571 struct label *vplabel);
572 typedef void (*mpo_vnode_associate_singlelabel_t)(struct mount *mp,
573 struct label *mplabel, struct vnode *vp,
574 struct label *vplabel);
575 typedef int (*mpo_vnode_check_access_t)(struct ucred *cred,
576 struct vnode *vp, struct label *vplabel,
578 typedef int (*mpo_vnode_check_chdir_t)(struct ucred *cred,
579 struct vnode *dvp, struct label *dvplabel);
580 typedef int (*mpo_vnode_check_chroot_t)(struct ucred *cred,
581 struct vnode *dvp, struct label *dvplabel);
582 typedef int (*mpo_vnode_check_create_t)(struct ucred *cred,
583 struct vnode *dvp, struct label *dvplabel,
584 struct componentname *cnp, struct vattr *vap);
585 typedef int (*mpo_vnode_check_deleteacl_t)(struct ucred *cred,
586 struct vnode *vp, struct label *vplabel,
588 typedef int (*mpo_vnode_check_deleteextattr_t)(struct ucred *cred,
589 struct vnode *vp, struct label *vplabel,
591 typedef int (*mpo_vnode_check_exec_t)(struct ucred *cred,
592 struct vnode *vp, struct label *vplabel,
593 struct image_params *imgp, struct label *execlabel);
594 typedef int (*mpo_vnode_check_getacl_t)(struct ucred *cred,
595 struct vnode *vp, struct label *vplabel,
597 typedef int (*mpo_vnode_check_getextattr_t)(struct ucred *cred,
598 struct vnode *vp, struct label *vplabel,
600 typedef int (*mpo_vnode_check_link_t)(struct ucred *cred,
601 struct vnode *dvp, struct label *dvplabel,
602 struct vnode *vp, struct label *vplabel,
603 struct componentname *cnp);
604 typedef int (*mpo_vnode_check_listextattr_t)(struct ucred *cred,
605 struct vnode *vp, struct label *vplabel,
607 typedef int (*mpo_vnode_check_lookup_t)(struct ucred *cred,
608 struct vnode *dvp, struct label *dvplabel,
609 struct componentname *cnp);
610 typedef int (*mpo_vnode_check_mmap_t)(struct ucred *cred,
611 struct vnode *vp, struct label *label, int prot,
613 typedef void (*mpo_vnode_check_mmap_downgrade_t)(struct ucred *cred,
614 struct vnode *vp, struct label *vplabel, int *prot);
615 typedef int (*mpo_vnode_check_mprotect_t)(struct ucred *cred,
616 struct vnode *vp, struct label *vplabel, int prot);
617 typedef int (*mpo_vnode_check_open_t)(struct ucred *cred,
618 struct vnode *vp, struct label *vplabel,
620 typedef int (*mpo_vnode_check_poll_t)(struct ucred *active_cred,
621 struct ucred *file_cred, struct vnode *vp,
622 struct label *vplabel);
623 typedef int (*mpo_vnode_check_read_t)(struct ucred *active_cred,
624 struct ucred *file_cred, struct vnode *vp,
625 struct label *vplabel);
626 typedef int (*mpo_vnode_check_readdir_t)(struct ucred *cred,
627 struct vnode *dvp, struct label *dvplabel);
628 typedef int (*mpo_vnode_check_readlink_t)(struct ucred *cred,
629 struct vnode *vp, struct label *vplabel);
630 typedef int (*mpo_vnode_check_relabel_t)(struct ucred *cred,
631 struct vnode *vp, struct label *vplabel,
632 struct label *newlabel);
633 typedef int (*mpo_vnode_check_rename_from_t)(struct ucred *cred,
634 struct vnode *dvp, struct label *dvplabel,
635 struct vnode *vp, struct label *vplabel,
636 struct componentname *cnp);
637 typedef int (*mpo_vnode_check_rename_to_t)(struct ucred *cred,
638 struct vnode *dvp, struct label *dvplabel,
639 struct vnode *vp, struct label *vplabel, int samedir,
640 struct componentname *cnp);
641 typedef int (*mpo_vnode_check_revoke_t)(struct ucred *cred,
642 struct vnode *vp, struct label *vplabel);
643 typedef int (*mpo_vnode_check_setacl_t)(struct ucred *cred,
644 struct vnode *vp, struct label *vplabel, acl_type_t type,
645 struct acl *acl);
646 typedef int (*mpo_vnode_check_setextattr_t)(struct ucred *cred,
647 struct vnode *vp, struct label *vplabel,
649 typedef int (*mpo_vnode_check_setflags_t)(struct ucred *cred,
650 struct vnode *vp, struct label *vplabel, u_long flags);
651 typedef int (*mpo_vnode_check_setmode_t)(struct ucred *cred,
652 struct vnode *vp, struct label *vplabel, mode_t mode);
653 typedef int (*mpo_vnode_check_setowner_t)(struct ucred *cred,
654 struct vnode *vp, struct label *vplabel, uid_t uid,
656 typedef int (*mpo_vnode_check_setutimes_t)(struct ucred *cred,
657 struct vnode *vp, struct label *vplabel,
658 struct timespec atime, struct timespec mtime);
659 typedef int (*mpo_vnode_check_stat_t)(struct ucred *active_cred,
660 struct ucred *file_cred, struct vnode *vp,
661 struct label *vplabel);
662 typedef int (*mpo_vnode_check_unlink_t)(struct ucred *cred,
663 struct vnode *dvp, struct label *dvplabel,
664 struct vnode *vp, struct label *vplabel,
665 struct componentname *cnp);
666 typedef int (*mpo_vnode_check_write_t)(struct ucred *active_cred,
667 struct ucred *file_cred, struct vnode *vp,
668 struct label *vplabel);
669 typedef void (*mpo_vnode_copy_label_t)(struct label *src,
670 struct label *dest);
671 typedef int (*mpo_vnode_create_extattr_t)(struct ucred *cred,
672 struct mount *mp, struct label *mplabel,
673 struct vnode *dvp, struct label *dvplabel,
674 struct vnode *vp, struct label *vplabel,
675 struct componentname *cnp);
676 typedef void (*mpo_vnode_destroy_label_t)(struct label *label);
677 typedef void (*mpo_vnode_execve_transition_t)(struct ucred *old,
678 struct ucred *new, struct vnode *vp,
679 struct label *vplabel, struct label *interpvplabel,
680 struct image_params *imgp, struct label *execlabel);
681 typedef int (*mpo_vnode_execve_will_transition_t)(struct ucred *old,
682 struct vnode *vp, struct label *vplabel,
683 struct label *interpvplabel, struct image_params *imgp,
684 struct label *execlabel);
685 typedef int (*mpo_vnode_externalize_label_t)(struct label *label,
686 char *element_name, struct sbuf *sb, int *claimed);
687 typedef void (*mpo_vnode_init_label_t)(struct label *label);
688 typedef int (*mpo_vnode_internalize_label_t)(struct label *label,
690 typedef void (*mpo_vnode_relabel_t)(struct ucred *cred, struct vnode *vp,
691 struct label *vplabel, struct label *label);
692 typedef int (*mpo_vnode_setlabel_extattr_t)(struct ucred *cred,
693 struct vnode *vp, struct label *vplabel,
694 struct label *intlabel);
696 struct mac_policy_ops {
1002 * struct mac_policy_conf is the registration structure for policies, and is
1009 struct mac_policy_conf {
1012 struct mac_policy_ops *mpc_ops; /* policy operations */
1048 static struct mac_policy_conf mpname##_mac_policy_conf = { \
1068 * Policy interface to map a struct label pointer to per-policy data.
1072 intptr_t mac_label_get(struct label *l, int slot);
1073 void mac_label_set(struct label *l, int slot, intptr_t v);