Skip to content

Commit 17d0d04

Browse files
rlee287jrjohansen
authored andcommitted
apparmor: allocate xmatch for nullpdb inside aa_alloc_null
attach->xmatch was not set when allocating a null profile, which is used in complain mode to allocate a learning profile. This was causing downstream failures in find_attach, which expected a valid xmatch but did not find one under a certain sequence of profile transitions in complain mode. This patch ensures the xmatch is set up properly for null profiles. Signed-off-by: Ryan Lee <[email protected]> Signed-off-by: John Johansen <[email protected]>
1 parent aaf20f8 commit 17d0d04

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

security/apparmor/policy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ struct aa_profile *aa_alloc_null(struct aa_profile *parent, const char *name,
626626

627627
/* TODO: ideally we should inherit abi from parent */
628628
profile->label.flags |= FLAG_NULL;
629+
profile->attach.xmatch = aa_get_pdb(nullpdb);
629630
rules = list_first_entry(&profile->rules, typeof(*rules), list);
630631
rules->file = aa_get_pdb(nullpdb);
631632
rules->policy = aa_get_pdb(nullpdb);

0 commit comments

Comments
 (0)