Home
last modified time | relevance | path

Searched refs:xperms (Results 1 – 20 of 20) 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.c1621 av_extended_perms_t *xperms) in find_avtab_node() argument
1632 if ((node->datum.xperms->specified == xperms->specified) && in find_avtab_node()
1633 (node->datum.xperms->driver == xperms->driver)) { in find_avtab_node()
1798 avtab_extended_perms_t *xperms = avdatump->xperms; in allocate_xperms() local
1799 if (!xperms) { in allocate_xperms()
1800 xperms = (avtab_extended_perms_t *) in allocate_xperms()
1802 if (!xperms) { in allocate_xperms()
1806 avdatump->xperms = xperms; in allocate_xperms()
1811 xperms->specified = AVTAB_XPERMS_IOCTLFUNCTION; in allocate_xperms()
1814 xperms->specified = AVTAB_XPERMS_IOCTLDRIVER; in allocate_xperms()
[all …]
Dkernel_to_cil.c1565 static char *xperms_to_str(avtab_extended_perms_t *xperms) in xperms_to_str() argument
1579 if ((xperms->specified != AVTAB_XPERMS_IOCTLFUNCTION) in xperms_to_str()
1580 && (xperms->specified != AVTAB_XPERMS_IOCTLDRIVER)) { in xperms_to_str()
1584 for (bit = 0; bit < sizeof(xperms->perms)*8; bit++) { in xperms_to_str()
1587 if (!xperm_test(bit, xperms->perms)) in xperms_to_str()
1590 if (in_range && next_bit_in_range(bit, xperms->perms)) { in xperms_to_str()
1593 } else if (next_bit_in_range(bit, xperms->perms)) { in xperms_to_str()
1600 if (xperms->specified & AVTAB_XPERMS_IOCTLFUNCTION) { in xperms_to_str()
1601 value = xperms->driver<<8 | bit; in xperms_to_str()
1602 low_value = xperms->driver<<8 | low_bit; in xperms_to_str()
[all …]
Dmodule_to_cil.c613 static int xperms_to_cil(const av_extended_perms_t *xperms) in xperms_to_cil() argument
622 if ((xperms->specified != AVTAB_XPERMS_IOCTLFUNCTION) in xperms_to_cil()
623 && (xperms->specified != AVTAB_XPERMS_IOCTLDRIVER)) in xperms_to_cil()
626 for (bit = 0; bit < sizeof(xperms->perms)*8; bit++) { in xperms_to_cil()
627 if (!xperm_test(bit, xperms->perms)) in xperms_to_cil()
630 if (in_range && next_bit_in_range(bit, xperms->perms)) { in xperms_to_cil()
633 } else if (next_bit_in_range(bit, xperms->perms)) { in xperms_to_cil()
645 if (xperms->specified & AVTAB_XPERMS_IOCTLFUNCTION) { in xperms_to_cil()
646 value = xperms->driver<<8 | bit; in xperms_to_cil()
647 low_value = xperms->driver<<8 | low_bit; in xperms_to_cil()
[all …]
Dwrite.c242 buf8 = cur->datum.xperms->specified; in avtab_write_item()
246 buf8 = cur->datum.xperms->driver; in avtab_write_item()
250 for (i = 0; i < ARRAY_SIZE(cur->datum.xperms->perms); i++) in avtab_write_item()
251 buf32[i] = cpu_to_le32(cur->datum.xperms->perms[i]); in avtab_write_item()
1691 size_t nel = ARRAY_SIZE(avrule->xperms->perms); in avrule_write()
1712 buf8 = avrule->xperms->specified; in avrule_write()
1716 buf8 = avrule->xperms->driver; in avrule_write()
1721 buf32[i] = cpu_to_le32(avrule->xperms->perms[i]); in avrule_write()
Dlink.c1329 if (cur->xperms) { in copy_avrule_list()
1330 new_rule->xperms = calloc(1, sizeof(*new_rule->xperms)); in copy_avrule_list()
1331 if (!new_rule->xperms) in copy_avrule_list()
1333 memcpy(new_rule->xperms, cur->xperms, in copy_avrule_list()
1334 sizeof(*new_rule->xperms)); in copy_avrule_list()
Dpolicydb.c597 free(x->xperms); in avrule_destroy()
3344 size_t nel = ARRAY_SIZE(avrule->xperms->perms); in avrule_read()
3363 avrule->xperms = calloc(1, sizeof(*avrule->xperms)); in avrule_read()
3364 if (!avrule->xperms) in avrule_read()
3372 avrule->xperms->specified = buf8; in avrule_read()
3378 avrule->xperms->driver = buf8; in avrule_read()
3385 avrule->xperms->perms[i] = le32_to_cpu(buf32[i]); in avrule_read()
Dkernel_to_conf.c1668 perms = sepol_extended_perms_to_string(datum->xperms); in avtab_node_to_str()
/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.c2055 avrule->xperms = NULL; in define_te_avtab_xperms_helper()
2156 av_extended_perms_t *xperms) in avrule_xperm_setrangebits() argument
2164 xperms->perms[i] |= ~0U; in avrule_xperm_setrangebits()
2167 xperms->perms[i] |= XPERM_SETBITS(h); in avrule_xperm_setrangebits()
2170 xperms->perms[i] |= ~0U - XPERM_SETBITS(low); in avrule_xperm_setrangebits()
2173 xperms->perms[i] |= XPERM_SETBITS(h) - XPERM_SETBITS(low); in avrule_xperm_setrangebits()
2177 int avrule_xperms_used(av_extended_perms_t *xperms) in avrule_xperms_used() argument
2181 for (i = 0; i < sizeof(xperms->perms)/sizeof(xperms->perms[0]); i++) { in avrule_xperms_used()
2182 if (xperms->perms[i]) in avrule_xperms_used()
2202 av_extended_perms_t *xperms; in avrule_ioctl_partialdriver() local
[all …]
Dpolicy_parse.y492 xperm_allow_def : ALLOWXPERM names names ':' names identifier xperms ';'
495 xperm_auditallow_def : AUDITALLOWXPERM names names ':' names identifier xperms ';'
498 xperm_dontaudit_def : DONTAUDITXPERM names names ':' names identifier xperms ';'
501 xperm_neverallow_def : NEVERALLOWXPERM names names ':' names identifier xperms ';'
788 xperms : xperm
/external/selinux/checkpolicy/test/
Ddismod.c293 avtab_extended_perms_t xperms; in display_avrule() local
296 if (avrule->xperms->specified == AVRULE_XPERMS_IOCTLFUNCTION) in display_avrule()
297 xperms.specified = AVTAB_XPERMS_IOCTLFUNCTION; in display_avrule()
298 else if (avrule->xperms->specified == AVRULE_XPERMS_IOCTLDRIVER) in display_avrule()
299 xperms.specified = AVTAB_XPERMS_IOCTLDRIVER; in display_avrule()
305 xperms.driver = avrule->xperms->driver; in display_avrule()
307 xperms.perms[i] = avrule->xperms->perms[i]; in display_avrule()
309 fprintf(fp, "%s", sepol_extended_perms_to_string(&xperms)); in display_avrule()
Ddispol.c158 fprintf(fp, "%s;\n", sepol_extended_perms_to_string(datum->xperms)); in render_av_rule()
/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.h291 av_extended_perms_t *xperms; member
/external/selinux/libsepol/cil/src/
Dcil_binary.c1580 void __avrule_xperm_setrangebits(uint16_t low, uint16_t high, struct avtab_extended_perms *xperms) in __avrule_xperm_setrangebits() argument
1588 xperms->perms[i] |= ~0U; in __avrule_xperm_setrangebits()
1591 xperms->perms[i] |= XPERM_SETBITS(h); in __avrule_xperm_setrangebits()
1594 xperms->perms[i] |= ~0U - XPERM_SETBITS(low); in __avrule_xperm_setrangebits()
1597 xperms->perms[i] |= XPERM_SETBITS(h) - XPERM_SETBITS(low); in __avrule_xperm_setrangebits()
1605 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
1618 ebitmap_for_each_bit(xperms, node, i) { in __cil_permx_bitmap_to_sepol_xperms_list()
1619 if (!ebitmap_get_bit(xperms, i)) continue; in __cil_permx_bitmap_to_sepol_xperms_list()
1627 if (IOC_FUNC(i) != 0xff && ebitmap_get_bit(xperms, i + 1)) { in __cil_permx_bitmap_to_sepol_xperms_list()
1703 avtab_datum.xperms = item->data; in __cil_avrulex_ioctl_to_policydb()
[all …]
Dcil_write_ast.c746 char *xperms = NULL; in cil_write_avrule_x() local
771 xperms = strdup(avrule->perms.x.permx_str); in cil_write_avrule_x()
772 if (xperms == NULL) { in cil_write_avrule_x()
778 rc = cil_unfill_permx(avrule->perms.x.permx, &xperms); in cil_write_avrule_x()
782 fprintf(cil_out, "(%s %s %s %s)\n", rulekind, src, tgt, xperms); in cil_write_avrule_x()
785 free(xperms); in cil_write_avrule_x()