Home
last modified time | relevance | path

Searched refs:xperms (Results 1 – 15 of 15) sorted by relevance

/external/selinux/libsepol/src/
Dutil.c125 char *sepol_extended_perms_to_string(avtab_extended_perms_t *xperms) in sepol_extended_perms_to_string() argument
138 if ((xperms->specified != AVTAB_XPERMS_IOCTLFUNCTION) in sepol_extended_perms_to_string()
139 && (xperms->specified != AVTAB_XPERMS_IOCTLDRIVER)) in sepol_extended_perms_to_string()
146 for (bit = 0; bit < sizeof(xperms->perms)*8; bit++) { in sepol_extended_perms_to_string()
147 if (!xperm_test(bit, xperms->perms)) in sepol_extended_perms_to_string()
150 if (in_range && next_bit_in_range(bit, xperms->perms)) { in sepol_extended_perms_to_string()
153 } else if (next_bit_in_range(bit, xperms->perms)) { in sepol_extended_perms_to_string()
160 if (xperms->specified & AVTAB_XPERMS_IOCTLFUNCTION) { in sepol_extended_perms_to_string()
161 value = xperms->driver<<8 | bit; in sepol_extended_perms_to_string()
162 low_value = xperms->driver<<8 | low_bit; in sepol_extended_perms_to_string()
[all …]
Davtab.c96 avtab_extended_perms_t *xperms; in avtab_insert_node() local
105 xperms = calloc(1, sizeof(avtab_extended_perms_t)); in avtab_insert_node()
106 if (xperms == NULL) { in avtab_insert_node()
110 if (datum->xperms) /* else caller populates xperms */ in avtab_insert_node()
111 *xperms = *(datum->xperms); in avtab_insert_node()
113 newnode->datum.xperms = xperms; in avtab_insert_node()
318 free(cur->datum.xperms); in avtab_destroy()
442 avtab_extended_perms_t xperms; in avtab_read_item() local
449 memset(&xperms, 0, sizeof(avtab_extended_perms_t)); in avtab_read_item()
553 xperms.specified = buf8; in avtab_read_item()
[all …]
Dassertion.c148 avtab_extended_perms_t *xperms; in report_assertion_extended_permissions() local
171 xperms = node->datum.xperms; in report_assertion_extended_permissions()
172 if ((xperms->specified != AVTAB_XPERMS_IOCTLFUNCTION) in report_assertion_extended_permissions()
173 && (xperms->specified != AVTAB_XPERMS_IOCTLDRIVER)) in report_assertion_extended_permissions()
176 rc = check_extended_permissions(avrule->xperms, xperms); in report_assertion_extended_permissions()
179 extended_permissions_violated(&error, avrule->xperms, xperms); in report_assertion_extended_permissions()
337 avtab_extended_perms_t *xperms; in check_assertion_extended_permissions_avtab() local
338 av_extended_perms_t *neverallow_xperms = avrule->xperms; in check_assertion_extended_permissions_avtab()
359 xperms = node->datum.xperms; in check_assertion_extended_permissions_avtab()
361 if ((xperms->specified != AVTAB_XPERMS_IOCTLFUNCTION) in check_assertion_extended_permissions_avtab()
[all …]
Dexpand.c1620 av_extended_perms_t *xperms) in find_avtab_node() argument
1631 if ((node->datum.xperms->specified == xperms->specified) && in find_avtab_node()
1632 (node->datum.xperms->driver == xperms->driver)) { in find_avtab_node()
1797 avtab_extended_perms_t *xperms = avdatump->xperms; in allocate_xperms() local
1798 if (!xperms) { in allocate_xperms()
1799 xperms = (avtab_extended_perms_t *) in allocate_xperms()
1801 if (!xperms) { in allocate_xperms()
1805 avdatump->xperms = xperms; in allocate_xperms()
1810 xperms->specified = AVTAB_XPERMS_IOCTLFUNCTION; in allocate_xperms()
1813 xperms->specified = AVTAB_XPERMS_IOCTLDRIVER; in allocate_xperms()
[all …]
Dmodule_to_cil.c611 static int xperms_to_cil(const av_extended_perms_t *xperms) in xperms_to_cil() argument
620 if ((xperms->specified != AVTAB_XPERMS_IOCTLFUNCTION) in xperms_to_cil()
621 && (xperms->specified != AVTAB_XPERMS_IOCTLDRIVER)) in xperms_to_cil()
624 for (bit = 0; bit < sizeof(xperms->perms)*8; bit++) { in xperms_to_cil()
625 if (!xperm_test(bit, xperms->perms)) in xperms_to_cil()
628 if (in_range && next_bit_in_range(bit, xperms->perms)) { in xperms_to_cil()
631 } else if (next_bit_in_range(bit, xperms->perms)) { in xperms_to_cil()
643 if (xperms->specified & AVTAB_XPERMS_IOCTLFUNCTION) { in xperms_to_cil()
644 value = xperms->driver<<8 | bit; in xperms_to_cil()
645 low_value = xperms->driver<<8 | low_bit; in xperms_to_cil()
[all …]
Dwrite.c240 buf8 = cur->datum.xperms->specified; in avtab_write_item()
244 buf8 = cur->datum.xperms->driver; in avtab_write_item()
248 for (i = 0; i < ARRAY_SIZE(cur->datum.xperms->perms); i++) in avtab_write_item()
249 buf32[i] = cpu_to_le32(cur->datum.xperms->perms[i]); in avtab_write_item()
/external/selinux/prebuilts/bin/
Dsesearch.py172 if args.xperms:
173 xperms = [] variable
174 for item in args.xperms.split(","):
177 xperms.append((int(rng[0], base=16), int(rng[1], base=16)))
179 xperms.append((int(rng[0], base=16), int(rng[0], base=16)))
184 q.xperms = xperms
/external/selinux/checkpolicy/
Dpolicy_define.c1970 avrule->xperms = NULL; in define_te_avtab_xperms_helper()
2071 av_extended_perms_t *xperms) in avrule_xperm_setrangebits() argument
2079 xperms->perms[i] |= ~0U; in avrule_xperm_setrangebits()
2082 xperms->perms[i] |= XPERM_SETBITS(h); in avrule_xperm_setrangebits()
2085 xperms->perms[i] |= ~0U - XPERM_SETBITS(low); in avrule_xperm_setrangebits()
2088 xperms->perms[i] |= XPERM_SETBITS(h) - XPERM_SETBITS(low); in avrule_xperm_setrangebits()
2092 int avrule_xperms_used(av_extended_perms_t *xperms) in avrule_xperms_used() argument
2096 for (i = 0; i < sizeof(xperms->perms)/sizeof(xperms->perms[0]); i++) { in avrule_xperms_used()
2097 if (xperms->perms[i]) in avrule_xperms_used()
2117 av_extended_perms_t *xperms; in avrule_ioctl_partialdriver() local
[all …]
Dpolicy_parse.y484 xperm_allow_def : ALLOWXPERM names names ':' names identifier xperms ';'
487 xperm_auditallow_def : AUDITALLOWXPERM names names ':' names identifier xperms ';'
490 xperm_dontaudit_def : DONTAUDITXPERM names names ':' names identifier xperms ';'
493 xperm_neverallow_def : NEVERALLOWXPERM names names ':' names identifier xperms ';'
760 xperms : xperm
/external/selinux/libsepol/include/sepol/policydb/
Dutil.h35 char *sepol_extended_perms_to_string(avtab_extended_perms_t *xperms);
Davtab.h85 avtab_extended_perms_t *xperms; member
Dpolicydb.h284 av_extended_perms_t *xperms; member
/external/selinux/libsepol/cil/src/
Dcil_binary.c1562 void __avrule_xperm_setrangebits(uint16_t low, uint16_t high, struct avtab_extended_perms *xperms) in __avrule_xperm_setrangebits() argument
1570 xperms->perms[i] |= ~0U; in __avrule_xperm_setrangebits()
1573 xperms->perms[i] |= XPERM_SETBITS(h); in __avrule_xperm_setrangebits()
1576 xperms->perms[i] |= ~0U - XPERM_SETBITS(low); in __avrule_xperm_setrangebits()
1579 xperms->perms[i] |= XPERM_SETBITS(h) - XPERM_SETBITS(low); in __avrule_xperm_setrangebits()
1587 int __cil_permx_bitmap_to_sepol_xperms_list(ebitmap_t *xperms, struct cil_list **xperms_list) in __cil_permx_bitmap_to_sepol_xperms_list() argument
1600 ebitmap_for_each_bit(xperms, node, i) { in __cil_permx_bitmap_to_sepol_xperms_list()
1601 if (!ebitmap_get_bit(xperms, i)) continue; in __cil_permx_bitmap_to_sepol_xperms_list()
1609 if (IOC_FUNC(i) != 0xff && ebitmap_get_bit(xperms, i + 1)) { in __cil_permx_bitmap_to_sepol_xperms_list()
1685 avtab_datum.xperms = item->data; in __cil_avrulex_ioctl_to_policydb()
[all …]
Dcil_write_ast.c728 char *xperms = NULL; in cil_write_avrule_x() local
753 xperms = strdup(avrule->perms.x.permx_str); in cil_write_avrule_x()
754 if (xperms == NULL) { in cil_write_avrule_x()
760 rc = cil_unfill_permx(avrule->perms.x.permx, &xperms); in cil_write_avrule_x()
764 fprintf(cil_out, "(%s %s %s %s)\n", rulekind, src, tgt, xperms); in cil_write_avrule_x()
767 free(xperms); in cil_write_avrule_x()
/external/selinux/checkpolicy/test/
Ddispol.c158 fprintf(fp, "%s;\n", sepol_extended_perms_to_string(datum->xperms)); in render_av_rule()