Skip to content

Commit 4c3f731

Browse files
canonical-rlee287gregkh
authored andcommitted
apparmor: allocate xmatch for nullpdb inside aa_alloc_null
commit 17d0d04 upstream. 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]> Cc: Paul Kramme <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 35c2f2a commit 4c3f731

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)