[TOMOYO #5 01/18] Add struct vfsmount to struct task_struct.

penguin-kernel
2007-11-16T17:37:24Z

[-- Attachment #1: add-struct-vfsmount-to-struct-task_struct.patch --]
[-- Type: text/plain, Size: 1085 bytes --]

This patch allows VFS wrapper functions associate "struct vfsmount"
with "struct task_struct" so that LSM hooks can calculate
pathname of given "struct dentry".

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
include/linux/init_task.h | 1 +
include/linux/sched.h | 2 ++
2 files changed, 3 insertions(+)

--- linux-2.6-mm.orig/include/linux/init_task.h 2007-11-14 15:12:03.000000000 +0900
+++ linux-2.6-mm/include/linux/init_task.h 2007-11-14 15:15:33.000000000 +0900
@@ -173,6 +173,7 @@ extern struct group_info init_groups;
.dirties = INIT_PROP_LOCAL_SINGLE(dirties), \
INIT_TRACE_IRQFLAGS \
INIT_LOCKDEP \
+ .last_vfsmount = NULL, \
}

--- linux-2.6-mm.orig/include/linux/sched.h 2007-11-14 15:14:35.000000000 +0900
+++ linux-2.6-mm/include/linux/sched.h 2007-11-14 15:15:33.000000000 +0900
@@ -1191,6 +1191,8 @@ struct task_struct {
int make_it_fail;
#endif
struct prop_local_single dirties;
+ /* vfsmount info for LSM hooks. */
+ struct vfsmount *last_vfsmount;
};

/*

--