Lines Matching refs:fp

976 static int mls_read_range_helper(struct mls_range *r, void *fp)  in mls_read_range_helper()  argument
982 rc = next_entry(buf, fp, sizeof(u32)); in mls_read_range_helper()
993 rc = next_entry(buf, fp, sizeof(u32) * items); in mls_read_range_helper()
1005 rc = ebitmap_read(&r->level[0].cat, fp); in mls_read_range_helper()
1011 rc = ebitmap_read(&r->level[1].cat, fp); in mls_read_range_helper()
1037 void *fp) in context_read_and_validate() argument
1042 rc = next_entry(buf, fp, sizeof buf); in context_read_and_validate()
1051 rc = mls_read_range_helper(&c->range, fp); in context_read_and_validate()
1075 static int str_read(char **strp, gfp_t flags, void *fp, u32 len) in str_read() argument
1087 rc = next_entry(str, fp, len); in str_read()
1098 static int perm_read(struct policydb *p, struct symtab *s, void *fp) in perm_read() argument
1110 rc = next_entry(buf, fp, sizeof buf); in perm_read()
1117 rc = str_read(&key, GFP_KERNEL, fp, len); in perm_read()
1131 static int common_read(struct policydb *p, struct symtab *s, void *fp) in common_read() argument
1143 rc = next_entry(buf, fp, sizeof buf); in common_read()
1156 rc = str_read(&key, GFP_KERNEL, fp, len); in common_read()
1161 rc = perm_read(p, &comdatum->permissions, fp); in common_read()
1181 static int type_set_read(struct type_set *t, void *fp) in type_set_read() argument
1186 if (ebitmap_read(&t->types, fp)) in type_set_read()
1188 if (ebitmap_read(&t->negset, fp)) in type_set_read()
1191 rc = next_entry(buf, fp, sizeof(u32)); in type_set_read()
1202 int ncons, int allowxtarget, void *fp) in read_cons_helper() argument
1221 rc = next_entry(buf, fp, (sizeof(u32) * 2)); in read_cons_helper()
1238 rc = next_entry(buf, fp, (sizeof(u32) * 3)); in read_cons_helper()
1267 rc = ebitmap_read(&e->names, fp); in read_cons_helper()
1277 rc = type_set_read(e->type_names, fp); in read_cons_helper()
1295 static int class_read(struct policydb *p, struct symtab *s, void *fp) in class_read() argument
1307 rc = next_entry(buf, fp, sizeof(u32)*6); in class_read()
1323 rc = str_read(&key, GFP_KERNEL, fp, len); in class_read()
1328 rc = str_read(&cladatum->comkey, GFP_KERNEL, fp, len2); in class_read()
1342 rc = perm_read(p, &cladatum->permissions, fp); in class_read()
1347 rc = read_cons_helper(p, &cladatum->constraints, ncons, 0, fp); in class_read()
1353 rc = next_entry(buf, fp, sizeof(u32)); in class_read()
1358 ncons, 1, fp); in class_read()
1364 rc = next_entry(buf, fp, sizeof(u32) * 3); in class_read()
1374 rc = next_entry(buf, fp, sizeof(u32) * 1); in class_read()
1390 static int role_read(struct policydb *p, struct symtab *s, void *fp) in role_read() argument
1405 rc = next_entry(buf, fp, sizeof(buf[0]) * to_read); in role_read()
1414 rc = str_read(&key, GFP_KERNEL, fp, len); in role_read()
1418 rc = ebitmap_read(&role->dominates, fp); in role_read()
1422 rc = ebitmap_read(&role->types, fp); in role_read()
1446 static int type_read(struct policydb *p, struct symtab *s, void *fp) in type_read() argument
1461 rc = next_entry(buf, fp, sizeof(buf[0]) * to_read); in type_read()
1480 rc = str_read(&key, GFP_KERNEL, fp, len); in type_read()
1498 static int mls_read_level(struct mls_level *lp, void *fp) in mls_read_level() argument
1505 rc = next_entry(buf, fp, sizeof buf); in mls_read_level()
1512 rc = ebitmap_read(&lp->cat, fp); in mls_read_level()
1520 static int user_read(struct policydb *p, struct symtab *s, void *fp) in user_read() argument
1535 rc = next_entry(buf, fp, sizeof(buf[0]) * to_read); in user_read()
1544 rc = str_read(&key, GFP_KERNEL, fp, len); in user_read()
1548 rc = ebitmap_read(&usrdatum->roles, fp); in user_read()
1553 rc = mls_read_range_helper(&usrdatum->range, fp); in user_read()
1556 rc = mls_read_level(&usrdatum->dfltlevel, fp); in user_read()
1570 static int sens_read(struct policydb *p, struct symtab *s, void *fp) in sens_read() argument
1582 rc = next_entry(buf, fp, sizeof buf); in sens_read()
1589 rc = str_read(&key, GFP_ATOMIC, fp, len); in sens_read()
1598 rc = mls_read_level(levdatum->level, fp); in sens_read()
1611 static int cat_read(struct policydb *p, struct symtab *s, void *fp) in cat_read() argument
1623 rc = next_entry(buf, fp, sizeof buf); in cat_read()
1631 rc = str_read(&key, GFP_ATOMIC, fp, len); in cat_read()
1644 static int (*read_f[SYM_NUM]) (struct policydb *p, struct symtab *s, void *fp) =
1812 static int range_read(struct policydb *p, void *fp) in range_read() argument
1823 rc = next_entry(buf, fp, sizeof(u32)); in range_read()
1839 rc = next_entry(buf, fp, (sizeof(u32) * 2)); in range_read()
1846 rc = next_entry(buf, fp, sizeof(u32)); in range_read()
1864 rc = mls_read_range_helper(r, fp); in range_read()
1889 static int filename_trans_read_helper_compat(struct policydb *p, void *fp) in filename_trans_read_helper_compat() argument
1899 rc = next_entry(buf, fp, sizeof(u32)); in filename_trans_read_helper_compat()
1905 rc = str_read(&name, GFP_KERNEL, fp, len); in filename_trans_read_helper_compat()
1909 rc = next_entry(buf, fp, sizeof(u32) * 4); in filename_trans_read_helper_compat()
1973 static int filename_trans_read_helper(struct policydb *p, void *fp) in filename_trans_read_helper() argument
1983 rc = next_entry(buf, fp, sizeof(u32)); in filename_trans_read_helper()
1989 rc = str_read(&name, GFP_KERNEL, fp, len); in filename_trans_read_helper()
1993 rc = next_entry(buf, fp, sizeof(u32) * 3); in filename_trans_read_helper()
2017 rc = ebitmap_read(&datum->stypes, fp); in filename_trans_read_helper()
2021 rc = next_entry(buf, fp, sizeof(u32)); in filename_trans_read_helper()
2062 static int filename_trans_read(struct policydb *p, void *fp) in filename_trans_read() argument
2071 rc = next_entry(buf, fp, sizeof(u32)); in filename_trans_read()
2084 rc = filename_trans_read_helper_compat(p, fp); in filename_trans_read()
2094 rc = filename_trans_read_helper(p, fp); in filename_trans_read()
2103 static int genfs_read(struct policydb *p, void *fp) in genfs_read() argument
2113 rc = next_entry(buf, fp, sizeof(u32)); in genfs_read()
2119 rc = next_entry(buf, fp, sizeof(u32)); in genfs_read()
2129 rc = str_read(&newgenfs->fstype, GFP_KERNEL, fp, len); in genfs_read()
2152 rc = next_entry(buf, fp, sizeof(u32)); in genfs_read()
2158 rc = next_entry(buf, fp, sizeof(u32)); in genfs_read()
2168 rc = str_read(&newc->u.name, GFP_KERNEL, fp, len); in genfs_read()
2172 rc = next_entry(buf, fp, sizeof(u32)); in genfs_read()
2177 rc = context_read_and_validate(&newc->context[0], p, fp); in genfs_read()
2217 void *fp) in ocontext_read() argument
2227 rc = next_entry(buf, fp, sizeof(u32)); in ocontext_read()
2246 rc = next_entry(buf, fp, sizeof(u32)); in ocontext_read()
2251 rc = context_read_and_validate(&c->context[0], p, fp); in ocontext_read()
2257 rc = next_entry(buf, fp, sizeof(u32)); in ocontext_read()
2262 rc = str_read(&c->u.name, GFP_KERNEL, fp, len); in ocontext_read()
2266 rc = context_read_and_validate(&c->context[0], p, fp); in ocontext_read()
2269 rc = context_read_and_validate(&c->context[1], p, fp); in ocontext_read()
2274 rc = next_entry(buf, fp, sizeof(u32)*3); in ocontext_read()
2280 rc = context_read_and_validate(&c->context[0], p, fp); in ocontext_read()
2285 rc = next_entry(nodebuf, fp, sizeof(u32) * 2); in ocontext_read()
2290 rc = context_read_and_validate(&c->context[0], p, fp); in ocontext_read()
2295 rc = next_entry(buf, fp, sizeof(u32)*2); in ocontext_read()
2308 rc = str_read(&c->u.name, GFP_KERNEL, fp, len); in ocontext_read()
2312 rc = context_read_and_validate(&c->context[0], p, fp); in ocontext_read()
2319 rc = next_entry(nodebuf, fp, sizeof(u32) * 8); in ocontext_read()
2326 rc = context_read_and_validate(&c->context[0], p, fp); in ocontext_read()
2334 rc = next_entry(prefixbuf, fp, sizeof(u64)); in ocontext_read()
2341 rc = next_entry(buf, fp, sizeof(u32) * 2); in ocontext_read()
2358 fp); in ocontext_read()
2366 rc = next_entry(buf, fp, sizeof(u32) * 2); in ocontext_read()
2371 rc = str_read(&c->u.ibendport.dev_name, GFP_KERNEL, fp, len); in ocontext_read()
2385 fp); in ocontext_read()
2402 int policydb_read(struct policydb *p, void *fp) in policydb_read() argument
2417 rc = next_entry(buf, fp, sizeof(u32) * 2); in policydb_read()
2446 rc = next_entry(policydb_str, fp, len); in policydb_read()
2466 rc = next_entry(buf, fp, sizeof(u32)*4); in policydb_read()
2495 rc = ebitmap_read(&p->policycaps, fp); in policydb_read()
2501 rc = ebitmap_read(&p->permissive_map, fp); in policydb_read()
2525 rc = next_entry(buf, fp, sizeof(u32)*2); in policydb_read()
2542 rc = read_f[i](p, &p->symtab[i], fp); in policydb_read()
2557 rc = avtab_read(&p->te_avtab, fp, p); in policydb_read()
2562 rc = cond_read_list(p, fp); in policydb_read()
2567 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2586 rc = next_entry(buf, fp, sizeof(u32)*3); in policydb_read()
2594 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2616 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2630 rc = next_entry(buf, fp, sizeof(u32)*2); in policydb_read()
2643 rc = filename_trans_read(p, fp); in policydb_read()
2665 rc = ocontext_read(p, info, fp); in policydb_read()
2669 rc = genfs_read(p, fp); in policydb_read()
2673 rc = range_read(p, fp); in policydb_read()
2692 rc = ebitmap_read(e, fp); in policydb_read()
2720 static int mls_write_level(struct mls_level *l, void *fp) in mls_write_level() argument
2726 rc = put_entry(buf, sizeof(u32), 1, fp); in mls_write_level()
2730 rc = ebitmap_write(&l->cat, fp); in mls_write_level()
2741 static int mls_write_range_helper(struct mls_range *r, void *fp) in mls_write_range_helper() argument
2760 rc = put_entry(buf, sizeof(u32), items, fp); in mls_write_range_helper()
2764 rc = ebitmap_write(&r->level[0].cat, fp); in mls_write_range_helper()
2768 rc = ebitmap_write(&r->level[1].cat, fp); in mls_write_range_helper()
2781 void *fp = pd->fp; in sens_write() local
2789 rc = put_entry(buf, sizeof(u32), 2, fp); in sens_write()
2793 rc = put_entry(key, 1, len, fp); in sens_write()
2797 rc = mls_write_level(levdatum->level, fp); in sens_write()
2809 void *fp = pd->fp; in cat_write() local
2818 rc = put_entry(buf, sizeof(u32), 3, fp); in cat_write()
2822 rc = put_entry(key, 1, len, fp); in cat_write()
2834 void *fp = pd->fp; in role_trans_write_one() local
2842 rc = put_entry(buf, sizeof(u32), 3, fp); in role_trans_write_one()
2847 rc = put_entry(buf, sizeof(u32), 1, fp); in role_trans_write_one()
2854 static int role_trans_write(struct policydb *p, void *fp) in role_trans_write() argument
2856 struct policy_data pd = { .p = p, .fp = fp }; in role_trans_write()
2861 rc = put_entry(buf, sizeof(u32), 1, fp); in role_trans_write()
2868 static int role_allow_write(struct role_allow *r, void *fp) in role_allow_write() argument
2879 rc = put_entry(buf, sizeof(u32), 1, fp); in role_allow_write()
2885 rc = put_entry(buf, sizeof(u32), 2, fp); in role_allow_write()
2897 void *fp) in context_write() argument
2906 rc = put_entry(buf, sizeof(u32), 3, fp); in context_write()
2910 rc = mls_write_range_helper(&c->range, fp); in context_write()
2923 static int perm_write(void *vkey, void *datum, void *fp) in perm_write() argument
2934 rc = put_entry(buf, sizeof(u32), 2, fp); in perm_write()
2938 rc = put_entry(key, 1, len, fp); in perm_write()
2950 void *fp = pd->fp; in common_write() local
2960 rc = put_entry(buf, sizeof(u32), 4, fp); in common_write()
2964 rc = put_entry(key, 1, len, fp); in common_write()
2968 rc = hashtab_map(&comdatum->permissions.table, perm_write, fp); in common_write()
2975 static int type_set_write(struct type_set *t, void *fp) in type_set_write() argument
2980 if (ebitmap_write(&t->types, fp)) in type_set_write()
2982 if (ebitmap_write(&t->negset, fp)) in type_set_write()
2986 rc = put_entry(buf, sizeof(u32), 1, fp); in type_set_write()
2994 void *fp) in write_cons_helper() argument
3008 rc = put_entry(buf, sizeof(u32), 2, fp); in write_cons_helper()
3015 rc = put_entry(buf, sizeof(u32), 3, fp); in write_cons_helper()
3021 rc = ebitmap_write(&e->names, fp); in write_cons_helper()
3026 rc = type_set_write(e->type_names, fp); in write_cons_helper()
3045 void *fp = pd->fp; in class_write() local
3069 rc = put_entry(buf, sizeof(u32), 6, fp); in class_write()
3073 rc = put_entry(key, 1, len, fp); in class_write()
3078 rc = put_entry(cladatum->comkey, 1, len2, fp); in class_write()
3083 rc = hashtab_map(&cladatum->permissions.table, perm_write, fp); in class_write()
3087 rc = write_cons_helper(p, cladatum->constraints, fp); in class_write()
3097 rc = put_entry(buf, sizeof(u32), 1, fp); in class_write()
3101 rc = write_cons_helper(p, cladatum->validatetrans, fp); in class_write()
3110 rc = put_entry(buf, sizeof(uint32_t), 3, fp); in class_write()
3117 rc = put_entry(buf, sizeof(uint32_t), 1, fp); in class_write()
3130 void *fp = pd->fp; in role_write() local
3145 rc = put_entry(buf, sizeof(u32), items, fp); in role_write()
3149 rc = put_entry(key, 1, len, fp); in role_write()
3153 rc = ebitmap_write(&role->dominates, fp); in role_write()
3157 rc = ebitmap_write(&role->types, fp); in role_write()
3170 void *fp = pd->fp; in type_write() local
3194 rc = put_entry(buf, sizeof(u32), items, fp); in type_write()
3198 rc = put_entry(key, 1, len, fp); in type_write()
3211 void *fp = pd->fp; in user_write() local
3223 rc = put_entry(buf, sizeof(u32), items, fp); in user_write()
3227 rc = put_entry(key, 1, len, fp); in user_write()
3231 rc = ebitmap_write(&usrdatum->roles, fp); in user_write()
3235 rc = mls_write_range_helper(&usrdatum->range, fp); in user_write()
3239 rc = mls_write_level(&usrdatum->dfltlevel, fp); in user_write()
3260 void *fp) in ocontext_write() argument
3273 rc = put_entry(buf, sizeof(u32), 1, fp); in ocontext_write()
3280 rc = put_entry(buf, sizeof(u32), 1, fp); in ocontext_write()
3283 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3291 rc = put_entry(buf, sizeof(u32), 1, fp); in ocontext_write()
3294 rc = put_entry(c->u.name, 1, len, fp); in ocontext_write()
3297 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3300 rc = context_write(p, &c->context[1], fp); in ocontext_write()
3308 rc = put_entry(buf, sizeof(u32), 3, fp); in ocontext_write()
3311 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3318 rc = put_entry(nodebuf, sizeof(u32), 2, fp); in ocontext_write()
3321 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3329 rc = put_entry(buf, sizeof(u32), 2, fp); in ocontext_write()
3332 rc = put_entry(c->u.name, 1, len, fp); in ocontext_write()
3335 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3344 rc = put_entry(nodebuf, sizeof(u32), 8, fp); in ocontext_write()
3347 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3355 rc = put_entry(prefixbuf, sizeof(u64), 1, fp); in ocontext_write()
3362 rc = put_entry(buf, sizeof(u32), 2, fp); in ocontext_write()
3365 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3373 rc = put_entry(buf, sizeof(u32), 2, fp); in ocontext_write()
3376 rc = put_entry(c->u.ibendport.dev_name, 1, len, fp); in ocontext_write()
3379 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3389 static int genfs_write(struct policydb *p, void *fp) in genfs_write() argument
3401 rc = put_entry(buf, sizeof(u32), 1, fp); in genfs_write()
3407 rc = put_entry(buf, sizeof(u32), 1, fp); in genfs_write()
3410 rc = put_entry(genfs->fstype, 1, len, fp); in genfs_write()
3417 rc = put_entry(buf, sizeof(u32), 1, fp); in genfs_write()
3423 rc = put_entry(buf, sizeof(u32), 1, fp); in genfs_write()
3426 rc = put_entry(c->u.name, 1, len, fp); in genfs_write()
3430 rc = put_entry(buf, sizeof(u32), 1, fp); in genfs_write()
3433 rc = context_write(p, &c->context[0], fp); in genfs_write()
3447 void *fp = pd->fp; in range_write_helper() local
3453 rc = put_entry(buf, sizeof(u32), 2, fp); in range_write_helper()
3458 rc = put_entry(buf, sizeof(u32), 1, fp); in range_write_helper()
3462 rc = mls_write_range_helper(r, fp); in range_write_helper()
3469 static int range_write(struct policydb *p, void *fp) in range_write() argument
3476 pd.fp = fp; in range_write()
3479 rc = put_entry(buf, sizeof(u32), 1, fp); in range_write()
3496 void *fp = ptr; in filename_write_helper_compat() local
3504 rc = put_entry(buf, sizeof(u32), 1, fp); in filename_write_helper_compat()
3508 rc = put_entry(ft->name, sizeof(char), len, fp); in filename_write_helper_compat()
3517 rc = put_entry(buf, sizeof(u32), 4, fp); in filename_write_helper_compat()
3532 void *fp = ptr; in filename_write_helper() local
3538 rc = put_entry(buf, sizeof(u32), 1, fp); in filename_write_helper()
3542 rc = put_entry(ft->name, sizeof(char), len, fp); in filename_write_helper()
3556 rc = put_entry(buf, sizeof(u32), 3, fp); in filename_write_helper()
3562 rc = ebitmap_write(&datum->stypes, fp); in filename_write_helper()
3567 rc = put_entry(buf, sizeof(u32), 1, fp); in filename_write_helper()
3577 static int filename_trans_write(struct policydb *p, void *fp) in filename_trans_write() argument
3587 rc = put_entry(buf, sizeof(u32), 1, fp); in filename_trans_write()
3592 filename_write_helper_compat, fp); in filename_trans_write()
3595 rc = put_entry(buf, sizeof(u32), 1, fp); in filename_trans_write()
3599 rc = hashtab_map(&p->filename_trans, filename_write_helper, fp); in filename_trans_write()
3609 int policydb_write(struct policydb *p, void *fp) in policydb_write() argument
3644 rc = put_entry(buf, sizeof(u32), 2, fp); in policydb_write()
3647 rc = put_entry(POLICYDB_STRING, 1, len, fp); in policydb_write()
3664 rc = put_entry(buf, sizeof(u32), 4, fp); in policydb_write()
3669 rc = ebitmap_write(&p->policycaps, fp); in policydb_write()
3675 rc = ebitmap_write(&p->permissive_map, fp); in policydb_write()
3684 pd.fp = fp; in policydb_write()
3690 rc = put_entry(buf, sizeof(u32), 2, fp); in policydb_write()
3698 rc = avtab_write(p, &p->te_avtab, fp); in policydb_write()
3702 rc = cond_write_list(p, fp); in policydb_write()
3706 rc = role_trans_write(p, fp); in policydb_write()
3710 rc = role_allow_write(p->role_allow, fp); in policydb_write()
3714 rc = filename_trans_write(p, fp); in policydb_write()
3718 rc = ocontext_write(p, info, fp); in policydb_write()
3722 rc = genfs_write(p, fp); in policydb_write()
3726 rc = range_write(p, fp); in policydb_write()
3733 rc = ebitmap_write(e, fp); in policydb_write()