Skip to content

AppArmor security module overview

[email protected] linux-fsdevel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest44 patches 31 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/44Pass struct vfsmount to the inode_create LSM hookfs/namei.c include/linux/security.h security/dummy.c +1 more+10 -62 replies
2/44Pass struct path down to remove_suid and childrenfs/ntfs/file.c fs/reiserfs/file.c fs/splice.c +5 more+15 -150 replies
3/44Add a vfsmount parameter to notify_change()fs/attr.c fs/ecryptfs/inode.c fs/exec.c +11 more+45 -370 replies
4/44Pass struct vfsmount to the inode_setattr LSM hookfs/attr.c include/linux/security.h security/dummy.c +1 more+13 -70 replies
5/44Add struct vfsmount parameter to vfs_mkdir()fs/ecryptfs/inode.c fs/namei.c fs/nfsd/nfs4recover.c +2 more+15 -80 replies
6/44Pass struct vfsmount to the inode_mkdir LSM hookfs/namei.c include/linux/security.h security/dummy.c +1 more+10 -50 replies
7/44Add a struct vfsmount parameter to vfs_mknod()fs/ecryptfs/inode.c fs/namei.c fs/nfsd/vfs.c +2 more+14 -80 replies
8/44Pass struct vfsmount to the inode_mknod LSM hookfs/namei.c include/linux/security.h security/dummy.c +1 more+10 -60 replies
9/44Add a struct vfsmount parameter to vfs_symlink()fs/ecryptfs/inode.c fs/namei.c fs/nfsd/vfs.c +1 more+16 -80 replies
10/44Pass struct vfsmount to the inode_symlink LSM hookfs/namei.c include/linux/security.h security/dummy.c +1 more+10 -60 replies
11/44Pass struct vfsmount to the inode_readlink LSM hookfs/stat.c include/linux/security.h security/dummy.c +1 more+10 -70 replies
12/44Add struct vfsmount parameters to vfs_link()fs/ecryptfs/inode.c fs/namei.c fs/nfsd/vfs.c +1 more+13 -60 replies
13/44Pass the struct vfsmounts to the inode_link LSM hookfs/namei.c include/linux/security.h security/dummy.c +1 more+26 -100 replies
14/44Add a struct vfsmount parameter to vfs_rmdir()fs/ecryptfs/inode.c fs/namei.c fs/nfsd/nfs4recover.c +3 more+13 -90 replies
15/44Pass struct vfsmount to the inode_rmdir LSM hookfs/namei.c include/linux/security.h security/dummy.c +1 more+13 -70 replies
16/44Call lsm hook before unhashing dentry in vfs_rmdir()fs/namei.c+7 -60 replies
17/44Add a struct vfsmount parameter to vfs_unlink()fs/ecryptfs/inode.c fs/namei.c fs/nfsd/nfs4recover.c +3 more+8 -70 replies
18/44Pass struct vfsmount to the inode_unlink LSM hookfs/namei.c include/linux/security.h security/dummy.c +1 more+14 -80 replies
19/44Add struct vfsmount parameters to vfs_rename()fs/ecryptfs/inode.c fs/namei.c fs/nfsd/vfs.c +1 more+21 -100 replies
20/44Pass struct vfsmount to the inode_rename LSM hookfs/namei.c include/linux/security.h security/dummy.c +1 more+26 -100 replies
21/44Add a struct vfsmount parameter to vfs_setxattr()fs/nfsd/vfs.c fs/xattr.c include/linux/xattr.h+21 -140 replies
22/44Pass struct vfsmount to the inode_setxattr LSM hookfs/xattr.c include/linux/security.h security/commoncap.c +2 more+41 -240 replies
23/44Add a struct vfsmount parameter to vfs_getxattr()fs/nfsd/nfs4xdr.c fs/nfsd/vfs.c fs/xattr.c +2 more+25 -180 replies
24/44Pass struct vfsmount to the inode_getxattr LSM hookfs/xattr.c include/linux/security.h security/dummy.c +1 more+13 -80 replies
25/44Add a struct vfsmount parameter to vfs_listxattr()fs/xattr.c include/linux/xattr.h+16 -120 replies
26/44Pass struct vfsmount to the inode_listxattr LSM hookfs/xattr.c include/linux/security.h security/dummy.c +1 more+10 -80 replies
27/44Add a struct vfsmount parameter to vfs_removexattr()fs/nfsd/vfs.c fs/xattr.c include/linux/xattr.h+11 -100 replies
28/44Pass struct vfsmount to the inode_removexattr LSM hookfs/xattr.c include/linux/security.h security/commoncap.c +2 more+16 -100 replies
29/44Fix __d_path() for lazy unmounts and make it unambiguousfs/dcache.c+98 -710 replies
30/44Make d_path() consistent across mount operationsfs/dcache.c+8 -60 replies
31/44Add d_namespace_path() to compute namespace relative pathnamesfs/dcache.c fs/namespace.c include/linux/dcache.h +1 more+34 -30 replies
32/44Enable LSM hooks to distinguish operations on file descriptors from operations on pathnamesfs/nfsd/vfs.c fs/open.c include/linux/fs.h+21 -104 replies
33/44Pass struct file down the inode_*xattr security LSM hooksfs/xattr.c include/linux/security.h include/linux/xattr.h +3 more+80 -630 replies
34/44Factor out sysctl pathname codeinclude/linux/sysctl.h kernel/sysctl.c security/selinux/hooks.c+34 -300 replies
35/44Allow permission functions to tell between parent and leaf checksfs/namei.c+6 -00 replies
36/44Export audit subsystem for use by modulesinclude/linux/audit.h kernel/audit.c+15 -30 replies
37/44AppArmor: Main Partsecurity/apparmor/main.c+1255 -00 replies
38/44AppArmor: Module and LSM hookssecurity/apparmor/lsm.c+817 -00 replies
39/44AppArmor: Profile loading and manipulation, pathname matchingsecurity/apparmor/match.c security/apparmor/match.h security/apparmor/module_interface.c+920 -00 replies
40/44AppArmor: all the restsecurity/apparmor/Kconfig security/apparmor/Makefile security/apparmor/apparmor.h +5 more+1067 -00 replies
41/44Add AppArmor LSM to security/Makefilesecurity/Kconfig security/Makefile security/apparmor/Kconfig+4 -10 replies
42/44Switch to vfs_permission() in do_path_lookup()fs/namei.c+6 -70 replies
43/44Switch to vfs_permission() in sys_fchdir()fs/open.c+7 -90 replies
44/44Fix file_permission()fs/namei.c+7 -10 replies

Reviews trailers per patch

1 of 44 patches has a Reviewed-by or Acked-by.

PatchAlan Cox
1/44
2/44
3/44
4/44
5/44
6/44
7/44
8/44
9/44
10/44
11/44
12/44
13/44
14/44
15/44
16/44
17/44
18/44
19/44
20/44
21/44
22/44
23/44
24/44
25/44
26/44
27/44
28/44
29/44A-b
30/44
31/44
32/44
33/44
34/44
35/44
36/44
37/44
38/44
39/44
40/44
41/44
42/44
43/44
44/44

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [AppArmor 00/44] AppArmor security module overview

This post contains patches to include the AppArmor application security framework, with request for inclusion into -mm for wider testing.

These patches are currently against lkml but we will gladly rebase them against -mm so that they will apply cleanly.

Any comments and feedback to improve implementation are appreciated.

A second post dealing with the issue of passing NULL nameidata, will be posted to lkml for discussion.

Changes since previous post:
- remove custom pathname mangling
- rework apparmor auditing to cleanup message formating and better use audit framework
- change permission consistency checks from runtime to once at policy load
- add change_profile feature and cleanup change_hat to use change_profile

The patch series consists of five areas:

(1) Pass struct vfsmount through to LSM hooks.

(2) Fixes and improvements to __d_path():

(a) make it unambiguous and exclude unreachable paths from /proc/mounts,

(b) make its result consistent in the face of remounts,

(c) introduce d_namespace_path(), a variant of d_path that goes up to the namespace root instead of the chroot.

(d) the behavior of d_path() and getcwd() remain unchanged, and there is no hidding of unreachable paths in /proc/mounts. The patches addressing these have been seperated from the AppArmor submission and will be introduced at a later date.

Part (a) has been in the -mm tree for a while; this series includes an updated copy of the -mm patch. Parts (b) and (c) shouldn't be too controversial.

(3) Be able to distinguish file descriptor access from access by name in LSM hooks.

Applications expect different behavior from file descriptor accesses and accesses by name in some cases. We need to pass this information down the LSM hooks to allow AppArmor to tell which is which.

(4) Convert the selinux sysctl pathname computation code into a standalone function.

(5) The AppArmor LSM itself.

(See below.)

A tarball of the kernel patches, base user-space utilities, example profiles, and technical documentation (including a walk-through) are available at:

http://forgeftp.novell.com//apparmor/LKML_Submission-June-07/

Explaining the AppArmor design in detail would take by far too much space here, so let me refer you to the technical documentation for that. Included is a low-level walk-through of the system and basic tools, and some examples. The manual pages included in the apparmor-parser package are worth a read as well.