diff --git a/mm/vma.c b/mm/vma.c index acdf00346cda..695d0be85ac8 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -3391,7 +3391,8 @@ static int acct_stack_growth(struct vm_area_struct *vma, * Overcommit.. This must be the final test, as it will * update security statistics. */ - if (security_vm_enough_memory_mm(mm, grow)) + if (vma_test(vma, VMA_ACCOUNT_BIT) && + security_vm_enough_memory_mm(mm, grow)) return -ENOMEM; return 0;