diff options
author | Kees Cook <kees@outflux.net> | 2012-01-26 19:29:21 -0500 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2012-02-27 14:38:17 -0500 |
commit | e74abcf3359d0130e99a6511ac484a3ea9e6e988 (patch) | |
tree | 53b512c463f58546f810f7db876b81bebf4c786a /security/apparmor/include | |
parent | 9acd494be9387b0608612cd139967201dd7a4e12 (diff) |
AppArmor: add initial "features" directory to securityfs
This adds the "features" subdirectory to the AppArmor securityfs
to display boolean features flags and the known capability mask.
Signed-off-by: Kees Cook <kees@ubuntu.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/include')
-rw-r--r-- | security/apparmor/include/apparmorfs.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/security/apparmor/include/apparmorfs.h b/security/apparmor/include/apparmorfs.h index 4fdf02f26a3a..16e654530f30 100644 --- a/security/apparmor/include/apparmorfs.h +++ b/security/apparmor/include/apparmorfs.h | |||
@@ -16,6 +16,8 @@ | |||
16 | #define __AA_APPARMORFS_H | 16 | #define __AA_APPARMORFS_H |
17 | 17 | ||
18 | enum aa_fs_type { | 18 | enum aa_fs_type { |
19 | AA_FS_TYPE_BOOLEAN, | ||
20 | AA_FS_TYPE_U64, | ||
19 | AA_FS_TYPE_FOPS, | 21 | AA_FS_TYPE_FOPS, |
20 | AA_FS_TYPE_DIR, | 22 | AA_FS_TYPE_DIR, |
21 | }; | 23 | }; |
@@ -28,11 +30,23 @@ struct aa_fs_entry { | |||
28 | umode_t mode; | 30 | umode_t mode; |
29 | enum aa_fs_type v_type; | 31 | enum aa_fs_type v_type; |
30 | union { | 32 | union { |
33 | bool boolean; | ||
34 | unsigned long u64; | ||
31 | struct aa_fs_entry *files; | 35 | struct aa_fs_entry *files; |
32 | } v; | 36 | } v; |
33 | const struct file_operations *file_ops; | 37 | const struct file_operations *file_ops; |
34 | }; | 38 | }; |
35 | 39 | ||
40 | extern const struct file_operations aa_fs_seq_file_ops; | ||
41 | |||
42 | #define AA_FS_FILE_BOOLEAN(_name, _value) \ | ||
43 | { .name = (_name), .mode = 0444, \ | ||
44 | .v_type = AA_FS_TYPE_BOOLEAN, .v.boolean = (_value), \ | ||
45 | .file_ops = &aa_fs_seq_file_ops } | ||
46 | #define AA_FS_FILE_U64(_name, _value) \ | ||
47 | { .name = (_name), .mode = 0444, \ | ||
48 | .v_type = AA_FS_TYPE_U64, .v.u64 = (_value), \ | ||
49 | .file_ops = &aa_fs_seq_file_ops } | ||
36 | #define AA_FS_FILE_FOPS(_name, _mode, _fops) \ | 50 | #define AA_FS_FILE_FOPS(_name, _mode, _fops) \ |
37 | { .name = (_name), .v_type = AA_FS_TYPE_FOPS, \ | 51 | { .name = (_name), .v_type = AA_FS_TYPE_FOPS, \ |
38 | .mode = (_mode), .file_ops = (_fops) } | 52 | .mode = (_mode), .file_ops = (_fops) } |