Commit c4cfbcd8 authored by John Johansen's avatar John Johansen Committed by Tim Gardner

Revert "UBUNTU: SAUCE: fix: audit "no_new_privs" case for exec failure"

BugLink: http://bugs.launchpad.net/bugs/1379535

This reverts commit b9eab948e47cad7504c32f5e6e6b65c97ff27345.
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent a4d2e2f9
......@@ -474,9 +474,9 @@ int apparmor_bprm_set_creds(struct linux_binprm *bprm)
* fail the exec.
*/
if (bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) {
aa_put_profile(new_profile);
error = -EPERM;
info = "no new privs";
goto audit;
goto cleanup;
}
if (!new_profile)
......@@ -489,8 +489,10 @@ int apparmor_bprm_set_creds(struct linux_binprm *bprm)
if (bprm->unsafe & (LSM_UNSAFE_PTRACE | LSM_UNSAFE_PTRACE_CAP)) {
error = may_change_ptraced_domain(new_profile, &info);
if (error)
if (error) {
aa_put_profile(new_profile);
goto audit;
}
}
/* Determine if secure exec is needed.
......@@ -511,6 +513,7 @@ int apparmor_bprm_set_creds(struct linux_binprm *bprm)
bprm->unsafe |= AA_SECURE_X_NEEDED;
}
apply:
target = new_profile->base.hname;
/* when transitioning profiles clear unsafe personality bits */
bprm->per_clear |= PER_CLEAR_ON_SETID;
......@@ -523,12 +526,9 @@ int apparmor_bprm_set_creds(struct linux_binprm *bprm)
aa_clear_task_cxt_trans(cxt);
audit:
if (new_profile)
target = new_profile->base.hname;
error = aa_audit_file(profile, &perms, OP_EXEC, MAY_EXEC, name, target,
cond.uid, info, error);
if (new_profile && &new_profile->label != cxt->label)
aa_put_profile(new_profile);
cleanup:
aa_put_label(label);
put_buffers(buffer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment