Skip to content

Commit 4d9d1a0

Browse files
committed
apparmor: fix: accept2 being specifie even when permission table is presnt
The transition to the perms32 permission table dropped the need for the accept2 table as permissions. However accept2 can be used for flags and may be present even when the perms32 table is present. So instead of checking on version, check whether the table is present. Fixes: 2e12c5f ("apparmor: add additional flags to extended permission.") Signed-off-by: John Johansen <[email protected]>
1 parent 9afdc6a commit 4d9d1a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

security/apparmor/policy_unpack.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,8 @@ static int unpack_pdb(struct aa_ext *e, struct aa_policydb **policy,
775775
}
776776
}
777777

778-
if (pdb->perms && version <= 2) {
778+
/* accept2 is in some cases being allocated, even with perms */
779+
if (pdb->perms && !pdb->dfa->tables[YYTD_ID_ACCEPT2]) {
779780
/* add dfa flags table missing in v2 */
780781
u32 noents = pdb->dfa->tables[YYTD_ID_ACCEPT]->td_lolen;
781782
u16 tdflags = pdb->dfa->tables[YYTD_ID_ACCEPT]->td_flags;

0 commit comments

Comments
 (0)