f5c12105c1
Current code does not contemplate scenarios were an allocation and free
operation on the same pages do not handle it in the same amount at once.
To give an example, page_alloc_exact(), where we will allocate a page of
enough order to stafisfy the size request, but we will free the remainings
right away.
In the above example, we will increment the stack_record refcount only
once, but we will decrease it the same number of times as number of unused
pages we have to free. This will lead to a warning because of refcount
imbalance.
Fix this by recording the number of base pages in the refcount field.
Link: https://lkml.kernel.org/r/20240404070702.2744-3-osalvador@suse.de
Reported-by: syzbot+41bbfdb8d41003d12c0f@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-mm/00000000000090e8ff0613eda0e5@google.com
Fixes:
|
||
---|---|---|
.. | ||
damon | ||
active_mm.rst | ||
arch_pgtable_helpers.rst | ||
balance.rst | ||
bootmem.rst | ||
free_page_reporting.rst | ||
highmem.rst | ||
hmm.rst | ||
hugetlbfs_reserv.rst | ||
hwpoison.rst | ||
index.rst | ||
ksm.rst | ||
memory-model.rst | ||
mmu_notifier.rst | ||
multigen_lru.rst | ||
numa.rst | ||
oom.rst | ||
overcommit-accounting.rst | ||
page_allocation.rst | ||
page_cache.rst | ||
page_frags.rst | ||
page_migration.rst | ||
page_owner.rst | ||
page_reclaim.rst | ||
page_table_check.rst | ||
page_tables.rst | ||
physical_memory.rst | ||
process_addrs.rst | ||
remap_file_pages.rst | ||
shmfs.rst | ||
slab.rst | ||
slub.rst | ||
split_page_table_lock.rst | ||
swap.rst | ||
transhuge.rst | ||
unevictable-lru.rst | ||
vmalloc.rst | ||
vmalloced-kernel-stacks.rst | ||
vmemmap_dedup.rst | ||
z3fold.rst | ||
zsmalloc.rst |