Skip to content

Instantly share code, notes, and snippets.

@Stebalien
Created April 18, 2017 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stebalien/4bd429815f5695284ab69da826fcb404 to your computer and use it in GitHub Desktop.
Save Stebalien/4bd429815f5695284ab69da826fcb404 to your computer and use it in GitHub Desktop.
--- a/security/apparmor/policy_unpack.c 2017-04-17 21:12:26.765200867 -0700
+++ b/security/apparmor/policy_unpack.c 2017-04-17 21:11:48.449086006 -0700
@@ -941,9 +941,11 @@
if (error)
goto fail_profile;
+#ifdef CONFIG_SECURITY_APPARMOR_HASH
if (aa_g_hash_policy)
error = aa_calc_profile_hash(profile, e.version, start,
e.pos - start);
+#endif
if (error)
goto fail_profile;
@@ -958,6 +960,7 @@
list_add_tail(&ent->list, lh);
}
udata->abi = e.version & K_ABI_MASK;
+#ifdef CONFIG_SECURITY_APPARMOR_HASH
if (aa_g_hash_policy) {
udata->hash = aa_calc_hash(udata->data, udata->size);
if (IS_ERR(udata->hash)) {
@@ -966,6 +969,7 @@
goto fail;
}
}
+#endif
return 0;
fail_profile:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment