Skip to content

Commit

Permalink
AppArmor: Add mising end of structure test to caps unpacking
Browse files Browse the repository at this point in the history
The unpacking of struct capsx is missing a check for the end of the
caps structure.  This can lead to unpack failures depending on what else
is packed into the policy file being unpacked.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees@ubuntu.com>
  • Loading branch information
John Johansen committed Feb 27, 2012
1 parent d384b0a commit cdbd288
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions security/apparmor/policy_unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,8 @@ static struct aa_profile *unpack_profile(struct aa_ext *e)
goto fail;
if (!unpack_u32(e, &(profile->caps.extended.cap[1]), NULL))
goto fail;
if (!unpack_nameX(e, AA_STRUCTEND, NULL))
goto fail;
}

if (!unpack_rlimits(e, profile))
Expand Down

0 comments on commit cdbd288

Please sign in to comment.