]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - security/apparmor/ipc.c
Merge tag 'omap-for-v3.11/fixes-for-merge-window' of git://git.kernel.org/pub/scm...
[karo-tx-linux.git] / security / apparmor / ipc.c
index c3da93a5150de4a077aba32796c4f0fec9caf488..c51d2266587e8b62d09394c0d8320a4b53001569 100644 (file)
@@ -42,7 +42,7 @@ static int aa_audit_ptrace(struct aa_profile *profile,
 {
        struct common_audit_data sa;
        struct apparmor_audit_data aad = {0,};
-       COMMON_AUDIT_DATA_INIT(&sa, NONE);
+       sa.type = LSM_AUDIT_DATA_NONE;
        sa.aad = &aad;
        aad.op = OP_PTRACE;
        aad.target = target;
@@ -95,23 +95,18 @@ int aa_ptrace(struct task_struct *tracer, struct task_struct *tracee,
         *       - tracer profile has CAP_SYS_PTRACE
         */
 
-       struct aa_profile *tracer_p;
-       /* cred released below */
-       const struct cred *cred = get_task_cred(tracer);
+       struct aa_profile *tracer_p = aa_get_task_profile(tracer);
        int error = 0;
-       tracer_p = aa_cred_profile(cred);
 
        if (!unconfined(tracer_p)) {
-               /* lcred released below */
-               const struct cred *lcred = get_task_cred(tracee);
-               struct aa_profile *tracee_p = aa_cred_profile(lcred);
+               struct aa_profile *tracee_p = aa_get_task_profile(tracee);
 
                error = aa_may_ptrace(tracer, tracer_p, tracee_p, mode);
                error = aa_audit_ptrace(tracer_p, tracee_p, error);
 
-               put_cred(lcred);
+               aa_put_profile(tracee_p);
        }
-       put_cred(cred);
+       aa_put_profile(tracer_p);
 
        return error;
 }