summaryrefslogtreecommitdiff
path: root/security/apparmor/policy_unpack.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2014-10-24 20:16:14 +0400
committerJohn Johansen <john.johansen@canonical.com>2016-07-12 18:43:10 +0300
commit6059f71f1e94486a51cef90e872add11fa7b5775 (patch)
treeab2c3f7e887584e678843347030f35aab7828074 /security/apparmor/policy_unpack.c
parentbd35db8b8ca6e27fc17a9057ef78e1ddfc0de351 (diff)
downloadlinux-6059f71f1e94486a51cef90e872add11fa7b5775.tar.xz
apparmor: add parameter to control whether policy hashing is used
Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Tyler Hicks <tyhicks@canonical.com> Acked-by: Seth Arnold <seth.arnold@canonical.com>
Diffstat (limited to 'security/apparmor/policy_unpack.c')
-rw-r--r--security/apparmor/policy_unpack.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index a689f10930b5..a55fb2f170c9 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -775,8 +775,9 @@ int aa_unpack(void *udata, size_t size, struct list_head *lh, const char **ns)
if (error)
goto fail_profile;
- error = aa_calc_profile_hash(profile, e.version, start,
- e.pos - start);
+ if (aa_g_hash_policy)
+ error = aa_calc_profile_hash(profile, e.version, start,
+ e.pos - start);
if (error)
goto fail_profile;