summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2016-06-15 10:00:55 +0300
committerJiri Slaby <jslaby@suse.cz>2017-01-27 13:16:14 +0300
commitd035c957c895e43b78939f092c052ac6921b360d (patch)
tree5653444326fd15ae23703ba392adeb6a0f103edb /security
parent66bffcb518fcb98d0c6e34fc9b6d11373e696b0d (diff)
downloadlinux-d035c957c895e43b78939f092c052ac6921b360d.tar.xz
apparmor: fix oops in profile_unpack() when policy_db is not present
commit 5f20fdfed16bc599a325a145bf0123a8e1c9beea upstream. BugLink: http://bugs.launchpad.net/bugs/1592547 If unpack_dfa() returns NULL due to the dfa not being present, profile_unpack() is not checking if the dfa is not present (NULL). Signed-off-by: John Johansen <john.johansen@canonical.com> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'security')
-rw-r--r--security/apparmor/policy_unpack.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index c841b1268a84..dac2121bc873 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -583,6 +583,9 @@ static struct aa_profile *unpack_profile(struct aa_ext *e)
error = PTR_ERR(profile->policy.dfa);
profile->policy.dfa = NULL;
goto fail;
+ } else if (!profile->policy.dfa) {
+ error = -EPROTO;
+ goto fail;
}
if (!unpack_u32(e, &profile->policy.start[0], "start"))
/* default start state */