Commit 3f2792ff authored by Al Viro's avatar Al Viro

[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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 5ac3a9c2
...@@ -534,17 +534,7 @@ static inline struct audit_context *audit_get_context(struct task_struct *tsk, ...@@ -534,17 +534,7 @@ static inline struct audit_context *audit_get_context(struct task_struct *tsk,
} }
get_context: get_context:
context->pid = tsk->pid;
context->ppid = sys_getppid(); /* sic. tsk == current in all cases */
context->uid = tsk->uid;
context->gid = tsk->gid;
context->euid = tsk->euid;
context->suid = tsk->suid;
context->fsuid = tsk->fsuid;
context->egid = tsk->egid;
context->sgid = tsk->sgid;
context->fsgid = tsk->fsgid;
context->personality = tsk->personality;
tsk->audit_context = NULL; tsk->audit_context = NULL;
return context; return context;
} }
...@@ -753,6 +743,17 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts ...@@ -753,6 +743,17 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
const char *tty; const char *tty;
/* tsk == current */ /* tsk == current */
context->pid = tsk->pid;
context->ppid = sys_getppid(); /* sic. tsk == current in all cases */
context->uid = tsk->uid;
context->gid = tsk->gid;
context->euid = tsk->euid;
context->suid = tsk->suid;
context->fsuid = tsk->fsuid;
context->egid = tsk->egid;
context->sgid = tsk->sgid;
context->fsgid = tsk->fsgid;
context->personality = tsk->personality;
ab = audit_log_start(context, GFP_KERNEL, AUDIT_SYSCALL); ab = audit_log_start(context, GFP_KERNEL, AUDIT_SYSCALL);
if (!ab) if (!ab)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment