diff options
author | John Johansen <john.johansen@canonical.com> | 2016-06-15 03:00:55 -0400 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2016-07-12 11:43:10 -0400 |
commit | 5f20fdfed16bc599a325a145bf0123a8e1c9beea (patch) | |
tree | fa700aadf27b4e0f454918b6dd06c7a40133173c | |
parent | 3197f5adf539a3ee6331f433a51483f8c842f890 (diff) |
apparmor: fix oops in profile_unpack() when policy_db is not present
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>
-rw-r--r-- | security/apparmor/policy_unpack.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index 951ae4633979..b9b1c66a32a5 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) | |||
583 | error = PTR_ERR(profile->policy.dfa); | 583 | error = PTR_ERR(profile->policy.dfa); |
584 | profile->policy.dfa = NULL; | 584 | profile->policy.dfa = NULL; |
585 | goto fail; | 585 | goto fail; |
586 | } else if (!profile->policy.dfa) { | ||
587 | error = -EPROTO; | ||
588 | goto fail; | ||
586 | } | 589 | } |
587 | if (!unpack_u32(e, &profile->policy.start[0], "start")) | 590 | if (!unpack_u32(e, &profile->policy.start[0], "start")) |
588 | /* default start state */ | 591 | /* default start state */ |