Skip to content

Commit a2081b7

Browse files
committed
apparmor: document first entry is in packed perms struct is reserved
Add a comment to unpack_perm to document the first entry in the packed perms struct is reserved, and make a non-functional change of unpacking to a temporary stack variable named "reserved" to help suppor the documentation of which value is reserved. Suggested-by: Serge E. Hallyn <[email protected]> Signed-off-by: John Johansen <[email protected]>
1 parent 7290f59 commit a2081b7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

security/apparmor/policy_unpack.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,13 @@ static bool unpack_rlimits(struct aa_ext *e, struct aa_ruleset *rules)
645645

646646
static bool unpack_perm(struct aa_ext *e, u32 version, struct aa_perms *perm)
647647
{
648+
u32 reserved;
649+
648650
if (version != 1)
649651
return false;
650652

651-
return aa_unpack_u32(e, &perm->allow, NULL) &&
653+
/* reserved entry is for later expansion, discard for now */
654+
return aa_unpack_u32(e, &reserved, NULL) &&
652655
aa_unpack_u32(e, &perm->allow, NULL) &&
653656
aa_unpack_u32(e, &perm->deny, NULL) &&
654657
aa_unpack_u32(e, &perm->subtree, NULL) &&

0 commit comments

Comments
 (0)