summaryrefslogtreecommitdiffstats
path: root/security/apparmor/net.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2020-11-17 01:38:16 -0800
committerJohn Johansen <john.johansen@canonical.com>2022-10-03 14:49:03 -0700
commite2967ede22978f132cd52929edff96c701bde0eb (patch)
treebe2a22d52d6bd15e44ee25a507fb589d464951ff /security/apparmor/net.c
parente48ffd24c1d87dba227225615790cd059a707adb (diff)
downloadlinux-e2967ede22978f132cd52929edff96c701bde0eb.tar.bz2
apparmor: compute policydb permission on profile load
Rather than computing policydb permissions for each access permissions can be computed once on profile load and stored for lookup. Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/net.c')
-rw-r--r--security/apparmor/net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/apparmor/net.c b/security/apparmor/net.c
index 7efe4d17273d..88e8a7ea54c0 100644
--- a/security/apparmor/net.c
+++ b/security/apparmor/net.c
@@ -125,7 +125,7 @@ int aa_profile_af_perm(struct aa_profile *profile, struct common_audit_data *sa,
buffer[1] = cpu_to_be16((u16) type);
state = aa_dfa_match_len(profile->policy.dfa, state, (char *) &buffer,
4);
- aa_compute_perms(profile->policy.dfa, state, &perms);
+ perms = *aa_lookup_perms(profile->policy.perms, state);
aa_apply_modes_to_perms(profile, &perms);
return aa_check_perms(profile, &perms, request, sa, audit_net_cb);