aboutsummaryrefslogtreecommitdiff
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2013-10-30 18:05:24 -0400
committerEric Paris <eparis@redhat.com>2013-11-05 11:15:03 -0500
commit9410d228a4cf434305306746bb799fb7acdd8648 (patch)
tree93dc6f756af3c2557f2e1377bad52582fdd9fe19 /kernel/auditsc.c
parentd9cfea91e97d5d19f9d69beaa844f5fe56a6adc6 (diff)
audit: call audit_bprm() only once to add AUDIT_EXECVE information
Move the audit_bprm() call from search_binary_handler() to exec_binprm(). This allows us to get rid of the mm member of struct audit_aux_data_execve since bprm->mm will equal current->mm. This also mitigates the issue that ->argc could be modified by the load_binary() call in search_binary_handler(). audit_bprm() was being called to add an AUDIT_EXECVE record to the audit context every time search_binary_handler() was recursively called. Only one reference is necessary. Reported-by: Oleg Nesterov <onestero@redhat.com> Cc: Eric Paris <eparis@redhat.com> Signed-off-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com> --- This patch is against 3.11, but was developed on Oleg's post-3.11 patches that introduce exec_binprm().
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r--kernel/auditsc.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 425a8939be1..dfc5d6745ee 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1145,9 +1145,6 @@ static void audit_log_execve_info(struct audit_context *context,
const char __user *p;
char *buf;
- if (context->execve.mm != current->mm)
- return; /* execve failed, no additional info */
-
p = (const char __user *)current->mm->arg_start;
audit_log_format(*ab, "argc=%d", context->execve.argc);
@@ -2144,7 +2141,6 @@ void __audit_bprm(struct linux_binprm *bprm)
context->type = AUDIT_EXECVE;
context->execve.argc = bprm->argc;
- context->execve.mm = bprm->mm;
}