diff options
| author | Lorenzo Stoakes (ARM) <ljs@kernel.org> | 2026-09-02 19:08:08 +0100 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-09-08 23:28:06 -0700 |
| commit | 6cc27d82196385fe06853319f74312a7d8019726 (patch) | |
| tree | d3e19140c56706fefd77aa347a8762528459dea5 /scripts/Makefile.thinlto | |
| parent | e14a3454806468b086fe2e4ca2e1bff95b528531 (diff) | |
| download | linux-stable-6cc27d82196385fe06853319f74312a7d8019726.tar.gz linux-stable-6cc27d82196385fe06853319f74312a7d8019726.zip | |
mm/vma: correctly unaccount on mmap_prepare() failure
__mmap_setup() accounts memory for relevant mappings via:
security_vm_enough_memory_mm()
-> __vm_enough_memory()
-> vm_acct_memory()
If __mmap_setup() fails, this indicates that this accounting did not take
place, and thus it's appropriate for __mmap_region() to jump to
abort_munmap.
However if call_mmap_prepare() fails, it also jumps there and any accounted
memory is not correctly unaccounted.
Fix this by handling each error separately.
Link: https://lore.kernel.org/20260902-fix-unaccount-mmap_prepare-v1-1-ea070189fdfb@kernel.org
Fixes: c84bf6dd2b83 ("mm: introduce new .mmap_prepare() file callback")
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
