Lines Matching defs:rc

759 	int rc = 0;
777 rc = -EINVAL;
786 rc = -EINVAL;
794 rc = -EINVAL;
802 rc = -EINVAL;
812 rc = -EPERM;
814 rc = security_validtrans_handle_fail(policy,
826 return rc;
860 int rc;
870 rc = -EINVAL;
878 rc = -EINVAL;
886 rc = 0;
897 rc = -EPERM;
902 rc = 0;
909 if (rc) {
931 return rc;
1268 int rc = sidtab_sid2str_get(sidtab, entry, scontext, scontext_len);
1270 if (rc != -ENOENT)
1271 return rc;
1273 rc = context_struct_to_string(p, &entry->context, scontext,
1275 if (!rc && scontext)
1277 return rc;
1285 int rc;
1295 rc = sidtab_hash_stats(policy->sidtab, page);
1298 return rc;
1316 int rc = 0;
1354 rc = -EINVAL;
1360 rc = sidtab_entry_to_string(policydb, sidtab, entry, scontext,
1365 return rc;
1425 int rc = 0;
1431 rc = -EINVAL;
1478 rc = mls_context_to_sid(pol, oldc, p, ctx, sidtabp, def_sid);
1479 if (rc)
1483 rc = -EINVAL;
1486 rc = 0;
1488 if (rc)
1490 return rc;
1502 int rc = 0;
1531 rc = -ENOMEM;
1541 rc = string_to_context_struct(policydb, sidtab, scontext2,
1543 if (rc == -EINVAL && force) {
1547 } else if (rc)
1549 rc = sidtab_context_to_sid(sidtab, &context, sid);
1550 if (rc == -ESTALE) {
1565 return rc;
1711 int rc = 0;
1750 rc = -EINVAL;
1757 rc = -EINVAL;
1857 rc = mls_compute_sid(policydb, scontext, tcontext, tclass, specified,
1859 if (rc)
1864 rc = compute_sid_handle_invalid_context(policy, sentry,
1867 if (rc)
1871 rc = sidtab_context_to_sid(sidtab, &newcontext, out_sid);
1872 if (rc == -ESTALE) {
1881 return rc;
1999 int rc;
2006 rc = string_to_context_struct(args->newp, NULL, s, newc, SECSID_NULL);
2007 if (rc == -EINVAL) {
2022 if (rc) {
2024 pr_err("SELinux: Unable to map context %s, rc = %d.\n",
2025 oldc->str, -rc);
2026 return rc;
2058 rc = mls_convert_context(args->oldp, args->newp, oldc, newc);
2059 if (rc)
2077 rc = mls_range_set(newc, &oc->context[0].range);
2078 if (rc)
2084 rc = convert_context_handle_invalid_context(args->oldp, oldc);
2085 if (rc)
2092 rc = context_struct_to_string(args->oldp, oldc, &s, &len);
2093 if (rc)
2094 return rc;
2245 int rc = 0;
2254 rc = -ENOMEM;
2258 rc = policydb_read(&newpolicy->policydb, fp);
2259 if (rc)
2263 rc = selinux_set_mapping(&newpolicy->policydb, secclass_map,
2265 if (rc)
2268 rc = policydb_load_isids(&newpolicy->policydb, newpolicy->sidtab);
2269 if (rc) {
2285 rc = security_preserve_bools(oldpolicy, newpolicy);
2286 if (rc) {
2298 rc = -ENOMEM;
2308 rc = sidtab_convert(oldpolicy->sidtab, &convert_data->sidtab_params);
2309 if (rc) {
2333 return rc;
2353 int rc;
2359 rc = sidtab_context_to_sid(sidtab, &c->context[index], &sid);
2360 if (rc)
2361 return rc;
2385 int rc;
2393 rc = 0;
2409 rc = ocontext_to_sid(sidtab, c, 0, out_sid);
2410 if (rc == -ESTALE) {
2414 if (rc)
2422 return rc;
2437 int rc;
2445 rc = 0;
2462 rc = ocontext_to_sid(sidtab, c, 0, out_sid);
2463 if (rc == -ESTALE) {
2467 if (rc)
2474 return rc;
2489 int rc;
2497 rc = 0;
2515 rc = ocontext_to_sid(sidtab, c, 0, out_sid);
2516 if (rc == -ESTALE) {
2520 if (rc)
2527 return rc;
2540 int rc;
2549 rc = 0;
2563 rc = ocontext_to_sid(sidtab, c, 0, if_sid);
2564 if (rc == -ESTALE) {
2568 if (rc)
2575 return rc;
2606 int rc;
2624 rc = -EINVAL;
2640 rc = -EINVAL;
2653 rc = 0;
2659 rc = ocontext_to_sid(sidtab, c, 0, out_sid);
2660 if (rc == -ESTALE) {
2664 if (rc)
2670 rc = 0;
2673 return rc;
2706 int rc;
2727 rc = -EINVAL;
2732 rc = -EINVAL;
2749 rc = sidtab_context_to_sid(sidtab, &usercon, &sid);
2750 if (rc == -ESTALE) {
2754 if (rc)
2759 rc = -ENOMEM;
2771 rc = 0;
2774 if (rc || !mynel) {
2776 return rc;
2779 rc = -ENOMEM;
2783 return rc;
2787 rc = avc_has_perm_noaudit(fromsid, mysids[i],
2791 if (!rc)
2909 int rc;
2935 rc = ocontext_to_sid(sidtab, c, 0, &sbsec->sid);
2936 if (rc == -ESTALE) {
2940 if (rc)
2943 rc = __security_genfs_sid(policy, fstype, "/",
2945 if (rc == -ESTALE) {
2949 if (rc) {
2951 rc = 0;
2959 return rc;
2967 int rc;
2974 rc = 0;
2979 rc = -ENOMEM;
2984 rc = -ENOMEM;
2992 rc = -ENOMEM;
2998 rc = 0;
3000 return rc;
3019 int rc;
3040 rc = cond_policydb_dup(&newpolicy->policydb, &oldpolicy->policydb);
3041 if (rc) {
3091 int rc;
3101 rc = -EFAULT;
3106 rc = policydb->bool_val_to_struct[index]->state;
3109 return rc;
3115 int rc, *bvalues = NULL;
3120 rc = security_get_bools(oldpolicy, &nbools, &bnames, &bvalues);
3121 if (rc)
3138 return rc;
3155 int rc;
3163 rc = 0;
3176 rc = -EINVAL;
3184 rc = -EINVAL;
3195 rc = mls_context_cpy(&newcon, context2);
3196 if (rc)
3201 rc = convert_context_handle_invalid_context(policydb,
3203 if (rc) {
3221 rc = sidtab_context_to_sid(sidtab, &newcon, new_sid);
3222 if (rc == -ESTALE) {
3230 return rc;
3261 int rc;
3296 rc = 0;
3300 rc = -EINVAL;
3307 rc = -EINVAL;
3314 rc = (mls_context_cmp(nlbl_ctx, xfrm_ctx) ? 0 : -EACCES);
3315 if (rc)
3326 return rc;
3346 int rc;
3350 rc = -ENOMEM;
3356 rc = hashtab_map(&policydb->p_classes.table, get_classes_callback,
3358 if (rc) {
3367 return rc;
3388 int rc;
3393 rc = -EINVAL;
3401 rc = -ENOMEM;
3408 rc = hashtab_map(&match->comdatum->permissions.table,
3410 if (rc)
3414 rc = hashtab_map(&match->permissions.table, get_permissions_callback,
3416 if (rc)
3420 return rc;
3426 return rc;
3472 int rc;
3479 rc = ebitmap_get_bit(&policy->policydb.policycaps, req_cap);
3482 return rc;
3511 int rc = 0;
3556 rc = -EINVAL;
3565 rc = -EINVAL;
3574 rc = -EINVAL;
3583 rc = mls_from_string(policydb, rulestr, &tmprule->au_ctxt,
3585 if (rc)
3598 return rc;
3812 int rc;
3822 rc = 0;
3833 rc = -EIDRM;
3844 rc = mls_import_netlbl_cat(policydb, &ctx_new, secattr);
3845 if (rc)
3848 rc = -EIDRM;
3854 rc = sidtab_context_to_sid(sidtab, &ctx_new, sid);
3856 if (rc == -ESTALE) {
3860 if (rc)
3869 return rc;
3886 int rc;
3896 rc = -ENOENT;
3901 rc = -ENOMEM;
3910 rc = mls_export_netlbl_cat(policydb, ctx, secattr);
3913 return rc;
3927 int rc;
3933 rc = policydb_write(&policy->policydb, &fp);
3934 if (rc)
3935 return rc;