Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx> --- security/tomoyo/common.c | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-) diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index ddfb9cc..d26deea 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c @@ -10,6 +10,7 @@ */ #include <linux/uaccess.h> +#include <linux/path.h> #include <linux/security.h> #include <linux/hardirq.h> #include "realpath.h" @@ -700,20 +701,13 @@ bool tomoyo_io_printf(struct tomoyo_io_buffer *head, const char *fmt, ...) */ static const char *tomoyo_get_exe(void) { - struct mm_struct *mm = current->mm; - struct vm_area_struct *vma; + struct path exec_path; 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); + get_task_exec_path(current, &exec_path); + if (exec_path.mnt && exec_path.dentry) + cp = tomoyo_realpath_from_path(&exec_path); + path_put(&exec_path); return cp; } -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html