]> err.no Git - linux-2.6/blobdiff - kernel/auditsc.c
[MMC] extend data timeout for writes
[linux-2.6] / kernel / auditsc.c
index ba087885477786ab1a076cb7202e9fb62d485d5c..7f160df21a23e22a3d8e0e36b29712bcc9758692 100644 (file)
@@ -57,6 +57,7 @@
 #include <asm/unistd.h>
 #include <linux/security.h>
 #include <linux/list.h>
+#include <linux/tty.h>
 
 #include "audit.h"
 
@@ -573,6 +574,7 @@ static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask)
        int i;
        struct audit_buffer *ab;
        struct audit_aux_data *aux;
+       const char *tty;
 
        ab = audit_log_start(context, gfp_mask, AUDIT_SYSCALL);
        if (!ab)
@@ -585,11 +587,15 @@ static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask)
                audit_log_format(ab, " success=%s exit=%ld", 
                                 (context->return_valid==AUDITSC_SUCCESS)?"yes":"no",
                                 context->return_code);
+       if (current->signal->tty && current->signal->tty->name)
+               tty = current->signal->tty->name;
+       else
+               tty = "(none)";
        audit_log_format(ab,
                  " a0=%lx a1=%lx a2=%lx a3=%lx items=%d"
                  " pid=%d auid=%u uid=%u gid=%u"
                  " euid=%u suid=%u fsuid=%u"
-                 " egid=%u sgid=%u fsgid=%u",
+                 " egid=%u sgid=%u fsgid=%u tty=%s",
                  context->argv[0],
                  context->argv[1],
                  context->argv[2],
@@ -600,7 +606,7 @@ static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask)
                  context->uid,
                  context->gid,
                  context->euid, context->suid, context->fsuid,
-                 context->egid, context->sgid, context->fsgid);
+                 context->egid, context->sgid, context->fsgid, tty);
        audit_log_task_info(ab, gfp_mask);
        audit_log_end(ab);
 
@@ -698,10 +704,14 @@ void audit_free(struct task_struct *tsk)
 {
        struct audit_context *context;
 
-       task_lock(tsk);
+       /*
+        * No need to lock the task - when we execute audit_free()
+        * then the task has no external references anymore, and
+        * we are tearing it down. (The locking also confuses
+        * DEBUG_LOCKDEP - this freeing may occur in softirq
+        * contexts as well, via RCU.)
+        */
        context = audit_get_context(tsk, 0, 0);
-       task_unlock(tsk);
-
        if (likely(!context))
                return;
 
@@ -751,7 +761,7 @@ void audit_syscall_entry(struct task_struct *tsk, int arch, int major,
         *
         * i386     no
         * x86_64   no
-        * ppc64    yes (see arch/ppc64/kernel/misc.S)
+        * ppc64    yes (see arch/powerpc/platforms/iseries/misc.S)
         *
         * This also happens with vm86 emulation in a non-nested manner
         * (entries without exits), so this case must be caught.