Lines Matching refs:error

56 	int error = 0;  in may_change_ptraced_domain()  local
69 error = aa_may_ptrace(tracer_cred, tracerl, to_cred, to_label, in may_change_ptraced_domain()
77 if (error) in may_change_ptraced_domain()
79 return error; in may_change_ptraced_domain()
258 int error; in label_match() local
261 error = label_compound_match(profile, label, stack, state, subns, in label_match()
263 if (!error) in label_match()
264 return error; in label_match()
672 int error = 0; in profile_transition() local
678 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer, in profile_transition()
680 if (error) { in profile_transition()
684 error = 0; in profile_transition()
708 info, error); in profile_transition()
747 error = -EACCES; in profile_transition()
755 error = -ENOMEM; in profile_transition()
758 error = -EACCES; in profile_transition()
764 error = -EACCES; in profile_transition()
783 cond->uid, info, error); in profile_transition()
786 return ERR_PTR(error); in profile_transition()
802 int error = -EACCES; in profile_onexec() local
819 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer, in profile_onexec()
821 if (error) { in profile_onexec()
825 error = 0; in profile_onexec()
842 error = change_profile_perms(profile, onexec, stack, AA_MAY_ONEXEC, in profile_onexec()
844 if (error) { in profile_onexec()
862 NULL, onexec, cond->uid, info, error); in profile_onexec()
876 int error; in handle_onexec() local
884 error = fn_for_each_in_ns(label, profile, in handle_onexec()
887 if (error) in handle_onexec()
888 return ERR_PTR(error); in handle_onexec()
900 error = fn_for_each_in_ns(label, profile, in handle_onexec()
906 return ERR_PTR(error); in handle_onexec()
925 int error = 0; in apparmor_bprm_creds_for_exec() local
955 error = -ENOMEM; in apparmor_bprm_creds_for_exec()
971 error = PTR_ERR(new); in apparmor_bprm_creds_for_exec()
974 error = -ENOMEM; in apparmor_bprm_creds_for_exec()
989 error = -EPERM; in apparmor_bprm_creds_for_exec()
1001 error = may_change_ptraced_domain(bprm->cred, new, &info); in apparmor_bprm_creds_for_exec()
1002 if (error) in apparmor_bprm_creds_for_exec()
1034 return error; in apparmor_bprm_creds_for_exec()
1037 error = fn_for_each(label, profile, in apparmor_bprm_creds_for_exec()
1041 vfsuid_into_kuid(vfsuid), info, error)); in apparmor_bprm_creds_for_exec()
1061 int error = 0; in build_change_hat() local
1069 error = -EPERM; in build_change_hat()
1075 error = -ENOENT; in build_change_hat()
1081 error = -ENOMEM; in build_change_hat()
1092 error); in build_change_hat()
1093 if (!hat || (error && error != -ENOENT)) in build_change_hat()
1094 return ERR_PTR(error); in build_change_hat()
1114 int i, error; in change_hat() local
1133 error = -EPERM; in change_hat()
1144 error = -EPERM; in change_hat()
1165 error = -ENOENT; in change_hat()
1170 error = -ECHILD; in change_hat()
1185 GLOBAL_ROOT_UID, info, error); in change_hat()
1188 return ERR_PTR(error); in change_hat()
1197 error = -ENOMEM; in change_hat()
1229 int error = 0; in aa_change_hat() local
1261 error = -EPERM; in aa_change_hat()
1270 error = PTR_ERR(new); in aa_change_hat()
1277 error = may_change_ptraced_domain(subj_cred, new, &info); in aa_change_hat()
1278 if (error) in aa_change_hat()
1290 error = -EPERM; in aa_change_hat()
1298 error = aa_set_current_hat(new, token); in aa_change_hat()
1299 if (error == -EACCES) in aa_change_hat()
1312 error = -EPERM; in aa_change_hat()
1320 error = aa_restore_previous_label(token); in aa_change_hat()
1321 if (error) { in aa_change_hat()
1322 if (error == -EACCES) in aa_change_hat()
1334 return error; in aa_change_hat()
1344 GLOBAL_ROOT_UID, info, error)); in aa_change_hat()
1358 int error = 0; in change_profile_perms_wrapper() local
1360 if (!error) in change_profile_perms_wrapper()
1361 error = change_profile_perms(profile, target, stack, request, in change_profile_perms_wrapper()
1364 if (error) in change_profile_perms_wrapper()
1365 error = aa_audit_file(subj_cred, profile, perms, op, request, in change_profile_perms_wrapper()
1368 error); in change_profile_perms_wrapper()
1370 return error; in change_profile_perms_wrapper()
1398 int error = 0; in aa_change_profile() local
1466 error = PTR_ERR(target); in aa_change_profile()
1480 error = -ENOMEM; in aa_change_profile()
1495 error = fn_for_each_in_ns(label, profile, in aa_change_profile()
1500 if (error) in aa_change_profile()
1508 error = may_change_ptraced_domain(subj_cred, target, &info); in aa_change_profile()
1509 if (error && !fn_for_each_in_ns(label, profile, in aa_change_profile()
1537 error = -EPERM; in aa_change_profile()
1549 error = -ENOMEM; in aa_change_profile()
1551 error = PTR_ERR(new); in aa_change_profile()
1556 error = aa_replace_current_label(new); in aa_change_profile()
1568 error = fn_for_each_in_ns(label, profile, in aa_change_profile()
1572 GLOBAL_ROOT_UID, info, error)); in aa_change_profile()
1580 return error; in aa_change_profile()