summaryrefslogtreecommitdiff
path: root/security/apparmor/apparmorfs.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2017-01-16 11:42:39 +0300
committerJohn Johansen <john.johansen@canonical.com>2017-01-16 12:18:32 +0300
commit474d6b75106229025ab6b7bbabf2f9c246e928e1 (patch)
tree9f2b5a9d15a299476e0dd8408db44e01fa30e180 /security/apparmor/apparmorfs.c
parent5ebfb12822656beec5c56b362d44e4db81c8e1eb (diff)
downloadlinux-474d6b75106229025ab6b7bbabf2f9c246e928e1.tar.xz
apparmor: prepare to support newer versions of policy
Newer policy encodes more than just version in the version tag, so add masking to make sure the comparison remains correct. Note: this is fully compatible with older policy as it will never set the bits being masked out. Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/apparmorfs.c')
-rw-r--r--security/apparmor/apparmorfs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 2b48be2169cb..49a5122e03fe 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -799,9 +799,15 @@ static struct aa_fs_entry aa_fs_entry_domain[] = {
{ }
};
+static struct aa_fs_entry aa_fs_entry_versions[] = {
+ AA_FS_FILE_BOOLEAN("v5", 1),
+ { }
+};
+
static struct aa_fs_entry aa_fs_entry_policy[] = {
- AA_FS_FILE_BOOLEAN("set_load", 1),
- {}
+ AA_FS_DIR("versions", aa_fs_entry_versions),
+ AA_FS_FILE_BOOLEAN("set_load", 1),
+ { }
};
static struct aa_fs_entry aa_fs_entry_features[] = {