Commit 3f2792ffbd88dc1cd41d226674cc428914981e98

Authored by Al Viro
1 parent 5ac3a9c26c

[PATCH] take filling ->pid, etc. out of audit_get_context()

move that stuff downstream and into the only branch where it'll be
used.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 1 changed file with 12 additions and 11 deletions Side-by-side Diff

... ... @@ -534,17 +534,7 @@
534 534 }
535 535  
536 536 get_context:
537   - context->pid = tsk->pid;
538   - context->ppid = sys_getppid(); /* sic. tsk == current in all cases */
539   - context->uid = tsk->uid;
540   - context->gid = tsk->gid;
541   - context->euid = tsk->euid;
542   - context->suid = tsk->suid;
543   - context->fsuid = tsk->fsuid;
544   - context->egid = tsk->egid;
545   - context->sgid = tsk->sgid;
546   - context->fsgid = tsk->fsgid;
547   - context->personality = tsk->personality;
  537 +
548 538 tsk->audit_context = NULL;
549 539 return context;
550 540 }
... ... @@ -753,6 +743,17 @@
753 743 const char *tty;
754 744  
755 745 /* tsk == current */
  746 + context->pid = tsk->pid;
  747 + context->ppid = sys_getppid(); /* sic. tsk == current in all cases */
  748 + context->uid = tsk->uid;
  749 + context->gid = tsk->gid;
  750 + context->euid = tsk->euid;
  751 + context->suid = tsk->suid;
  752 + context->fsuid = tsk->fsuid;
  753 + context->egid = tsk->egid;
  754 + context->sgid = tsk->sgid;
  755 + context->fsgid = tsk->fsgid;
  756 + context->personality = tsk->personality;
756 757  
757 758 ab = audit_log_start(context, GFP_KERNEL, AUDIT_SYSCALL);
758 759 if (!ab)