]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/auditsc.c
[PATCH] fix broken timestamps in AVC generated by kernel threads
[linux-2.6-omap-h63xx.git] / kernel / auditsc.c
index 0a13d6895494838953fe168eb4ca02f1e2f965ba..2a3f0afc4d2ac191835c39988506dfd84d1e4737 100644 (file)
@@ -1957,15 +1957,18 @@ EXPORT_SYMBOL_GPL(__audit_inode_child);
  *
  * Also sets the context as auditable.
  */
-void auditsc_get_stamp(struct audit_context *ctx,
+int auditsc_get_stamp(struct audit_context *ctx,
                       struct timespec *t, unsigned int *serial)
 {
+       if (!ctx->in_syscall)
+               return 0;
        if (!ctx->serial)
                ctx->serial = audit_serial();
        t->tv_sec  = ctx->ctime.tv_sec;
        t->tv_nsec = ctx->ctime.tv_nsec;
        *serial    = ctx->serial;
        ctx->auditable = 1;
+       return 1;
 }
 
 /* global counter which is incremented every time something logs in */