deepin-kernel/mm
Yeoreum Yun 03844d95c0 kasan: remove kasan_find_vm_area() to prevent possible deadlock
commit 6ee9b3d84775944fb8c8a447961cd01274ac671c upstream.

find_vm_area() couldn't be called in atomic_context.  If find_vm_area() is
called to reports vm area information, kasan can trigger deadlock like:

CPU0                                CPU1
vmalloc();
 alloc_vmap_area();
  spin_lock(&vn->busy.lock)
                                    spin_lock_bh(&some_lock);
   <interrupt occurs>
   <in softirq>
   spin_lock(&some_lock);
                                    <access invalid address>
                                    kasan_report();
                                     print_report();
                                      print_address_description();
                                       kasan_find_vm_area();
                                        find_vm_area();
                                         spin_lock(&vn->busy.lock) // deadlock!

To prevent possible deadlock while kasan reports, remove kasan_find_vm_area().

Link: https://lkml.kernel.org/r/20250703181018.580833-1-yeoreum.yun@arm.com
Fixes: c056a364e9 ("kasan: print virtual mapping info in reports")
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reported-by: Yunseong Kim <ysk@kzalloc.com>
Reviewed-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8377d7744bdce5c4b3f1b58924eebd3fdc078dfc)
2025-07-22 16:16:48 +08:00
..
damon mm/damon/sysfs-schemes: free old damon_sysfs_scheme_filter->memcg_path on write 2025-07-09 09:49:59 +08:00
kasan kasan: remove kasan_find_vm_area() to prevent possible deadlock 2025-07-22 16:16:48 +08:00
kfence kfence: save freeing stack trace at calling time instead of freeing time 2025-07-02 15:47:33 +08:00
kmsan dma: kmsan: export kmsan_handle_dma() for modules 2025-03-18 15:20:51 +08:00
Kconfig mm/memcg: Introduce watermark stepping 2025-06-30 23:51:08 +08:00
Kconfig.debug mm: page_table_check: Make it dependent on EXCLUSIVE_SYSTEM_RAM 2023-05-29 16:14:28 +01:00
Makefile - Some swap cleanups from Ma Wupeng ("fix WARN_ON in add_to_avail_list") 2023-08-29 14:25:26 -07:00
OWNERS deepin: Add OWNERS for deepin kernel 2024-12-10 20:40:16 +08:00
backing-dev.c blk-wbt: Fix detection of dirty-throttled tasks 2024-02-23 09:25:16 +01:00
balloon_compaction.c
bootmem_info.c
cma.c mm/cma: using per-CMA locks to improve concurrent allocation performance 2025-05-08 14:51:17 +08:00
cma.h mm/cma: using per-CMA locks to improve concurrent allocation performance 2025-05-08 14:51:17 +08:00
cma_debug.c
cma_sysfs.c mm: cma: make kobj_type structure constant 2023-03-28 16:20:06 -07:00
compaction.c mm: compaction: use the proper flag to determine watermarks 2025-05-08 14:51:17 +08:00
debug.c mm: update validate_mm() to use vma iterator 2023-06-09 16:25:31 -07:00
debug_page_alloc.c mm: page_alloc: split out DEBUG_PAGEALLOC 2023-06-09 16:25:23 -07:00
debug_page_ref.c
debug_vm_pgtable.c mm/debug_vm_pgtable: drop RANDOM_ORVALUE trick 2024-12-10 20:40:36 +08:00
dmapool.c dmapool: create/destroy cleanup 2023-06-09 16:25:17 -07:00
dmapool_test.c dmapool: add alloc/free performance test 2023-04-05 19:42:38 -07:00
early_ioremap.c mm/early_ioremap.c: improve the execution efficiency of early_ioremap_setup() 2023-06-09 16:25:56 -07:00
fadvise.c mm: remove unnecessary pagevec includes 2023-06-23 16:59:31 -07:00
fail_page_alloc.c mm: page_alloc: split out FAIL_PAGE_ALLOC 2023-06-09 16:25:23 -07:00
failslab.c
filemap.c filemap: remove use of wait bookmarks 2025-07-04 11:01:37 +08:00
folio-compat.c filemap: Add fgf_t typedef 2023-07-24 18:04:30 -04:00
gup.c mm/gup: fix wrongly calculated returned value in fault_in_safe_writeable() 2025-05-09 22:54:46 +08:00
gup_test.c Merge mm-hotfixes-stable into mm-stable to pick up depended-upon changes. 2023-06-23 16:58:19 -07:00
gup_test.h
highmem.c mm: ptep_get() conversion 2023-06-19 16:19:25 -07:00
hmm.c mm: enable page walking API to lock vmas during the walk 2023-08-21 13:07:20 -07:00
huge_memory.c mm/huge_memory: fix dereferencing invalid pmd migration entry 2025-07-03 11:32:09 +08:00
hugetlb.c mm/hugetlb: unshare page tables during VMA split, not before 2025-07-03 11:32:08 +08:00
hugetlb_cgroup.c mm/hugetlb: increase use of folios in alloc_huge_page() 2023-02-13 15:54:27 -08:00
hugetlb_vmemmap.c mm: hugetlb_vmemmap: fix hugetlb page number decrease failed on movable nodes 2025-05-08 14:51:17 +08:00
hugetlb_vmemmap.h
hwpoison-inject.c
init-mm.c mm: move dummy_vm_ops out of a header 2023-08-21 13:37:46 -07:00
internal.h mm/memcg: Introduce watermark stepping 2025-06-30 23:51:08 +08:00
interval_tree.c
io-mapping.c
ioremap.c mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed 2023-08-18 10:12:36 -07:00
khugepaged.c treewide: mark stuff as __ro_after_init 2025-02-24 17:12:56 +08:00
kmemleak.c mm: kmemleak: fix upper boundary check for physical address objects 2025-02-18 11:53:09 +08:00
ksm.c mm/ksm: fix ksm_zero_pages accounting 2024-12-10 20:26:28 +08:00
list_lru.c
maccess.c mm: Fix copy_from_user_nofault(). 2023-04-12 17:36:23 -07:00
madvise.c mm,madvise,hugetlb: check for 0-length range after end address adjustment 2025-03-14 17:42:52 +08:00
mapping_dirty_helpers.c mm: fix clean_record_shared_mapping_range kernel-doc 2023-08-24 16:20:30 -07:00
memblock.c memblock: Accept allocated memory before use in memblock_double_array() 2025-05-26 10:36:30 +08:00
memcontrol.c mm/memcg: Introduce watermark stepping 2025-06-30 23:51:08 +08:00
memfd.c revert "memfd: improve userspace warnings for missing exec-related flags". 2023-09-05 11:11:52 -07:00
memory-failure.c mm/memory-failure: fix crash in split_huge_page_to_list from soft_offline_page 2025-07-22 00:09:43 +08:00
memory-tiers.c memory tier: use helper macro __ATTR_RW() 2023-08-18 10:12:38 -07:00
memory.c mm: fix apply_to_existing_page_range() 2025-05-09 22:54:46 +08:00
memory_hotplug.c hwpoison, memory_hotplug: lock folio before unmap hwpoisoned folio 2025-05-26 10:36:31 +08:00
mempolicy.c FROMLIST: mm/mempolicy: fix unbalanced unlock in backported VMA check 2025-03-06 21:11:07 +08:00
mempool.c mempool: do not use ksize() for poisoning 2022-11-30 15:58:41 -08:00
memremap.c mm/memremap.c: fix outdated comment in devm_memremap_pages 2023-02-09 16:51:46 -08:00
memtest.c x86: memtest: WARN if bad RAM found 2024-12-27 16:21:52 +08:00
migrate.c mm/migrate: correct nr_failed in migrate_pages_sync() 2025-05-26 10:36:29 +08:00
migrate_device.c Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
mincore.c mm: enable page walking API to lock vmas during the walk 2023-08-21 13:07:20 -07:00
mlock.c merge mm-hotfixes-stable into mm-stable to pick up depended-upon changes 2023-08-21 14:26:20 -07:00
mm_init.c efi: disable mirror feature during crashkernel 2024-01-31 16:18:56 -08:00
mm_slot.h
mmap.c mm/hugetlb: unshare page tables during VMA split, not before 2025-07-03 11:32:08 +08:00
mmap_lock.c mm: mmap_lock: replace get_memcg_path_buf() with on-stack buffer 2024-12-10 20:39:57 +08:00
mmu_gather.c mm: fix kernel-doc warning from tlb_flush_rmaps() 2023-08-24 16:20:30 -07:00
mmu_notifier.c mmu_notifiers: rename invalidate_range notifier 2023-08-18 10:12:41 -07:00
mmzone.c
mprotect.c mm: refactor map_deny_write_exec() 2024-12-10 20:43:58 +08:00
mremap.c mm/mremap: correctly handle partial mremap() of VMA starting at 0 2025-05-09 18:47:27 +08:00
msync.c
nommu.c mm: add nommu variant of vm_insert_pages() 2025-03-23 19:56:38 +08:00
oom_kill.c memcg: fix soft lockup in the OOM process 2025-03-14 17:40:52 +08:00
page-writeback.c mm: fix ratelimit_pages update error in dirty_ratio_handler() 2025-07-03 11:31:56 +08:00
page_alloc.c mm/memcg: Introduce watermark stepping 2025-06-30 23:51:08 +08:00
page_counter.c
page_ext.c mm/page_ext: move functions around for minor cleanups to page_ext 2023-08-18 10:12:31 -07:00
page_idle.c mm: page_idle: convert page idle to use a folio 2023-01-18 17:12:52 -08:00
page_io.c zswap: make zswap_load() take a folio 2023-08-21 13:37:27 -07:00
page_isolation.c mm/hugetlb: wait for hugetlb folios to be freed 2025-05-08 14:51:17 +08:00
page_owner.c mm/page_ext: use page_ext_data helper in page_owner 2023-08-21 13:37:27 -07:00
page_poison.c mm/page_poison: remove unused page_ext.h from page_poison 2023-08-21 13:37:30 -07:00
page_reporting.c mm, treewide: introduce NR_PAGE_ORDERS 2024-05-05 17:12:09 +08:00
page_reporting.h
page_table_check.c mm/page_table_check: support userfault wr-protect entries 2024-12-10 20:40:35 +08:00
page_vma_mapped.c mm: make page_mapped_in_vma() hugetlb walk aware 2025-05-09 18:47:26 +08:00
pagewalk.c mm/pagewalk: fix bootstopping regression from extra pte_unmap() 2023-09-02 08:39:21 -07:00
percpu-internal.h percpu-internal/pcpu_chunk: re-layout pcpu_chunk structure to reduce false sharing 2023-06-19 16:19:29 -07:00
percpu-km.c
percpu-stats.c
percpu-vm.c
percpu.c percpu: scoped objcg protection 2025-06-23 14:49:58 +08:00
pgalloc-track.h
pgtable-generic.c mm: fix race between __split_huge_pmd_locked() and GUP-fast 2024-12-10 20:26:28 +08:00
process_vm_access.c mm/gup: remove unused vmas parameter from pin_user_pages_remote() 2023-06-09 16:25:25 -07:00
ptdump.c mm: ptdump should use ptep_get_lockless() 2023-06-19 16:19:24 -07:00
readahead.c mm/readahead: fix large folio support in async readahead 2025-01-13 11:06:44 +08:00
rmap.c mm/rmap: reject hugetlb folios in folio_make_device_exclusive() 2025-05-09 18:47:26 +08:00
rodata_test.c
secretmem.c fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass 2025-07-14 10:42:17 +08:00
shmem.c treewide: mark stuff as __ro_after_init 2025-02-24 17:12:56 +08:00
shmem_quota.c tmpfs: fix race on handling dquot rbtree 2024-04-03 15:28:54 +02:00
show_mem.c mm, treewide: introduce NR_PAGE_ORDERS 2024-05-05 17:12:09 +08:00
shrinker_debug.c Revert "mm: shrinkers: make count and scan in shrinker debugfs lockless" 2023-06-19 13:19:34 -07:00
shuffle.c
shuffle.h mm, treewide: redefine MAX_ORDER sanely 2023-04-05 19:42:46 -07:00
slab.c Randomized slab caches for kmalloc() 2023-07-18 10:07:47 +02:00
slab.h mm: kmem: scoped objcg protection 2025-06-23 14:49:58 +08:00
slab_common.c mm: krealloc: Fix MTE false alarm in __do_krealloc 2024-12-10 20:43:50 +08:00
slub.c Haoc: Support pointer protection for ARM64 IEE (IEE_PTRP). 2025-05-12 15:02:47 +08:00
sparse-vmemmap.c LoongArch: Set initial pte entry with PAGE_GLOBAL for kernel space 2025-02-18 12:00:10 +08:00
sparse.c x86/kaslr: Expose and use the end of the physical memory address space 2024-12-10 20:41:16 +08:00
swap.c mm: page_alloc: move mlocked flag clearance into free_pages_prepare() 2024-12-16 00:22:41 +08:00
swap.h mm/swap: fix race when skipping swapcache 2024-03-01 13:35:00 +01:00
swap_cgroup.c
swap_slots.c
swap_state.c mm/swap: inline folio_set_swap_entry() and folio_swap_entry() 2023-08-24 16:20:28 -07:00
swapfile.c mm/swapfile: skip HugeTLB pages for unuse_vma 2024-12-10 20:42:54 +08:00
truncate.c mm: Fix missing folio invalidation calls during truncation 2024-12-10 20:41:02 +08:00
usercopy.c mm: Fix copy_from_user_nofault(). 2023-04-12 17:36:23 -07:00
userfaultfd.c userfaultfd: fix checks for huge PMDs 2024-12-10 20:41:18 +08:00
util.c mm: only enforce minimum stack gap size if it's sensible 2024-12-10 20:42:13 +08:00
vmalloc.c mm/vmalloc: leave lazy MMU mode on PTE mapping error 2025-07-22 16:16:43 +08:00
vmpressure.c net-memcg: Fix scope of sockmem pressure indicators 2023-08-16 12:21:32 +01:00
vmscan.c mm: add missing release barrier on PGDAT_RECLAIM_LOCKED unlock 2025-05-09 18:47:27 +08:00
vmstat.c mm: tune PCP high automatically 2025-05-11 23:02:49 +08:00
workingset.c mm: ratelimit stat flush from workingset shrinker 2024-12-10 20:26:24 +08:00
z3fold.c mm/z3fold: remove obsolete comment for struct z3fold_pool 2023-08-21 13:37:51 -07:00
zbud.c mm: zswap: remove shrink from zpool interface 2023-06-19 16:19:27 -07:00
zpool.c mm: zswap: remove shrink from zpool interface 2023-06-19 16:19:27 -07:00
zsmalloc.c merge mm-hotfixes-stable into mm-stable to pick up depended-upon changes 2023-08-21 14:26:20 -07:00
zswap.c mm: zswap: fix missing folio cleanup in writeback race path 2024-03-01 13:35:10 +01:00