]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
apparmor: add label data availability to the feature set
authorJohn Johansen <john.johansen@canonical.com>
Sat, 27 May 2017 01:49:04 +0000 (18:49 -0700)
committerJohn Johansen <john.johansen@canonical.com>
Sun, 11 Jun 2017 00:11:28 +0000 (17:11 -0700)
gsettings mediation needs to be able to determine if apparmor supports
label data queries. A label data query can be done to test for support
but its failure is indistinguishable from other failures, making it an
unreliable indicator.

Fix by making support of label data queries available as a flag in the
apparmorfs features dir tree.

Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/apparmorfs.c

index 7f3049300ce3db10e9d0a92b46ae34b69f37fb2c..a447c00a452caf4e26658d6bdabb3eb91137b7c3 100644 (file)
@@ -1849,6 +1849,15 @@ static struct aa_sfs_entry aa_sfs_entry_policy[] = {
        { }
 };
 
+static struct aa_sfs_entry aa_sfs_entry_query_label[] = {
+       AA_SFS_FILE_BOOLEAN("data",             1),
+       { }
+};
+
+static struct aa_sfs_entry aa_sfs_entry_query[] = {
+       AA_SFS_DIR("label",                     aa_sfs_entry_query_label),
+       { }
+};
 static struct aa_sfs_entry aa_sfs_entry_features[] = {
        AA_SFS_DIR("policy",                    aa_sfs_entry_policy),
        AA_SFS_DIR("domain",                    aa_sfs_entry_domain),
@@ -1856,6 +1865,7 @@ static struct aa_sfs_entry aa_sfs_entry_features[] = {
        AA_SFS_FILE_U64("capability",           VFS_CAP_FLAGS_MASK),
        AA_SFS_DIR("rlimit",                    aa_sfs_entry_rlimit),
        AA_SFS_DIR("caps",                      aa_sfs_entry_caps),
+       AA_SFS_DIR("query",                     aa_sfs_entry_query),
        { }
 };