Skip to content

Commit

Permalink
apparmor: fix oops in profile_unpack() when policy_db is not present
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John Johansen committed Jul 12, 2016
1 parent 3197f5a commit 5f20fdf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions security/apparmor/policy_unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 5f20fdf

Please sign in to comment.