[AppArmor 00/47] AppArmor security module overview

2007-12-20 Thread John
-- This submission of the AppArmor security module is based against 2.6.24-rc4-mm. Any comments and feedback to improve implementation are appreciated. Changes since previous submission - added apparmor security goal document. Documentation/lsm/AppArmor-Security-Goal.txt - removed DAC style

[AppArmor 01/47] Pass struct vfsmount to the inode_create LSM hook

2007-12-20 Thread John
This is needed for computing pathnames in the AppArmor LSM. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/namei.c |2 +- include/linux/security.h |9 ++---

[AppArmor 02/47] Pass struct path down to remove_suid and children

2007-12-20 Thread John
Required by a later patch that adds a struct vfsmount parameter to notify_change(). Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/ntfs/file.c |2 +-

[AppArmor 04/47] Pass struct vfsmount to the inode_setattr LSM hook

2007-12-20 Thread John
This is needed for computing pathnames in the AppArmor LSM. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/attr.c|4 ++-- include/linux/security.h |8 ++--

[AppArmor 05/47] Add struct vfsmount parameter to vfs_mkdir()

2007-12-20 Thread John
The vfsmount will be passed down to the LSM hook so that LSMs can compute pathnames. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/ecryptfs/inode.c |5 - fs/namei.c|

[AppArmor 06/47] Pass struct vfsmount to the inode_mkdir LSM hook

2007-12-20 Thread John
This is needed for computing pathnames in the AppArmor LSM. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/namei.c |2 +- include/linux/security.h |8 ++--

[AppArmor 07/47] Add a struct vfsmount parameter to vfs_mknod()

2007-12-20 Thread John
The vfsmount will be passed down to the LSM hook so that LSMs can compute pathnames. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/ecryptfs/inode.c |5 - fs/namei.c | 10

[AppArmor 08/47] Pass struct vfsmount to the inode_mknod LSM hook

2007-12-20 Thread John
This is needed for computing pathnames in the AppArmor LSM. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/namei.c |2 +- include/linux/security.h |7 +--

[AppArmor 09/47] Add a struct vfsmount parameter to vfs_symlink()

2007-12-20 Thread John
The vfsmount will be passed down to the LSM hook so that LSMs can compute pathnames. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/ecryptfs/inode.c |4 +++- fs/namei.c |6

[AppArmor 11/47] Pass struct vfsmount to the inode_readlink LSM hook

2007-12-20 Thread John
This is needed for computing pathnames in the AppArmor LSM. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/stat.c|3 ++- include/linux/security.h |8 +---

[AppArmor 12/47] Add struct vfsmount parameters to vfs_link()

2007-12-20 Thread John
The vfsmount will be passed down to the LSM hook so that LSMs can compute pathnames. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/ecryptfs/inode.c |9 +++-- fs/namei.c |

[AppArmor 13/47] Pass the struct vfsmounts to the inode_link LSM hook

2007-12-20 Thread John
This is needed for computing pathnames in the AppArmor LSM. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/namei.c |3 ++- include/linux/security.h | 16 +++-

[AppArmor 17/47] Add a struct vfsmount parameter to vfs_unlink()

2007-12-20 Thread John
The vfsmount will be passed down to the LSM hook so that LSMs can compute pathnames. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/ecryptfs/inode.c |3 ++- fs/namei.c |

[AppArmor 18/47] Pass struct vfsmount to the inode_unlink LSM hook

2007-12-20 Thread John
This is needed for computing pathnames in the AppArmor LSM. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/namei.c |2 +- include/linux/security.h | 10 +++---

[AppArmor 19/47] Add struct vfsmount parameters to vfs_rename()

2007-12-20 Thread John
The vfsmount will be passed down to the LSM hook so that LSMs can compute pathnames. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/ecryptfs/inode.c |7 ++- fs/namei.c | 19

[AppArmor 20/47] Pass struct vfsmount to the inode_rename LSM hook

2007-12-20 Thread John
This is needed for computing pathnames in the AppArmor LSM. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/namei.c |6 -- include/linux/security.h | 13 ++---

[AppArmor 21/47] Add a struct vfsmount parameter to vfs_setxattr()

2007-12-20 Thread John
The vfsmount will be passed down to the LSM hook so that LSMs can compute pathnames. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/nfsd/vfs.c | 16 +++-

[AppArmor 22/47] Pass struct vfsmount to the inode_setxattr LSM hook

2007-12-20 Thread John
This is needed for computing pathnames in the AppArmor LSM. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/xattr.c |4 ++-- include/linux/security.h | 35

[AppArmor 23/47] Add a struct vfsmount parameter to vfs_getxattr()

2007-12-20 Thread John
The vfsmount will be passed down to the LSM hook so that LSMs can compute pathnames. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/nfsd/nfs4xdr.c |2 +- fs/nfsd/vfs.c

[AppArmor 24/47] Pass struct vfsmount to the inode_getxattr LSM hook

2007-12-20 Thread John
This is needed for computing pathnames in the AppArmor LSM. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/xattr.c |2 +- include/linux/security.h | 11 +++

[AppArmor 25/47] Add a struct vfsmount parameter to vfs_listxattr()

2007-12-20 Thread John
The vfsmount will be passed down to the LSM hook so that LSMs can compute pathnames. Signed-off-by: Tony Jones [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/unionfs/copyup.c |5 +++-- fs/unionfs/xattr.c|

[AppArmor 40/47] Export audit subsystem for use by modules

2007-12-20 Thread John
Update kenel audit range comments to show AppArmor's registered range of 1500-1599. This range used to be reserved for LSPP but LSPP uses the SE Linux range and the range was given to AppArmor. Adds necessary export symbols for audit subsystem routines. Changes audit_log_vformat to be externally

[AppArmor 41/47] AppArmor: Main Part

2007-12-20 Thread John
The underlying functions by which the AppArmor LSM hooks are implemented. Signed-off-by: John Johansen [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] --- security/apparmor/main.c | 1357 +++ 1 file changed, 1357 insertions(+)

[AppArmor 43/47] AppArmor: Profile loading and manipulation, pathname matching

2007-12-20 Thread John
Pathname matching, transition table loading, profile loading and manipulation. Signed-off-by: John Johansen [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] --- security/apparmor/match.c| 299 + security/apparmor/match.h| 85 +++

[AppArmor 44/47] AppArmor: all the rest

2007-12-20 Thread John
All the things that didn't nicely fit in a category on their own: kbuild code, declararions and inline functions, /sys/kernel/security/apparmor filesystem for controlling apparmor from user space, profile list functions, locking documentation, /proc/$pid/task/$tid/attr/current access.

[AppArmor 45/47] Add AppArmor LSM to security/Makefile

2007-12-20 Thread John
Signed-off-by: John Johansen [EMAIL PROTECTED] Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] --- security/Kconfig |1 + security/Makefile |1 + security/apparmor/Kconfig | 22 -- 3 files changed, 22 insertions(+), 2 deletions(-) ---

[AppArmor 37/47] Switch to vfs_permission() in do_path_lookup()

2007-12-20 Thread John
Switch from file_permission() to vfs_permission() in do_path_lookup(): this avoids calling permission() with a NULL nameidata here. Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/namei.c |9 +++-- 1 file changed, 3

[AppArmor 36/47] Allow permission functions to tell between parent and leaf checks

2007-12-20 Thread John
Set the LOOKUP_CONTINUE flag when checking parent permissions. This allows permission functions to tell between parent and leaf checks. Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/namei.c |2 ++ 1 file changed, 2 insertions(+)

[AppArmor 31/47] Add d_namespace_path() to compute namespace relative pathnames

2007-12-20 Thread John
In AppArmor, we are interested in pathnames relative to the namespace root. This is the same as d_path() except for the root where the search ends. Add a function for computing the namespace-relative path. Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL

[AppArmor 30/47] Make d_path() consistent across mount operations

2007-12-20 Thread John
The path that __d_path() computes can become slightly inconsistent when it races with mount operations: it grabs the vfsmount_lock when traversing mount points but immediately drops it again, only to re-grab it when it reaches the next mount point. The result is that the filename computed is not

[AppArmor 29/47] Fix __d_path() for lazy unmounts and make it unambiguous

2007-12-20 Thread John
First, when __d_path() hits a lazily unmounted mount point, it tries to prepend the name of the lazily unmounted dentry to the path name. It gets this wrong, and also overwrites the slash that separates the name from the following pathname component. This patch fixes that; if a process was in

[AppArmor 32/47] From: Miklos Szeredi [EMAIL PROTECTED]

2007-12-20 Thread John
Add a new file operation: f_op-fgetattr(), that is invoked by fstat(). Fall back to i_op-getattr() if it is not defined. We need this because fstat() semantics can in some cases be better implemented if the filesystem has the open file available. Let's take the following example: we have a

[AppArmor 38/47] Switch to vfs_permission() in sys_fchdir()

2007-12-20 Thread John
Switch from file_permission() to vfs_permission() in sys_fchdir(): this avoids calling permission() with a NULL nameidata here. Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED] Signed-off-by: John Johansen [EMAIL PROTECTED] --- fs/open.c | 11 ++- 1 file changed, 6 insertions(+),

Re: [patch, rfc] mm.h, security.h, key.h and preventing namespace poisoning

2007-12-20 Thread Eric Paris
On Thu, 2007-12-20 at 11:07 +1100, James Morris wrote: On Wed, 19 Dec 2007, David Chinner wrote: Folks, I just updated a git tree and started getting errors on a copy_keys macro warning. The code I've been working on uses a -copy_keys() method for copying the keys in a btree

Re: [PATCH 10/28] FS-Cache: Recruit a couple of page flags for cache management [try #2]

2007-12-20 Thread David Howells
Nick Piggin [EMAIL PROTECTED] wrote: I'd much prefer if you would handle this in the filesystem, and have it set PG_private whenever fscache needs to receive a callback, and DTRT depending on whether PG_fscache etc. is set or not. That's tricky and slower[*]. One of the things I