summaryrefslogtreecommitdiffstats
path: root/security/apparmor/include/policy.h
diff options
context:
space:
mode:
authorDavid S. Miller2019-06-22 14:59:24 +0200
committerDavid S. Miller2019-06-22 14:59:24 +0200
commit92ad6325cb891bb455487bfe90cc47d18aa6ec37 (patch)
tree433a7ef938fae69789216043f67eff9f9c6b0c68 /security/apparmor/include/policy.h
parentMerge branch 'PCI-let-pci_disable_link_state-propagate-errors' (diff)
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff)
downloadkernel-qcow2-linux-92ad6325cb891bb455487bfe90cc47d18aa6ec37.tar.gz
kernel-qcow2-linux-92ad6325cb891bb455487bfe90cc47d18aa6ec37.tar.xz
kernel-qcow2-linux-92ad6325cb891bb455487bfe90cc47d18aa6ec37.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Minor SPDX change conflict. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'security/apparmor/include/policy.h')
-rw-r--r--security/apparmor/include/policy.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h
index 1ce4e9bdac48..b5b4b8190e65 100644
--- a/security/apparmor/include/policy.h
+++ b/security/apparmor/include/policy.h
@@ -213,7 +213,16 @@ static inline struct aa_profile *aa_get_newest_profile(struct aa_profile *p)
return labels_profile(aa_get_newest_label(&p->label));
}
-#define PROFILE_MEDIATES(P, T) ((P)->policy.start[(unsigned char) (T)])
+static inline unsigned int PROFILE_MEDIATES(struct aa_profile *profile,
+ unsigned char class)
+{
+ if (class <= AA_CLASS_LAST)
+ return profile->policy.start[class];
+ else
+ return aa_dfa_match_len(profile->policy.dfa,
+ profile->policy.start[0], &class, 1);
+}
+
static inline unsigned int PROFILE_MEDIATES_AF(struct aa_profile *profile,
u16 AF) {
unsigned int state = PROFILE_MEDIATES(profile, AA_CLASS_NET);