Lines Matching defs:mac
69 * found in src/sys/mac/. Sample policies may be found in src/sys/mac*.
101 #include <security/mac.h>
123 SYSCTL_NODE(_security, OID_AUTO, mac, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
1086 mac_check_structmac_consistent(struct user_mac *mac)
1089 if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN || mac->m_buflen == 0)
1285 struct user_mac mac;
1293 error = copyin(uap->mac_p, &mac, sizeof(mac));
1295 struct mac mac32;
1297 mac.m_buflen = mac32.m_buflen;
1298 mac.m_string = CAST_USER_ADDR_T(mac32.m_string);
1303 error = mac_check_structmac_consistent(&mac);
1313 MALLOC(elements, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1314 error = copyinstr(mac.m_string, elements, mac.m_buflen, &ulen);
1322 MALLOC(buffer, char *, mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO);
1324 buffer, mac.m_buflen, M_WAITOK);
1326 error = copyout(buffer, mac.m_string, strlen(buffer)+1);
1338 struct user_mac mac;
1344 error = copyin(uap->mac_p, &mac, sizeof(mac));
1346 struct mac mac32;
1348 mac.m_buflen = mac32.m_buflen;
1349 mac.m_string = CAST_USER_ADDR_T(mac32.m_string);
1354 error = mac_check_structmac_consistent(&mac);
1358 MALLOC(elements, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1359 error = copyinstr(mac.m_string, elements, mac.m_buflen, &ulen);
1368 MALLOC(buffer, char *, mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO);
1370 elements, buffer, mac.m_buflen, M_WAITOK);
1372 error = copyout(buffer, mac.m_string, strlen(buffer)+1);
1389 struct user_mac mac;
1395 error = copyin(uap->mac_p, &mac, sizeof(mac));
1397 struct mac mac32;
1399 mac.m_buflen = mac32.m_buflen;
1400 mac.m_string = CAST_USER_ADDR_T(mac32.m_string);
1405 error = mac_check_structmac_consistent(&mac);
1409 MALLOC(buffer, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1410 error = copyinstr(mac.m_string, buffer, mac.m_buflen, &ulen);
1454 struct user_mac mac;
1461 error = copyin(uap->mac_p, &mac, sizeof(mac));
1463 struct mac mac32;
1465 mac.m_buflen = mac32.m_buflen;
1466 mac.m_string = CAST_USER_ADDR_T(mac32.m_string);
1472 error = mac_check_structmac_consistent(&mac);
1480 MALLOC(elements, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1481 error = copyinstr(mac.m_string, elements, mac.m_buflen, &ulen);
1488 MALLOC(buffer, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1490 buffer, mac.m_buflen);
1492 error = copyout(buffer, mac.m_string, strlen(buffer)+1);
1504 struct user_mac mac;
1509 error = copyin(uap->mac_p, &mac, sizeof(mac));
1511 struct mac mac32;
1513 mac.m_buflen = mac32.m_buflen;
1514 mac.m_string = CAST_USER_ADDR_T(mac32.m_string);
1520 error = mac_check_structmac_consistent(&mac);
1524 MALLOC(elements, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1525 error = copyinstr(mac.m_string, elements, mac.m_buflen, &ulen);
1531 MALLOC(buffer, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1541 elements, buffer, mac.m_buflen);
1544 error = copyout(buffer, mac.m_string, strlen(buffer)+1);
1555 struct user_mac mac;
1562 error = copyin(uap->mac_p, &mac, sizeof(mac));
1564 struct mac mac32;
1566 mac.m_buflen = mac32.m_buflen;
1567 mac.m_string = CAST_USER_ADDR_T(mac32.m_string);
1572 error = mac_check_structmac_consistent(&mac);
1576 MALLOC(buffer, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1577 error = copyinstr(mac.m_string, buffer, mac.m_buflen, &ulen);
1638 struct user_mac mac;
1651 error = copyin(uap->mac_p, &mac, sizeof(mac));
1653 struct mac mac32;
1655 mac.m_buflen = mac32.m_buflen;
1656 mac.m_string = CAST_USER_ADDR_T(mac32.m_string);
1662 error = mac_check_structmac_consistent(&mac);
1666 MALLOC(elements, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1667 error = copyinstr(mac.m_string, elements, mac.m_buflen, &ulen);
1674 MALLOC(buffer, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1683 error = mac_file_check_get(my_cred, fp->f_fglob, elements, mac.m_buflen);
1703 mac.m_buflen, M_WAITOK);
1715 error = mac_socket_label_externalize(intlabel, elements, buffer, mac.m_buflen);
1731 error = copyout(buffer, mac.m_string, strlen(buffer)+1);
1749 struct user_mac mac;
1754 error = copyin(mac_p, &mac, sizeof(mac));
1756 struct mac mac32;
1758 mac.m_buflen = mac32.m_buflen;
1759 mac.m_string = CAST_USER_ADDR_T(mac32.m_string);
1765 error = mac_check_structmac_consistent(&mac);
1769 MALLOC(elements, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1770 error = copyinstr(mac.m_string, elements, mac.m_buflen, &ulen);
1794 MALLOC(buffer, char *, mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO);
1796 mac.m_buflen, M_WAITOK);
1800 error = copyout(buffer, mac.m_string, strlen(buffer) + 1);
1830 struct user_mac mac;
1844 error = copyin(uap->mac_p, &mac, sizeof(mac));
1846 struct mac mac32;
1848 mac.m_buflen = mac32.m_buflen;
1849 mac.m_string = CAST_USER_ADDR_T(mac32.m_string);
1854 error = mac_check_structmac_consistent(&mac);
1858 MALLOC(buffer, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1859 error = copyinstr(mac.m_string, buffer, mac.m_buflen, &ulen);
1873 error = mac_file_check_set(vfs_context_ucred(ctx), fp->f_fglob, buffer, mac.m_buflen);
1941 struct user_mac mac;
1947 error = copyin(mac_p, &mac, sizeof(mac));
1949 struct mac mac32;
1951 mac.m_buflen = mac32.m_buflen;
1952 mac.m_string = CAST_USER_ADDR_T(mac32.m_string);
1957 error = mac_check_structmac_consistent(&mac);
1963 MALLOC(buffer, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
1964 error = copyinstr(mac.m_string, buffer, mac.m_buflen, &ulen);
2072 struct user_mac mac;
2077 error = copyin(mac_p, &mac, sizeof(mac));
2079 struct mac mac32;
2081 mac.m_buflen = mac32.m_buflen;
2082 mac.m_string = CAST_USER_ADDR_T(mac32.m_string);
2087 error = mac_check_structmac_consistent(&mac);
2091 MALLOC(elements, char *, mac.m_buflen, M_MACTEMP, M_WAITOK);
2092 error = copyinstr(mac.m_string, elements, mac.m_buflen, &ulen);
2100 MALLOC(buffer, char *, mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO);
2102 mac.m_buflen);
2106 error = copyout(buffer, mac.m_string, strlen(buffer) + 1);