[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090603230550.GD853@x200.localdomain>
Date: Thu, 4 Jun 2009 03:05:50 +0400
From: Alexey Dobriyan <adobriyan@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Matt Helsley <matthltc@...ibm.com>, xemul@...allels.com,
containers@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org, dave@...ux.vnet.ibm.com,
mingo@...e.hu, torvalds@...ux-foundation.org,
linux-fsdevel@...r.kernel.org
Subject: [PATCH 3/9] exec_path 3/9: switch TOMOYO to ->exec_path
Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
---
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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists