Lines Matching full:label

47  * magic numbers to each label and validates that each time an object label
131 #define LABEL_CHECK(label, magic) do { \
132 if (label != NULL) { \
133 KASSERT(SLOT(label) == magic || SLOT(label) == 0, \
134 ("%s: bad %s label", __func__, #magic)); \
138 #define LABEL_DESTROY(label, magic) do { \
139 if (SLOT(label) == magic || SLOT(label) == 0) { \
140 SLOT_SET(label, MAGIC_FREE); \
141 } else if (SLOT(label) == MAGIC_FREE) { \
144 DEBUGGER("%s: corrupted label", __func__); \
148 #define LABEL_INIT(label, magic) do { \
149 SLOT_SET(label, magic); \
152 #define LABEL_NOTFREE(label) do { \
153 KASSERT(SLOT(label) != MAGIC_FREE, \
154 ("%s: destroyed label", __func__)); \
163 test_bpfdesc_check_receive(struct bpf_d *d, struct label *dlabel,
164 struct ifnet *ifp, struct label *ifplabel)
177 struct label *dlabel)
187 test_bpfdesc_create_mbuf(struct bpf_d *d, struct label *dlabel,
188 struct mbuf *m, struct label *mlabel)
198 test_bpfdesc_destroy_label(struct label *label)
201 LABEL_DESTROY(label, MAGIC_BPF);
207 test_bpfdesc_init_label(struct label *label)
210 LABEL_INIT(label, MAGIC_BPF);
216 test_cred_check_relabel(struct ucred *cred, struct label *newlabel)
402 test_cred_copy_label(struct label *src, struct label *dest)
430 test_cred_destroy_label(struct label *label)
433 LABEL_DESTROY(label, MAGIC_CRED);
439 test_cred_externalize_label(struct label *label, char *element_name,
443 LABEL_CHECK(label, MAGIC_CRED);
451 test_cred_init_label(struct label *label)
454 LABEL_INIT(label, MAGIC_CRED);
460 test_cred_internalize_label(struct label *label, char *element_name,
464 LABEL_CHECK(label, MAGIC_CRED);
472 test_cred_relabel(struct ucred *cred, struct label *newlabel)
505 struct cdev *dev, struct devfs_dirent *de, struct label *delabel)
517 int dirnamelen, struct devfs_dirent *de, struct label *delabel)
527 struct devfs_dirent *dd, struct label *ddlabel, struct devfs_dirent *de,
528 struct label *delabel)
539 test_devfs_destroy_label(struct label *label)
542 LABEL_DESTROY(label, MAGIC_DEVFS);
548 test_devfs_init_label(struct label *label)
551 LABEL_INIT(label, MAGIC_DEVFS);
558 struct label *direntlabel, struct vnode *vp, struct label *vplabel)
568 test_devfs_vnode_associate(struct mount *mp, struct label *mplabel,
569 struct devfs_dirent *de, struct label *delabel, struct vnode *vp,
570 struct label *vplabel)
582 struct label *ifplabel, struct label *newlabel)
595 test_ifnet_check_transmit(struct ifnet *ifp, struct label *ifplabel,
596 struct mbuf *m, struct label *mlabel)
608 test_ifnet_copy_label(struct label *src, struct label *dest)
618 test_ifnet_create(struct ifnet *ifp, struct label *ifplabel)
627 test_ifnet_create_mbuf(struct ifnet *ifp, struct label *ifplabel,
628 struct mbuf *m, struct label *mlabel)
638 test_ifnet_destroy_label(struct label *label)
641 LABEL_DESTROY(label, MAGIC_IFNET);
647 test_ifnet_externalize_label(struct label *label, char *element_name,
651 LABEL_CHECK(label, MAGIC_IFNET);
659 test_ifnet_init_label(struct label *label)
662 LABEL_INIT(label, MAGIC_IFNET);
668 test_ifnet_internalize_label(struct label *label, char *element_name,
672 LABEL_CHECK(label, MAGIC_IFNET);
681 struct label *ifplabel, struct label *newlabel)
692 test_inpcb_check_deliver(struct inpcb *inp, struct label *inplabel,
693 struct mbuf *m, struct label *mlabel)
706 struct label *inplabel)
718 test_inpcb_create(struct socket *so, struct label *solabel,
719 struct inpcb *inp, struct label *inplabel)
731 test_inpcb_create_mbuf(struct inpcb *inp, struct label *inplabel,
732 struct mbuf *m, struct label *mlabel)
742 test_inpcb_destroy_label(struct label *label)
745 LABEL_DESTROY(label, MAGIC_INPCB);
751 test_inpcb_init_label(struct label *label, int flag)
759 LABEL_INIT(label, MAGIC_INPCB);
766 test_inpcb_sosetlabel(struct socket *so, struct label *solabel,
767 struct inpcb *inp, struct label *inplabel)
779 test_ip6q_create(struct mbuf *fragment, struct label *fragmentlabel,
780 struct ip6q *q6, struct label *q6label)
790 test_ip6q_destroy_label(struct label *label)
793 LABEL_DESTROY(label, MAGIC_IP6Q);
799 test_ip6q_init_label(struct label *label, int flag)
807 LABEL_INIT(label, MAGIC_IP6Q);
814 test_ip6q_match(struct mbuf *fragment, struct label *fragmentlabel,
815 struct ip6q *q6, struct label *q6label)
827 test_ip6q_reassemble(struct ip6q *q6, struct label *q6label, struct mbuf *m,
828 struct label *mlabel)
838 test_ip6q_update(struct mbuf *m, struct label *mlabel, struct ip6q *q6,
839 struct label *q6label)
849 test_ipq_create(struct mbuf *fragment, struct label *fragmentlabel,
850 struct ipq *q, struct label *qlabel)
860 test_ipq_destroy_label(struct label *label)
863 LABEL_DESTROY(label, MAGIC_IPQ);
869 test_ipq_init_label(struct label *label, int flag)
877 LABEL_INIT(label, MAGIC_IPQ);
884 test_ipq_match(struct mbuf *fragment, struct label *fragmentlabel,
885 struct ipq *q, struct label *qlabel)
897 test_ipq_reassemble(struct ipq *q, struct label *qlabel, struct mbuf *m,
898 struct label *mlabel)
908 test_ipq_update(struct mbuf *m, struct label *mlabel, struct ipq *q,
909 struct label *qlabel)
974 struct label *label)
978 LABEL_CHECK(label, MAGIC_VNODE);
997 test_mbuf_copy_label(struct label *src, struct label *dest)
1007 test_mbuf_destroy_label(struct label *label)
1012 * didn't have label storage allocated for them. Handle this
1015 if (label == NULL)
1018 LABEL_DESTROY(label, MAGIC_MBUF);
1024 test_mbuf_init_label(struct label *label, int flag)
1032 LABEL_INIT(label, MAGIC_MBUF);
1040 struct label *mplabel)
1053 struct label *mplabel)
1063 test_mount_destroy_label(struct label *label)
1066 LABEL_DESTROY(label, MAGIC_MOUNT);
1072 test_mount_init_label(struct label *label)
1075 LABEL_INIT(label, MAGIC_MOUNT);
1081 test_netinet_arp_send(struct ifnet *ifp, struct label *ifplabel,
1082 struct mbuf *m, struct label *mlabel)
1092 test_netinet_fragment(struct mbuf *m, struct label *mlabel,
1093 struct mbuf *frag, struct label *fraglabel)
1103 test_netinet_icmp_reply(struct mbuf *mrecv, struct label *mrecvlabel,
1104 struct mbuf *msend, struct label *msendlabel)
1114 test_netinet_icmp_replyinplace(struct mbuf *m, struct label *mlabel)
1123 test_netinet_igmp_send(struct ifnet *ifp, struct label *ifplabel,
1124 struct mbuf *m, struct label *mlabel)
1134 test_netinet_tcp_reply(struct mbuf *m, struct label *mlabel)
1143 test_netinet6_nd6_send(struct ifnet *ifp, struct label *ifplabel,
1144 struct mbuf *m, struct label *mlabel)
1155 struct label *pplabel, unsigned long cmd, void /* caddr_t */ *data)
1168 struct label *pplabel)
1181 struct label *pplabel)
1194 struct label *pplabel, struct label *newlabel)
1208 struct label *pplabel)
1221 struct label *pplabel)
1233 test_pipe_copy_label(struct label *src, struct label *dest)
1244 struct label *pplabel)
1254 test_pipe_destroy_label(struct label *label)
1257 LABEL_DESTROY(label, MAGIC_PIPE);
1263 test_pipe_externalize_label(struct label *label, char *element_name,
1267 LABEL_CHECK(label, MAGIC_PIPE);
1275 test_pipe_init_label(struct label *label)
1278 LABEL_INIT(label, MAGIC_PIPE);
1284 test_pipe_internalize_label(struct label *label, char *element_name,
1288 LABEL_CHECK(label, MAGIC_PIPE);
1297 struct label *pplabel, struct label *newlabel)
1309 struct ksem *ks, struct label *kslabel)
1323 struct label *kslabel)
1336 struct ksem *ks, struct label *kslabel)
1350 struct label *kslabel, mode_t mode)
1362 struct label *kslabel, uid_t uid, gid_t gid)
1374 struct ucred *file_cred, struct ksem *ks, struct label *kslabel)
1387 struct label *kslabel)
1400 struct ksem *ks, struct label *kslabel)
1414 struct label *kslabel)
1424 test_posixsem_destroy_label(struct label *label)
1427 LABEL_DESTROY(label, MAGIC_POSIX_SEM);
1433 test_posixsem_init_label(struct label *label)
1436 LABEL_INIT(label, MAGIC_POSIX_SEM);
1452 struct label *shmfdlabel, int prot, int flags)
1464 struct label *shmfdlabel, accmode_t accmode)
1476 struct ucred *file_cred, struct shmfd *shm, struct label *shmlabel)
1491 struct label *shmfdlabel, mode_t mode)
1503 struct label *shmfdlabel, uid_t uid, gid_t gid)
1515 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmfdlabel)
1528 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmfdlabel)
1541 struct label *shmfdlabel)
1553 struct ucred *file_cred, struct shmfd *shm, struct label *shmlabel)
1568 struct label *shmfdlabel)
1578 test_posixshm_destroy_label(struct label *label)
1581 LABEL_DESTROY(label, MAGIC_POSIX_SHM);
1587 test_posixshm_init_label(struct label *label)
1590 LABEL_INIT(label, MAGIC_POSIX_SHM);
1644 test_proc_destroy_label(struct label *label)
1647 LABEL_DESTROY(label, MAGIC_PROC);
1653 test_proc_init_label(struct label *label)
1656 LABEL_INIT(label, MAGIC_PROC);
1663 struct label *solabel)
1678 struct label *solabel, struct sockaddr *sa)
1693 struct label *solabel, struct sockaddr *sa)
1707 test_socket_check_deliver(struct socket *so, struct label *solabel,
1708 struct mbuf *m, struct label *mlabel)
1723 struct label *solabel)
1738 struct label *solabel)
1753 struct label *solabel)
1768 struct label *solabel, struct label *newlabel)
1784 struct label *solabel)
1799 struct label *solabel)
1814 struct label *solabel)
1828 test_socket_copy_label(struct label *src, struct label *dest)
1839 struct label *solabel)
1849 test_socket_create_mbuf(struct socket *so, struct label *solabel,
1850 struct mbuf *m, struct label *mlabel)
1862 test_socket_destroy_label(struct label *label)
1865 LABEL_DESTROY(label, MAGIC_SOCKET);
1871 test_socket_externalize_label(struct label *label, char *element_name,
1875 LABEL_CHECK(label, MAGIC_SOCKET);
1883 test_socket_init_label(struct label *label, int flag)
1891 LABEL_INIT(label, MAGIC_SOCKET);
1898 test_socket_internalize_label(struct label *label, char *element_name,
1902 LABEL_CHECK(label, MAGIC_SOCKET);
1910 test_socket_newconn(struct socket *oldso, struct label *oldsolabel,
1911 struct socket *newso, struct label *newsolabel)
1926 struct label *solabel, struct label *newlabel)
1939 test_socketpeer_destroy_label(struct label *label)
1942 LABEL_DESTROY(label, MAGIC_SOCKET);
1948 test_socketpeer_externalize_label(struct label *label, char *element_name,
1952 LABEL_CHECK(label, MAGIC_SOCKET);
1960 test_socketpeer_init_label(struct label *label, int flag)
1968 LABEL_INIT(label, MAGIC_SOCKET);
1975 test_socketpeer_set_from_mbuf(struct mbuf *m, struct label *mlabel,
1976 struct socket *so, struct label *sopeerlabel)
1989 struct label *oldsolabel, struct socket *newso,
1990 struct label *newsopeerlabel)
2004 test_syncache_create(struct label *label, struct inpcb *inp)
2007 LABEL_CHECK(label, MAGIC_SYNCACHE);
2013 test_syncache_create_mbuf(struct label *sc_label, struct mbuf *m,
2014 struct label *mlabel)
2024 test_syncache_destroy_label(struct label *label)
2027 LABEL_DESTROY(label, MAGIC_SYNCACHE);
2033 test_syncache_init_label(struct label *label, int flag)
2040 LABEL_INIT(label, MAGIC_SYNCACHE);
2048 struct label *vplabel)
2072 struct label *vplabel)
2107 struct label *vplabel)
2120 struct label *vplabel)
2144 test_sysvmsg_cleanup(struct label *msglabel)
2154 struct label *msqlabel, struct msg *msgptr, struct label *msglabel)
2164 test_sysvmsg_destroy_label(struct label *label)
2167 LABEL_DESTROY(label, MAGIC_SYSV_MSG);
2173 test_sysvmsg_init_label(struct label *label)
2175 LABEL_INIT(label, MAGIC_SYSV_MSG);
2182 struct label *msglabel, struct msqid_kernel *msqkptr,
2183 struct label *msqklabel)
2197 struct label *msglabel)
2210 struct label *msglabel)
2223 struct msqid_kernel *msqkptr, struct label *msqklabel)
2236 struct msqid_kernel *msqkptr, struct label *msqklabel)
2249 struct msqid_kernel *msqkptr, struct label *msqklabel)
2262 struct msqid_kernel *msqkptr, struct label *msqklabel, int cmd)
2274 test_sysvmsq_cleanup(struct label *msqlabel)
2284 struct msqid_kernel *msqkptr, struct label *msqlabel)
2293 test_sysvmsq_destroy_label(struct label *label)
2296 LABEL_DESTROY(label, MAGIC_SYSV_MSQ);
2302 test_sysvmsq_init_label(struct label *label)
2304 LABEL_INIT(label, MAGIC_SYSV_MSQ);
2311 struct semid_kernel *semakptr, struct label *semaklabel, int cmd)
2324 struct semid_kernel *semakptr, struct label *semaklabel)
2337 struct semid_kernel *semakptr, struct label *semaklabel, size_t accesstype)
2349 test_sysvsem_cleanup(struct label *semalabel)
2359 struct label *semalabel)
2368 test_sysvsem_destroy_label(struct label *label)
2371 LABEL_DESTROY(label, MAGIC_SYSV_SEM);
2377 test_sysvsem_init_label(struct label *label)
2379 LABEL_INIT(label, MAGIC_SYSV_SEM);
2386 struct shmid_kernel *shmsegptr, struct label *shmseglabel, int shmflg)
2399 struct shmid_kernel *shmsegptr, struct label *shmseglabel, int cmd)
2412 struct shmid_kernel *shmsegptr, struct label *shmseglabel)
2425 struct shmid_kernel *shmsegptr, struct label *shmseglabel, int shmflg)
2437 test_sysvshm_cleanup(struct label *shmlabel)
2447 struct label *shmlabel)
2456 test_sysvshm_destroy_label(struct label *label)
2459 LABEL_DESTROY(label, MAGIC_SYSV_SHM);
2465 test_sysvshm_init_label(struct label *label)
2467 LABEL_INIT(label, MAGIC_SYSV_SHM);
2481 test_vnode_associate_extattr(struct mount *mp, struct label *mplabel,
2482 struct vnode *vp, struct label *vplabel)
2494 test_vnode_associate_singlelabel(struct mount *mp, struct label *mplabel,
2495 struct vnode *vp, struct label *vplabel)
2506 struct label *vplabel, accmode_t accmode)
2519 struct label *dvplabel)
2532 struct label *dvplabel)
2545 struct label *dvplabel, struct componentname *cnp, struct vattr *vap)
2558 struct label *vplabel, acl_type_t type)
2571 struct label *vplabel, int attrnamespace, const char *name)
2584 struct label *vplabel, struct image_params *imgp,
2585 struct label *execlabel)
2599 struct label *vplabel, acl_type_t type)
2612 struct label *vplabel, int attrnamespace, const char *name)
2625 struct label *dvplabel, struct vnode *vp, struct label *vplabel,
2640 struct label *vplabel, int attrnamespace)
2653 struct label *dvplabel, struct componentname *cnp)
2666 struct label *vplabel, int prot, int flags)
2679 struct label *vplabel, accmode_t accmode)
2692 struct vnode *vp, struct label *vplabel)
2707 struct vnode *vp, struct label *vplabel)
2722 struct label *dvplabel)
2735 struct label *vplabel)
2748 struct label *vplabel, struct label *newlabel)
2762 struct label *dvplabel, struct vnode *vp, struct label *vplabel,
2777 struct label *dvplabel, struct vnode *vp, struct label *vplabel,
2792 struct label *vplabel)
2805 struct label *vplabel, acl_type_t type, struct acl *acl)
2818 struct label *vplabel, int attrnamespace, const char *name)
2831 struct label *vplabel, u_long flags)
2844 struct label *vplabel, mode_t mode)
2857 struct label *vplabel, uid_t uid, gid_t gid)
2870 struct label *vplabel, struct timespec atime, struct timespec mtime)
2883 struct vnode *vp, struct label *vplabel)
2898 struct label *dvplabel, struct vnode *vp, struct label *vplabel,
2913 struct ucred *file_cred, struct vnode *vp, struct label *vplabel)
2927 test_vnode_copy_label(struct label *src, struct label *dest)
2938 struct label *mplabel, struct vnode *dvp, struct label *dvplabel,
2939 struct vnode *vp, struct label *vplabel, struct componentname *cnp)
2952 test_vnode_destroy_label(struct label *label)
2955 LABEL_DESTROY(label, MAGIC_VNODE);
2962 struct vnode *vp, struct label *filelabel,
2963 struct label *interpvplabel, struct image_params *imgp,
2964 struct label *execlabel)
2978 struct label *filelabel, struct label *interpvplabel,
2979 struct image_params *imgp, struct label *execlabel)
2993 test_vnode_externalize_label(struct label *label, char *element_name,
2997 LABEL_CHECK(label, MAGIC_VNODE);
3005 test_vnode_init_label(struct label *label)
3008 LABEL_INIT(label, MAGIC_VNODE);
3014 test_vnode_internalize_label(struct label *label, char *element_name,
3018 LABEL_CHECK(label, MAGIC_VNODE);
3027 struct label *vplabel, struct label *label)
3032 LABEL_CHECK(label, MAGIC_VNODE);
3039 struct label *vplabel, struct label *intlabel)