From: Stephen Smalley <sds@epoch.ncsc.mil>

This patch ensures that the comm is included in the audit message if avc_audit
is unable to determine the exe due to the mmap_sem being held.  This is
helpful in tracking down the causes of permission denials that occur in the
mmap/mprotect hooks.

Signed-off-by:  Stephen Smalley <sds@epoch.ncsc.mil>
Signed-off-by:  James Morris <jmorris@redhat.com>

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/security/selinux/avc.c |    2 ++
 1 files changed, 2 insertions(+)

diff -puN security/selinux/avc.c~selinux-audit-task-comm-if-exe-cannot-be-determined security/selinux/avc.c
--- 25/security/selinux/avc.c~selinux-audit-task-comm-if-exe-cannot-be-determined	Thu Dec  2 13:02:50 2004
+++ 25-akpm/security/selinux/avc.c	Thu Dec  2 13:02:50 2004
@@ -566,6 +566,8 @@ void avc_audit(u32 ssid, u32 tsid,
 					vma = vma->vm_next;
 				}
 				up_read(&mm->mmap_sem);
+			} else {
+				audit_log_format(ab, " comm=%s", tsk->comm);
 			}
 			if (tsk != current)
 				mmput(mm);
_