kernel-aes67/Documentation/mm
Oscar Salvador f5c12105c1 mm,page_owner: fix refcount imbalance
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: 217b2119b9 ("mm,page_owner: implement the tracking of the stacks count")
Signed-off-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Marco Elver <elver@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-04-16 15:39:49 -07:00
..
damon Docs/mm/damon/design: remove the details for pageout as paddr doesn't use MADV_PAGEOUT 2024-03-04 17:01:17 -08:00
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 ubifs: Convert ubifs_vm_page_mkwrite() to use a folio 2024-02-25 21:08:00 +01:00
page_frags.rst
page_migration.rst
page_owner.rst mm,page_owner: fix refcount imbalance 2024-04-16 15:39:49 -07:00
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 mm/slub: make the description of slab_min_objects helpful in doc 2024-01-22 10:31:08 +01:00
split_page_table_lock.rst
swap.rst
transhuge.rst mm/rmap: rename COMPOUND_MAPPED to ENTIRELY_MAPPED 2023-12-29 11:58:56 -08:00
unevictable-lru.rst Documentation: stop referring to page_remove_rmap() 2023-12-29 11:58:54 -08:00
vmalloc.rst
vmalloced-kernel-stacks.rst
vmemmap_dedup.rst
z3fold.rst
zsmalloc.rst