diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/capability.h | 3 | ||||
-rw-r--r-- | include/linux/fs.h | 1 | ||||
-rw-r--r-- | include/linux/lsm_audit.h | 32 | ||||
-rw-r--r-- | include/linux/security.h | 11 | ||||
-rw-r--r-- | include/linux/xattr.h | 14 |
5 files changed, 50 insertions, 11 deletions
diff --git a/include/linux/capability.h b/include/linux/capability.h index 39e5ff512fbe..90012b9ddbf3 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -49,9 +49,6 @@ typedef struct __user_cap_data_struct { | |||
49 | } __user *cap_user_data_t; | 49 | } __user *cap_user_data_t; |
50 | 50 | ||
51 | 51 | ||
52 | #define XATTR_CAPS_SUFFIX "capability" | ||
53 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX | ||
54 | |||
55 | #define VFS_CAP_REVISION_MASK 0xFF000000 | 52 | #define VFS_CAP_REVISION_MASK 0xFF000000 |
56 | #define VFS_CAP_REVISION_SHIFT 24 | 53 | #define VFS_CAP_REVISION_SHIFT 24 |
57 | #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK | 54 | #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK |
diff --git a/include/linux/fs.h b/include/linux/fs.h index f91affb7d530..e5106e49bd2c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -53,6 +53,7 @@ struct inodes_stat_t { | |||
53 | #define MAY_APPEND 8 | 53 | #define MAY_APPEND 8 |
54 | #define MAY_ACCESS 16 | 54 | #define MAY_ACCESS 16 |
55 | #define MAY_OPEN 32 | 55 | #define MAY_OPEN 32 |
56 | #define MAY_CHDIR 64 | ||
56 | 57 | ||
57 | /* | 58 | /* |
58 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond | 59 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond |
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h index 6907251d5200..112a55033352 100644 --- a/include/linux/lsm_audit.h +++ b/include/linux/lsm_audit.h | |||
@@ -90,10 +90,42 @@ struct common_audit_data { | |||
90 | u32 requested; | 90 | u32 requested; |
91 | u32 audited; | 91 | u32 audited; |
92 | u32 denied; | 92 | u32 denied; |
93 | /* | ||
94 | * auditdeny is a bit tricky and unintuitive. See the | ||
95 | * comments in avc.c for it's meaning and usage. | ||
96 | */ | ||
97 | u32 auditdeny; | ||
93 | struct av_decision *avd; | 98 | struct av_decision *avd; |
94 | int result; | 99 | int result; |
95 | } selinux_audit_data; | 100 | } selinux_audit_data; |
96 | #endif | 101 | #endif |
102 | #ifdef CONFIG_SECURITY_APPARMOR | ||
103 | struct { | ||
104 | int error; | ||
105 | int op; | ||
106 | int type; | ||
107 | void *profile; | ||
108 | const char *name; | ||
109 | const char *info; | ||
110 | union { | ||
111 | void *target; | ||
112 | struct { | ||
113 | long pos; | ||
114 | void *target; | ||
115 | } iface; | ||
116 | struct { | ||
117 | int rlim; | ||
118 | unsigned long max; | ||
119 | } rlim; | ||
120 | struct { | ||
121 | const char *target; | ||
122 | u32 request; | ||
123 | u32 denied; | ||
124 | uid_t ouid; | ||
125 | } fs; | ||
126 | }; | ||
127 | } apparmor_audit_data; | ||
128 | #endif | ||
97 | }; | 129 | }; |
98 | /* these callback will be implemented by a specific LSM */ | 130 | /* these callback will be implemented by a specific LSM */ |
99 | void (*lsm_pre_audit)(struct audit_buffer *, void *); | 131 | void (*lsm_pre_audit)(struct audit_buffer *, void *); |
diff --git a/include/linux/security.h b/include/linux/security.h index 0c8819170463..723a93df756a 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -470,8 +470,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
470 | * @path_truncate: | 470 | * @path_truncate: |
471 | * Check permission before truncating a file. | 471 | * Check permission before truncating a file. |
472 | * @path contains the path structure for the file. | 472 | * @path contains the path structure for the file. |
473 | * @length is the new length of the file. | ||
474 | * @time_attrs is the flags passed to do_truncate(). | ||
475 | * Return 0 if permission is granted. | 473 | * Return 0 if permission is granted. |
476 | * @inode_getattr: | 474 | * @inode_getattr: |
477 | * Check permission before obtaining file attributes. | 475 | * Check permission before obtaining file attributes. |
@@ -1412,8 +1410,7 @@ struct security_operations { | |||
1412 | int (*path_rmdir) (struct path *dir, struct dentry *dentry); | 1410 | int (*path_rmdir) (struct path *dir, struct dentry *dentry); |
1413 | int (*path_mknod) (struct path *dir, struct dentry *dentry, int mode, | 1411 | int (*path_mknod) (struct path *dir, struct dentry *dentry, int mode, |
1414 | unsigned int dev); | 1412 | unsigned int dev); |
1415 | int (*path_truncate) (struct path *path, loff_t length, | 1413 | int (*path_truncate) (struct path *path); |
1416 | unsigned int time_attrs); | ||
1417 | int (*path_symlink) (struct path *dir, struct dentry *dentry, | 1414 | int (*path_symlink) (struct path *dir, struct dentry *dentry, |
1418 | const char *old_name); | 1415 | const char *old_name); |
1419 | int (*path_link) (struct dentry *old_dentry, struct path *new_dir, | 1416 | int (*path_link) (struct dentry *old_dentry, struct path *new_dir, |
@@ -2806,8 +2803,7 @@ int security_path_mkdir(struct path *dir, struct dentry *dentry, int mode); | |||
2806 | int security_path_rmdir(struct path *dir, struct dentry *dentry); | 2803 | int security_path_rmdir(struct path *dir, struct dentry *dentry); |
2807 | int security_path_mknod(struct path *dir, struct dentry *dentry, int mode, | 2804 | int security_path_mknod(struct path *dir, struct dentry *dentry, int mode, |
2808 | unsigned int dev); | 2805 | unsigned int dev); |
2809 | int security_path_truncate(struct path *path, loff_t length, | 2806 | int security_path_truncate(struct path *path); |
2810 | unsigned int time_attrs); | ||
2811 | int security_path_symlink(struct path *dir, struct dentry *dentry, | 2807 | int security_path_symlink(struct path *dir, struct dentry *dentry, |
2812 | const char *old_name); | 2808 | const char *old_name); |
2813 | int security_path_link(struct dentry *old_dentry, struct path *new_dir, | 2809 | int security_path_link(struct dentry *old_dentry, struct path *new_dir, |
@@ -2841,8 +2837,7 @@ static inline int security_path_mknod(struct path *dir, struct dentry *dentry, | |||
2841 | return 0; | 2837 | return 0; |
2842 | } | 2838 | } |
2843 | 2839 | ||
2844 | static inline int security_path_truncate(struct path *path, loff_t length, | 2840 | static inline int security_path_truncate(struct path *path) |
2845 | unsigned int time_attrs) | ||
2846 | { | 2841 | { |
2847 | return 0; | 2842 | return 0; |
2848 | } | 2843 | } |
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 0cfa1e9c4cc1..f1e5bde4b35a 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
@@ -33,6 +33,20 @@ | |||
33 | #define XATTR_USER_PREFIX "user." | 33 | #define XATTR_USER_PREFIX "user." |
34 | #define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1) | 34 | #define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1) |
35 | 35 | ||
36 | /* Security namespace */ | ||
37 | #define XATTR_SELINUX_SUFFIX "selinux" | ||
38 | #define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX | ||
39 | |||
40 | #define XATTR_SMACK_SUFFIX "SMACK64" | ||
41 | #define XATTR_SMACK_IPIN "SMACK64IPIN" | ||
42 | #define XATTR_SMACK_IPOUT "SMACK64IPOUT" | ||
43 | #define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX | ||
44 | #define XATTR_NAME_SMACKIPIN XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN | ||
45 | #define XATTR_NAME_SMACKIPOUT XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT | ||
46 | |||
47 | #define XATTR_CAPS_SUFFIX "capability" | ||
48 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX | ||
49 | |||
36 | struct inode; | 50 | struct inode; |
37 | struct dentry; | 51 | struct dentry; |
38 | 52 | ||