]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/auditsc.c
[PATCH] return records for fork() both to child and parent
[linux-2.6-omap-h63xx.git] / kernel / auditsc.c
index cf5bc2f5f9c3e527ac2ea72ec019d156be72ecb6..de8468050afae9893ee0173969e4efb8822cc317 100644 (file)
@@ -1548,6 +1548,23 @@ void audit_syscall_entry(int arch, int major,
        context->ppid       = 0;
 }
 
+void audit_finish_fork(struct task_struct *child)
+{
+       struct audit_context *ctx = current->audit_context;
+       struct audit_context *p = child->audit_context;
+       if (!p || !ctx || !ctx->auditable)
+               return;
+       p->arch = ctx->arch;
+       p->major = ctx->major;
+       memcpy(p->argv, ctx->argv, sizeof(ctx->argv));
+       p->ctime = ctx->ctime;
+       p->dummy = ctx->dummy;
+       p->auditable = ctx->auditable;
+       p->in_syscall = ctx->in_syscall;
+       p->filterkey = kstrdup(ctx->filterkey, GFP_KERNEL);
+       p->ppid = current->pid;
+}
+
 /**
  * audit_syscall_exit - deallocate audit context after a system call
  * @tsk: task being audited