diff options
| author | John Johansen <john.johansen@canonical.com> | 2016-06-15 10:00:55 +0300 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-07-04 11:51:27 +0200 |
| commit | e8ab89e5484950967c8ef5d29586480b98bc09ee (patch) | |
| tree | 2a1054cd707109526097d099bb41e710356cd843 /security | |
| parent | 9d907897aa854bb9db41f737e53f20eec7eda918 (diff) | |
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: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'security')
| -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 6b221354f..55ff3eecd 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -571,6 +571,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 */ |
