Skip to content

Commit 6600e9f

Browse files
committed
apparmor: add missing failure check in compute_xmatch_perms
Add check for failure to allocate the permission table. Fixes: caa9f57 ("apparmor: isolate policy backwards compatibility to its own file") Signed-off-by: John Johansen <[email protected]>
1 parent 000518b commit 6600e9f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

security/apparmor/policy_compat.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ static struct aa_perms *compute_xmatch_perms(struct aa_dfa *xmatch)
180180
state_count = xmatch->tables[YYTD_ID_BASE]->td_lolen;
181181
/* DFAs are restricted from having a state_count of less than 2 */
182182
perms = kvcalloc(state_count, sizeof(struct aa_perms), GFP_KERNEL);
183+
if (!perms)
184+
return NULL;
183185

184186
/* zero init so skip the trap state (state == 0) */
185187
for (state = 1; state < state_count; state++)

0 commit comments

Comments
 (0)