Re: [PATCH 43/46] mm/vma: don't leak the charge for stack growth

From: David Hildenbrand (Arm)

Date: Wed Oct 28 2026 - 04:18:50 EST


On 10/27/26 21:32, Harry Yoo wrote:
> On Tue, Oct 27, 2026 at 12:18:03AM +0100, David Hildenbrand (Arm) wrote:
>> acct_stack_growth() charges stack expansion even without VM_ACCOUNT.
>> This can happen for read-only or MAP_NORESERVE mappings created with
>> MAP_GROWSDOWN. Unmapping these VMAs does not release the charge, leaking
>> Committed_AS.
>>
>> Only check and charge growth for VM_ACCOUNT VMAs, matching mremap().
>> Unaccounted growth skips the overcommit check while remaining subject
>> to the other stack-growth limits.
>>
>> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
>> Cc: stable@xxxxxxxxxxxxxxx
>> Reported-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
>> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
>> Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
>> ---
>
> Looks good to me,
> Reviewed-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>
>
> Maybe worth having a warning when it's accounting w/o VMA_ACCOUNT_BIT
> or let those helpers skip when there's no VMA_ACCOUNT_BIT set...

You mean passing the VMA instead of the MM?

--
Cheers,

David