Home
last modified time | relevance | path

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

12

/external/selinux/python/sepolgen/tests/
Dtest_policygen.py32 self.assertFalse(self.g.xperms)
38 self.assertTrue(self.g.xperms)
40 self.assertFalse(self.g.xperms)
67 av1.xperms['ioctl'] = refpolicy.XpermSet()
68 av1.xperms['ioctl'].add(42)
70 av2.xperms['ioctl'] = refpolicy.XpermSet()
71 av2.xperms['ioctl'].add(1234)
73 av3.xperms['ioctl'] = refpolicy.XpermSet()
74 av3.xperms['ioctl'].add(2345)
119 self.assertEqual(av_ext_rule1.xperms.ranges, xp1.ranges)
[all …]
Dtest_access.py35 self.assertTrue(isinstance(a.xperms, type({})))
169 b.xperms = {"ioctl": xp}
173 self.assertEqual(list(a.xperms.keys()), ["ioctl"])
174 self.assertEqual(a.xperms["ioctl"].to_string(), "{ 42 12345 }")
182 a.xperms = {"ioctl": xp}
187 self.assertEqual(list(a.xperms.keys()), ["ioctl"])
188 self.assertEqual(a.xperms["ioctl"].to_string(), "{ 42 12345 }")
195 a.xperms = {"asdf": xp1}
201 b.xperms = {"ioctl": xp2}
205 self.assertEqual(sorted(list(a.xperms.keys())), ["asdf", "ioctl"])
[all …]
Dtest_refpolicy.py191 self.assertIsInstance(a.xperms, refpolicy.XpermSet)
212 av.xperms = { "ioctl": xp }
221 self.assertIs(a.xperms, xp)
228 av.xperms = { "ioctl": xp }
237 self.assertIs(a.xperms, xp)
247 a.xperms.to_string = lambda: "seventh"
Dtest_audit.py220 self.assertEqual(av_list[0].xperms, {})
221 self.assertEqual(list(av_list[1].xperms), ["ioctl"])
222 self.assertEqual(av_list[1].xperms["ioctl"].ranges, [(66,66),
/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()
163 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.c1627 av_extended_perms_t *xperms) in find_avtab_node() argument
1638 if ((node->datum.xperms->specified == xperms->specified) && in find_avtab_node()
1639 (node->datum.xperms->driver == xperms->driver)) { in find_avtab_node()
1804 avtab_extended_perms_t *xperms = avdatump->xperms; in allocate_xperms() local
1805 if (!xperms) { in allocate_xperms()
1806 xperms = (avtab_extended_perms_t *) in allocate_xperms()
1808 if (!xperms) { in allocate_xperms()
1812 avdatump->xperms = xperms; in allocate_xperms()
1817 xperms->specified = AVTAB_XPERMS_IOCTLFUNCTION; in allocate_xperms()
1820 xperms->specified = AVTAB_XPERMS_IOCTLDRIVER; in allocate_xperms()
[all …]
Dkernel_to_cil.c1580 static char *xperms_to_str(avtab_extended_perms_t *xperms) in xperms_to_str() argument
1594 if ((xperms->specified != AVTAB_XPERMS_IOCTLFUNCTION) in xperms_to_str()
1595 && (xperms->specified != AVTAB_XPERMS_IOCTLDRIVER)) { in xperms_to_str()
1599 for (bit = 0; bit < sizeof(xperms->perms)*8; bit++) { in xperms_to_str()
1602 if (!xperm_test(bit, xperms->perms)) in xperms_to_str()
1605 if (in_range && next_bit_in_range(bit, xperms->perms)) { in xperms_to_str()
1608 } else if (next_bit_in_range(bit, xperms->perms)) { in xperms_to_str()
1615 if (xperms->specified & AVTAB_XPERMS_IOCTLFUNCTION) { in xperms_to_str()
1616 value = xperms->driver<<8 | bit; in xperms_to_str()
1618 low_value = xperms->driver<<8 | low_bit; in xperms_to_str()
[all …]
Dmodule_to_cil.c624 static int xperms_to_cil(const av_extended_perms_t *xperms) in xperms_to_cil() argument
633 if ((xperms->specified != AVTAB_XPERMS_IOCTLFUNCTION) in xperms_to_cil()
634 && (xperms->specified != AVTAB_XPERMS_IOCTLDRIVER)) in xperms_to_cil()
637 for (bit = 0; bit < sizeof(xperms->perms)*8; bit++) { in xperms_to_cil()
638 if (!xperm_test(bit, xperms->perms)) in xperms_to_cil()
641 if (in_range && next_bit_in_range(bit, xperms->perms)) { in xperms_to_cil()
644 } else if (next_bit_in_range(bit, xperms->perms)) { in xperms_to_cil()
656 if (xperms->specified & AVTAB_XPERMS_IOCTLFUNCTION) { in xperms_to_cil()
657 value = xperms->driver<<8 | bit; in xperms_to_cil()
659 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.c598 free(x->xperms); in avrule_destroy()
3355 size_t nel = ARRAY_SIZE(avrule->xperms->perms); in avrule_read()
3374 avrule->xperms = calloc(1, sizeof(*avrule->xperms)); in avrule_read()
3375 if (!avrule->xperms) in avrule_read()
3383 avrule->xperms->specified = buf8; in avrule_read()
3389 avrule->xperms->driver = buf8; in avrule_read()
3396 avrule->xperms->perms[i] = le32_to_cpu(buf32[i]); in avrule_read()
/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/python/sepolgen/src/sepolgen/
Daccess.py95 self.xperms = {}
141 for op in av.xperms:
142 if op not in self.xperms:
143 self.xperms[op] = refpolicy.XpermSet()
144 self.xperms[op].extend(av.xperms[op])
Dpolicygen.py86 self.xperms = False
125 def set_gen_xperms(self, xperms): argument
129 self.xperms = xperms
178 if av.xperms:
220 for op in av.xperms.keys():
246 if self.xperms and av.xperms:
Drefpolicy.py586 self.xperms = XpermSet()
609 self.xperms = av.xperms[op]
621 self.xperms.to_string())
/external/selinux/checkpolicy/
Dpolicy_define.c2063 avrule->xperms = NULL; in define_te_avtab_xperms_helper()
2164 av_extended_perms_t *xperms) in avrule_xperm_setrangebits() argument
2172 xperms->perms[i] |= ~0U; in avrule_xperm_setrangebits()
2175 xperms->perms[i] |= XPERM_SETBITS(h); in avrule_xperm_setrangebits()
2178 xperms->perms[i] |= ~0U - XPERM_SETBITS(low); in avrule_xperm_setrangebits()
2181 xperms->perms[i] |= XPERM_SETBITS(h) - XPERM_SETBITS(low); in avrule_xperm_setrangebits()
2185 int avrule_xperms_used(av_extended_perms_t *xperms) in avrule_xperms_used() argument
2189 for (i = 0; i < sizeof(xperms->perms)/sizeof(xperms->perms[0]); i++) { in avrule_xperms_used()
2190 if (xperms->perms[i]) in avrule_xperms_used()
2210 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/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/
Dpermissions.pass.cpp99 TestCase(path xp, perms xperms, perms xexpect, in TEST_CASE()
101 : p(xp), set_perms(xperms), expected(xexpect), opts(xopts) {} in TEST_CASE()
153 TestCase(perms xperms, perms xexpect, in TEST_CASE()
155 : set_perms(xperms), expected(xexpect), opts(xopts) {} in TEST_CASE()
/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()
/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
/external/selinux/libsepol/cil/src/
Dcil_binary.c1584 void __avrule_xperm_setrangebits(uint16_t low, uint16_t high, struct avtab_extended_perms *xperms) in __avrule_xperm_setrangebits() argument
1592 xperms->perms[i] |= ~0U; in __avrule_xperm_setrangebits()
1595 xperms->perms[i] |= XPERM_SETBITS(h); in __avrule_xperm_setrangebits()
1598 xperms->perms[i] |= ~0U - XPERM_SETBITS(low); in __avrule_xperm_setrangebits()
1601 xperms->perms[i] |= XPERM_SETBITS(h) - XPERM_SETBITS(low); in __avrule_xperm_setrangebits()
1609 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
1622 ebitmap_for_each_bit(xperms, node, i) { in __cil_permx_bitmap_to_sepol_xperms_list()
1623 if (!ebitmap_get_bit(xperms, i)) continue; in __cil_permx_bitmap_to_sepol_xperms_list()
1631 if (IOC_FUNC(i) != 0xff && ebitmap_get_bit(xperms, i + 1)) { in __cil_permx_bitmap_to_sepol_xperms_list()
1707 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()

12