[AUDIT] do not panic on exclude messages in audit_log_pid_context()
[safe/jmp/linux-2.6] / kernel / auditsc.c
index 4e67abb..aaaca8a 100644 (file)
@@ -948,7 +948,7 @@ static int audit_log_pid_context(struct audit_context *context, pid_t pid,
 
        ab = audit_log_start(context, GFP_KERNEL, AUDIT_OBJ_PID);
        if (!ab)
-               return 1;
+               return rc;
 
        audit_log_format(ab, "opid=%d oauid=%d ouid=%d oses=%d", pid, auid,
                         uid, sessionid);
@@ -1270,6 +1270,11 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
 
                audit_log_end(ab);
        }
+
+       /* Send end of event record to help user space know we are finished */
+       ab = audit_log_start(context, GFP_KERNEL, AUDIT_EOE);
+       if (ab)
+               audit_log_end(ab);
        if (call_panic)
                audit_panic("error converting sid to string");
 }