• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/security/mac_test/

Lines Matching refs:label

49  * magic numbers to each label and validates that each time an object label
133 #define LABEL_CHECK(label, magic) do { \
134 if (label != NULL) { \
135 KASSERT(SLOT(label) == magic || SLOT(label) == 0, \
136 ("%s: bad %s label", __func__, #magic)); \
140 #define LABEL_DESTROY(label, magic) do { \
141 if (SLOT(label) == magic || SLOT(label) == 0) { \
142 SLOT_SET(label, MAGIC_FREE); \
143 } else if (SLOT(label) == MAGIC_FREE) { \
146 DEBUGGER("%s: corrupted label", __func__); \
150 #define LABEL_INIT(label, magic) do { \
151 SLOT_SET(label, magic); \
154 #define LABEL_NOTFREE(label) do { \
155 KASSERT(SLOT(label) != MAGIC_FREE, \
156 ("%s: destroyed label", __func__)); \
165 test_bpfdesc_check_receive(struct bpf_d *d, struct label *dlabel,
166 struct ifnet *ifp, struct label *ifplabel)
179 struct label *dlabel)
189 test_bpfdesc_create_mbuf(struct bpf_d *d, struct label *dlabel,
190 struct mbuf *m, struct label *mlabel)
200 test_bpfdesc_destroy_label(struct label *label)
203 LABEL_DESTROY(label, MAGIC_BPF);
209 test_bpfdesc_init_label(struct label *label)
212 LABEL_INIT(label, MAGIC_BPF);
218 test_cred_check_relabel(struct ucred *cred, struct label *newlabel)
378 test_cred_copy_label(struct label *src, struct label *dest)
406 test_cred_destroy_label(struct label *label)
409 LABEL_DESTROY(label, MAGIC_CRED);
415 test_cred_externalize_label(struct label *label, char *element_name,
419 LABEL_CHECK(label, MAGIC_CRED);
427 test_cred_init_label(struct label *label)
430 LABEL_INIT(label, MAGIC_CRED);
436 test_cred_internalize_label(struct label *label, char *element_name,
440 LABEL_CHECK(label, MAGIC_CRED);
448 test_cred_relabel(struct ucred *cred, struct label *newlabel)
459 struct cdev *dev, struct devfs_dirent *de, struct label *delabel)
471 int dirnamelen, struct devfs_dirent *de, struct label *delabel)
481 struct devfs_dirent *dd, struct label *ddlabel, struct devfs_dirent *de,
482 struct label *delabel)
493 test_devfs_destroy_label(struct label *label)
496 LABEL_DESTROY(label, MAGIC_DEVFS);
502 test_devfs_init_label(struct label *label)
505 LABEL_INIT(label, MAGIC_DEVFS);
512 struct label *direntlabel, struct vnode *vp, struct label *vplabel)
522 test_devfs_vnode_associate(struct mount *mp, struct label *mplabel,
523 struct devfs_dirent *de, struct label *delabel, struct vnode *vp,
524 struct label *vplabel)
536 struct label *ifplabel, struct label *newlabel)
549 test_ifnet_check_transmit(struct ifnet *ifp, struct label *ifplabel,
550 struct mbuf *m, struct label *mlabel)
562 test_ifnet_copy_label(struct label *src, struct label *dest)
572 test_ifnet_create(struct ifnet *ifp, struct label *ifplabel)
581 test_ifnet_create_mbuf(struct ifnet *ifp, struct label *ifplabel,
582 struct mbuf *m, struct label *mlabel)
592 test_ifnet_destroy_label(struct label *label)
595 LABEL_DESTROY(label, MAGIC_IFNET);
601 test_ifnet_externalize_label(struct label *label, char *element_name,
605 LABEL_CHECK(label, MAGIC_IFNET);
613 test_ifnet_init_label(struct label *label)
616 LABEL_INIT(label, MAGIC_IFNET);
622 test_ifnet_internalize_label(struct label *label, char *element_name,
626 LABEL_CHECK(label, MAGIC_IFNET);
635 struct label *ifplabel, struct label *newlabel)
646 test_inpcb_check_deliver(struct inpcb *inp, struct label *inplabel,
647 struct mbuf *m, struct label *mlabel)
660 struct label *inplabel)
672 test_inpcb_create(struct socket *so, struct label *solabel,
673 struct inpcb *inp, struct label *inplabel)
685 test_inpcb_create_mbuf(struct inpcb *inp, struct label *inplabel,
686 struct mbuf *m, struct label *mlabel)
696 test_inpcb_destroy_label(struct label *label)
699 LABEL_DESTROY(label, MAGIC_INPCB);
705 test_inpcb_init_label(struct label *label, int flag)
713 LABEL_INIT(label, MAGIC_INPCB);
720 test_inpcb_sosetlabel(struct socket *so, struct label *solabel,
721 struct inpcb *inp, struct label *inplabel)
733 test_ip6q_create(struct mbuf *fragment, struct label *fragmentlabel,
734 struct ip6q *q6, struct label *q6label)
744 test_ip6q_destroy_label(struct label *label)
747 LABEL_DESTROY(label, MAGIC_IP6Q);
753 test_ip6q_init_label(struct label *label, int flag)
761 LABEL_INIT(label, MAGIC_IP6Q);
768 test_ip6q_match(struct mbuf *fragment, struct label *fragmentlabel,
769 struct ip6q *q6, struct label *q6label)
781 test_ip6q_reassemble(struct ip6q *q6, struct label *q6label, struct mbuf *m,
782 struct label *mlabel)
792 test_ip6q_update(struct mbuf *m, struct label *mlabel, struct ip6q *q6,
793 struct label *q6label)
803 test_ipq_create(struct mbuf *fragment, struct label *fragmentlabel,
804 struct ipq *q, struct label *qlabel)
814 test_ipq_destroy_label(struct label *label)
817 LABEL_DESTROY(label, MAGIC_IPQ);
823 test_ipq_init_label(struct label *label, int flag)
831 LABEL_INIT(label, MAGIC_IPQ);
838 test_ipq_match(struct mbuf *fragment, struct label *fragmentlabel,
839 struct ipq *q, struct label *qlabel)
851 test_ipq_reassemble(struct ipq *q, struct label *qlabel, struct mbuf *m,
852 struct label *mlabel)
862 test_ipq_update(struct mbuf *m, struct label *mlabel, struct ipq *q,
863 struct label *qlabel)
918 struct label *label)
922 LABEL_CHECK(label, MAGIC_VNODE);
941 test_mbuf_copy_label(struct label *src, struct label *dest)
951 test_mbuf_destroy_label(struct label *label)
956 * didn't have label storage allocated for them. Handle this
959 if (label == NULL)
962 LABEL_DESTROY(label, MAGIC_MBUF);
968 test_mbuf_init_label(struct label *label, int flag)
976 LABEL_INIT(label, MAGIC_MBUF);
984 struct label *mplabel)
997 struct label *mplabel)
1007 test_mount_destroy_label(struct label *label)
1010 LABEL_DESTROY(label, MAGIC_MOUNT);
1016 test_mount_init_label(struct label *label)
1019 LABEL_INIT(label, MAGIC_MOUNT);
1025 test_netinet_arp_send(struct ifnet *ifp, struct label *ifplabel,
1026 struct mbuf *m, struct label *mlabel)
1036 test_netinet_fragment(struct mbuf *m, struct label *mlabel,
1037 struct mbuf *frag, struct label *fraglabel)
1047 test_netinet_icmp_reply(struct mbuf *mrecv, struct label *mrecvlabel,
1048 struct mbuf *msend, struct label *msendlabel)
1058 test_netinet_icmp_replyinplace(struct mbuf *m, struct label *mlabel)
1067 test_netinet_igmp_send(struct ifnet *ifp, struct label *ifplabel,
1068 struct mbuf *m, struct label *mlabel)
1078 test_netinet_tcp_reply(struct mbuf *m, struct label *mlabel)
1087 test_netinet6_nd6_send(struct ifnet *ifp, struct label *ifplabel,
1088 struct mbuf *m, struct label *mlabel)
1099 struct label *pplabel, unsigned long cmd, void /* caddr_t */ *data)
1112 struct label *pplabel)
1125 struct label *pplabel)
1138 struct label *pplabel, struct label *newlabel)
1152 struct label *pplabel)
1165 struct label *pplabel)
1177 test_pipe_copy_label(struct label *src, struct label *dest)
1188 struct label *pplabel)
1198 test_pipe_destroy_label(struct label *label)
1201 LABEL_DESTROY(label, MAGIC_PIPE);
1207 test_pipe_externalize_label(struct label *label, char *element_name,
1211 LABEL_CHECK(label, MAGIC_PIPE);
1219 test_pipe_init_label(struct label *label)
1222 LABEL_INIT(label, MAGIC_PIPE);
1228 test_pipe_internalize_label(struct label *label, char *element_name,
1232 LABEL_CHECK(label, MAGIC_PIPE);
1241 struct label *pplabel, struct label *newlabel)
1253 struct ksem *ks, struct label *kslabel)
1267 struct label *kslabel)
1280 struct ksem *ks, struct label *kslabel)
1294 struct label *kslabel, mode_t mode)
1306 struct label *kslabel, uid_t uid, gid_t gid)
1318 struct ucred *file_cred, struct ksem *ks, struct label *kslabel)
1331 struct label *kslabel)
1344 struct ksem *ks, struct label *kslabel)
1358 struct label *kslabel)
1368 test_posixsem_destroy_label(struct label *label)
1371 LABEL_DESTROY(label, MAGIC_POSIX_SEM);
1377 test_posixsem_init_label(struct label *label)
1380 LABEL_INIT(label, MAGIC_POSIX_SEM);
1396 struct label *shmfdlabel, int prot, int flags)
1408 struct label *shmfdlabel, accmode_t accmode)
1420 struct ucred *file_cred, struct shmfd *shm, struct label *shmlabel)
1435 struct label *shmfdlabel, mode_t mode)
1447 struct label *shmfdlabel, uid_t uid, gid_t gid)
1459 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmfdlabel)
1472 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmfdlabel)
1485 struct label *shmfdlabel)
1497 struct ucred *file_cred, struct shmfd *shm, struct label *shmlabel)
1512 struct label *shmfdlabel)
1522 test_posixshm_destroy_label(struct label *label)
1525 LABEL_DESTROY(label, MAGIC_POSIX_SHM);
1531 test_posixshm_init_label(struct label *label)
1534 LABEL_INIT(label, MAGIC_POSIX_SHM);
1588 test_proc_destroy_label(struct label *label)
1591 LABEL_DESTROY(label, MAGIC_PROC);
1597 test_proc_init_label(struct label *label)
1600 LABEL_INIT(label, MAGIC_PROC);
1607 struct label *solabel)
1622 struct label *solabel, struct sockaddr *sa)
1637 struct label *solabel, struct sockaddr *sa)
1651 test_socket_check_deliver(struct socket *so, struct label *solabel,
1652 struct mbuf *m, struct label *mlabel)
1667 struct label *solabel)
1682 struct label *solabel)
1697 struct label *solabel)
1712 struct label *solabel, struct label *newlabel)
1728 struct label *solabel)
1743 struct label *solabel)
1758 struct label *solabel)
1772 test_socket_copy_label(struct label *src, struct label *dest)
1783 struct label *solabel)
1793 test_socket_create_mbuf(struct socket *so, struct label *solabel,
1794 struct mbuf *m, struct label *mlabel)
1806 test_socket_destroy_label(struct label *label)
1809 LABEL_DESTROY(label, MAGIC_SOCKET);
1815 test_socket_externalize_label(struct label *label, char *element_name,
1819 LABEL_CHECK(label, MAGIC_SOCKET);
1827 test_socket_init_label(struct label *label, int flag)
1835 LABEL_INIT(label, MAGIC_SOCKET);
1842 test_socket_internalize_label(struct label *label, char *element_name,
1846 LABEL_CHECK(label, MAGIC_SOCKET);
1854 test_socket_newconn(struct socket *oldso, struct label *oldsolabel,
1855 struct socket *newso, struct label *newsolabel)
1870 struct label *solabel, struct label *newlabel)
1883 test_socketpeer_destroy_label(struct label *label)
1886 LABEL_DESTROY(label, MAGIC_SOCKET);
1892 test_socketpeer_externalize_label(struct label *label, char *element_name,
1896 LABEL_CHECK(label, MAGIC_SOCKET);
1904 test_socketpeer_init_label(struct label *label, int flag)
1912 LABEL_INIT(label, MAGIC_SOCKET);
1919 test_socketpeer_set_from_mbuf(struct mbuf *m, struct label *mlabel,
1920 struct socket *so, struct label *sopeerlabel)
1933 struct label *oldsolabel, struct socket *newso,
1934 struct label *newsopeerlabel)
1948 test_syncache_create(struct label *label, struct inpcb *inp)
1951 LABEL_CHECK(label, MAGIC_SYNCACHE);
1957 test_syncache_create_mbuf(struct label *sc_label, struct mbuf *m,
1958 struct label *mlabel)
1968 test_syncache_destroy_label(struct label *label)
1971 LABEL_DESTROY(label, MAGIC_SYNCACHE);
1977 test_syncache_init_label(struct label *label, int flag)
1984 LABEL_INIT(label, MAGIC_SYNCACHE);
1992 struct label *vplabel)
2016 struct label *vplabel)
2051 struct label *vplabel)
2064 struct label *vplabel)
2088 test_sysvmsg_cleanup(struct label *msglabel)
2098 struct label *msqlabel, struct msg *msgptr, struct label *msglabel)
2108 test_sysvmsg_destroy_label(struct label *label)
2111 LABEL_DESTROY(label, MAGIC_SYSV_MSG);
2117 test_sysvmsg_init_label(struct label *label)
2119 LABEL_INIT(label, MAGIC_SYSV_MSG);
2126 struct label *msglabel, struct msqid_kernel *msqkptr,
2127 struct label *msqklabel)
2141 struct label *msglabel)
2154 struct label *msglabel)
2167 struct msqid_kernel *msqkptr, struct label *msqklabel)
2180 struct msqid_kernel *msqkptr, struct label *msqklabel)
2193 struct msqid_kernel *msqkptr, struct label *msqklabel)
2206 struct msqid_kernel *msqkptr, struct label *msqklabel, int cmd)
2218 test_sysvmsq_cleanup(struct label *msqlabel)
2228 struct msqid_kernel *msqkptr, struct label *msqlabel)
2237 test_sysvmsq_destroy_label(struct label *label)
2240 LABEL_DESTROY(label, MAGIC_SYSV_MSQ);
2246 test_sysvmsq_init_label(struct label *label)
2248 LABEL_INIT(label, MAGIC_SYSV_MSQ);
2255 struct semid_kernel *semakptr, struct label *semaklabel, int cmd)
2268 struct semid_kernel *semakptr, struct label *semaklabel)
2281 struct semid_kernel *semakptr, struct label *semaklabel, size_t accesstype)
2293 test_sysvsem_cleanup(struct label *semalabel)
2303 struct label *semalabel)
2312 test_sysvsem_destroy_label(struct label *label)
2315 LABEL_DESTROY(label, MAGIC_SYSV_SEM);
2321 test_sysvsem_init_label(struct label *label)
2323 LABEL_INIT(label, MAGIC_SYSV_SEM);
2330 struct shmid_kernel *shmsegptr, struct label *shmseglabel, int shmflg)
2343 struct shmid_kernel *shmsegptr, struct label *shmseglabel, int cmd)
2356 struct shmid_kernel *shmsegptr, struct label *shmseglabel)
2369 struct shmid_kernel *shmsegptr, struct label *shmseglabel, int shmflg)
2381 test_sysvshm_cleanup(struct label *shmlabel)
2391 struct label *shmlabel)
2400 test_sysvshm_destroy_label(struct label *label)
2403 LABEL_DESTROY(label, MAGIC_SYSV_SHM);
2409 test_sysvshm_init_label(struct label *label)
2411 LABEL_INIT(label, MAGIC_SYSV_SHM);
2425 test_vnode_associate_extattr(struct mount *mp, struct label *mplabel,
2426 struct vnode *vp, struct label *vplabel)
2438 test_vnode_associate_singlelabel(struct mount *mp, struct label *mplabel,
2439 struct vnode *vp, struct label *vplabel)
2450 struct label *vplabel, accmode_t accmode)
2463 struct label *dvplabel)
2476 struct label *dvplabel)
2489 struct label *dvplabel, struct componentname *cnp, struct vattr *vap)
2502 struct label *vplabel, acl_type_t type)
2515 struct label *vplabel, int attrnamespace, const char *name)
2528 struct label *vplabel, struct image_params *imgp,
2529 struct label *execlabel)
2543 struct label *vplabel, acl_type_t type)
2556 struct label *vplabel, int attrnamespace, const char *name)
2569 struct label *dvplabel, struct vnode *vp, struct label *vplabel,
2584 struct label *vplabel, int attrnamespace)
2597 struct label *dvplabel, struct componentname *cnp)
2610 struct label *vplabel, int prot, int flags)
2623 struct label *vplabel, accmode_t accmode)
2636 struct vnode *vp, struct label *vplabel)
2651 struct vnode *vp, struct label *vplabel)
2666 struct label *dvplabel)
2679 struct label *vplabel)
2692 struct label *vplabel, struct label *newlabel)
2706 struct label *dvplabel, struct vnode *vp, struct label *vplabel,
2721 struct label *dvplabel, struct vnode *vp, struct label *vplabel,
2736 struct label *vplabel)
2749 struct label *vplabel, acl_type_t type, struct acl *acl)
2762 struct label *vplabel, int attrnamespace, const char *name)
2775 struct label *vplabel, u_long flags)
2788 struct label *vplabel, mode_t mode)
2801 struct label *vplabel, uid_t uid, gid_t gid)
2814 struct label *vplabel, struct timespec atime, struct timespec mtime)
2827 struct vnode *vp, struct label *vplabel)
2842 struct label *dvplabel, struct vnode *vp, struct label *vplabel,
2857 struct ucred *file_cred, struct vnode *vp, struct label *vplabel)
2871 test_vnode_copy_label(struct label *src, struct label *dest)
2882 struct label *mplabel, struct vnode *dvp, struct label *dvplabel,
2883 struct vnode *vp, struct label *vplabel, struct componentname *cnp)
2896 test_vnode_destroy_label(struct label *label)
2899 LABEL_DESTROY(label, MAGIC_VNODE);
2906 struct vnode *vp, struct label *filelabel,
2907 struct label *interpvplabel, struct image_params *imgp,
2908 struct label *execlabel)
2922 struct label *filelabel, struct label *interpvplabel,
2923 struct image_params *imgp, struct label *execlabel)
2937 test_vnode_externalize_label(struct label *label, char *element_name,
2941 LABEL_CHECK(label, MAGIC_VNODE);
2949 test_vnode_init_label(struct label *label)
2952 LABEL_INIT(label, MAGIC_VNODE);
2958 test_vnode_internalize_label(struct label *label, char *element_name,
2962 LABEL_CHECK(label, MAGIC_VNODE);
2971 struct label *vplabel, struct label *label)
2976 LABEL_CHECK(label, MAGIC_VNODE);
2983 struct label *vplabel, struct label *intlabel)