Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff235f51 authored by Paul Davies C's avatar Paul Davies C Committed by Eric Paris
Browse files

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: default avatarPaul Davies C <pauldaviesc@gmail.com>
Signed-off-by: default avatarRichard Guy Briggs <rgb@redhat.com>
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
parent 34eab0a7
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1859,7 +1859,8 @@ void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk)
		if (mm->exe_file)
		if (mm->exe_file)
			audit_log_d_path(ab, " exe=", &mm->exe_file->f_path);
			audit_log_d_path(ab, " exe=", &mm->exe_file->f_path);
		up_read(&mm->mmap_sem);
		up_read(&mm->mmap_sem);
	}
	} else
		audit_log_format(ab, " exe=(null)");
	audit_log_task_context(ab);
	audit_log_task_context(ab);
}
}
EXPORT_SYMBOL(audit_log_task_info);
EXPORT_SYMBOL(audit_log_task_info);
+8 −0
Original line number Original line Diff line number Diff line
@@ -2353,6 +2353,7 @@ static void audit_log_task(struct audit_buffer *ab)
	kuid_t auid, uid;
	kuid_t auid, uid;
	kgid_t gid;
	kgid_t gid;
	unsigned int sessionid;
	unsigned int sessionid;
	struct mm_struct *mm = current->mm;


	auid = audit_get_loginuid(current);
	auid = audit_get_loginuid(current);
	sessionid = audit_get_sessionid(current);
	sessionid = audit_get_sessionid(current);
@@ -2366,6 +2367,13 @@ static void audit_log_task(struct audit_buffer *ab)
	audit_log_task_context(ab);
	audit_log_task_context(ab);
	audit_log_format(ab, " pid=%d comm=", current->pid);
	audit_log_format(ab, " pid=%d comm=", current->pid);
	audit_log_untrustedstring(ab, current->comm);
	audit_log_untrustedstring(ab, current->comm);
	if (mm) {
		down_read(&mm->mmap_sem);
		if (mm->exe_file)
			audit_log_d_path(ab, " exe=", &mm->exe_file->f_path);
		up_read(&mm->mmap_sem);
	} else
		audit_log_format(ab, " exe=(null)");
}
}


/**
/**