aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
authorPaul Davies C <pauldaviesc@gmail.com>2013-11-20 21:44:03 -0500
committerEric Paris <eparis@redhat.com>2014-01-13 22:31:38 -0500
commitff235f51a138fc61e1a22dcb8b072d9c78c2a8cc (patch)
treee60ba924338f34a394e1986a2173a8f38eee5235 /kernel/auditsc.c
parent34eab0a7cd45ce0eab744a86a85d83aa7ddf99a5 (diff)
audit: Added exe field to audit core dump signal log
Currently when the coredump signals are logged by the audit system, the actual path to the executable is not logged. Without details of exe, the system admin may not have an exact idea on what program failed. This patch changes the audit_log_task() so that the path to the exe is also logged. This was copied from audit_log_task_info() and the latter enhanced to avoid disappearing text fields. Signed-off-by: Paul Davies C <pauldaviesc@gmail.com> Signed-off-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r--kernel/auditsc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index fc3b3dbcc8aa..05634b3ba244 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -2353,6 +2353,7 @@ static void audit_log_task(struct audit_buffer *ab)
2353 kuid_t auid, uid; 2353 kuid_t auid, uid;
2354 kgid_t gid; 2354 kgid_t gid;
2355 unsigned int sessionid; 2355 unsigned int sessionid;
2356 struct mm_struct *mm = current->mm;
2356 2357
2357 auid = audit_get_loginuid(current); 2358 auid = audit_get_loginuid(current);
2358 sessionid = audit_get_sessionid(current); 2359 sessionid = audit_get_sessionid(current);
@@ -2366,6 +2367,13 @@ static void audit_log_task(struct audit_buffer *ab)
2366 audit_log_task_context(ab); 2367 audit_log_task_context(ab);
2367 audit_log_format(ab, " pid=%d comm=", current->pid); 2368 audit_log_format(ab, " pid=%d comm=", current->pid);
2368 audit_log_untrustedstring(ab, current->comm); 2369 audit_log_untrustedstring(ab, current->comm);
2370 if (mm) {
2371 down_read(&mm->mmap_sem);
2372 if (mm->exe_file)
2373 audit_log_d_path(ab, " exe=", &mm->exe_file->f_path);
2374 up_read(&mm->mmap_sem);
2375 } else
2376 audit_log_format(ab, " exe=(null)");
2369} 2377}
2370 2378
2371/** 2379/**