/* This function uses tomoyo_alloc(), so the caller must call tomoyo_free() if this function didn't return NULL.  */
static const char* tomoyo_get_exe(void)
/* This function uses tomoyo_alloc(), so the caller must call tomoyo_free() if this function didn't return NULL.  */
static const char* tomoyo_get_exe(void)
{
	struct mm_struct *mm = current->mm;
	struct vm_area_struct *vma;
	const char *cp = NULL;
	if (!mm)
		return NULL;
	down_read(&mm->mmap_sem);
	for (vma = mm->mmap; vma; vma = vma->vm_next) {
		if ((vma->vm_flags & VM_EXECUTABLE) && vma->vm_file) {
			cp = tomoyo_realpath_from_path(&vma->vm_file->f_path);
			break;
		}
	}
	up_read(&mm->mmap_sem);
	return cp;
}