Skip to content

Commit 25d60ba

Browse files
Dan Carpenteropsiff
authored andcommitted
apparmor: use passed in gfp flags in aa_alloc_null()
[ Upstream commit afad535 ] These allocations should use the gfp flags from the caller instead of GFP_KERNEL. But from what I can see, all the callers pass in GFP_KERNEL so this does not affect runtime. Fixes: e31dd6e412f7 ("apparmor: fix: kzalloc perms tables for shared dfas") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: John Johansen <john.johansen@canonical.com> Stable-dep-of: a4c9efa ("apparmor: make label_match return a consistent value") Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit e78e00cf9ebae58f2e94f04a92ad5d4cbe692039) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent a1f8b15 commit 25d60ba

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

security/apparmor/policy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,12 +591,12 @@ struct aa_profile *aa_alloc_null(struct aa_profile *parent, const char *name,
591591
profile->label.flags |= FLAG_NULL;
592592
rules = list_first_entry(&profile->rules, typeof(*rules), list);
593593
rules->file.dfa = aa_get_dfa(nulldfa);
594-
rules->file.perms = kcalloc(2, sizeof(struct aa_perms), GFP_KERNEL);
594+
rules->file.perms = kcalloc(2, sizeof(struct aa_perms), gfp);
595595
if (!rules->file.perms)
596596
goto fail;
597597
rules->file.size = 2;
598598
rules->policy.dfa = aa_get_dfa(nulldfa);
599-
rules->policy.perms = kcalloc(2, sizeof(struct aa_perms), GFP_KERNEL);
599+
rules->policy.perms = kcalloc(2, sizeof(struct aa_perms), gfp);
600600
if (!rules->policy.perms)
601601
goto fail;
602602
rules->policy.size = 2;

0 commit comments

Comments
 (0)