====================================================== WARNING: possible circular locking dependency detected 6.13.0-rc6-next-20250107-syzkaller #0 Not tainted ------------------------------------------------------ syz.3.134/6548 is trying to acquire lock: ffff8880610c2e88 (vm_lock){++++}-{0:0}, at: binder_alloc_free_page+0x150/0xd50 drivers/android/binder_alloc.c:1156 but task is already holding lock: ffff88802ec1b430 (&l->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff88802ec1b430 (&l->lock){+.+.}-{3:3}, at: lock_list_lru_of_memcg+0x24c/0x4d0 mm/list_lru.c:77 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&l->lock){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] lock_list_lru_of_memcg+0x24c/0x4d0 mm/list_lru.c:77 list_lru_del+0x58/0x1f0 mm/list_lru.c:202 zswap_lru_del mm/zswap.c:736 [inline] zswap_entry_free+0x1ff/0x440 mm/zswap.c:802 swap_range_free mm/swapfile.c:1130 [inline] swap_entry_range_free+0x28b/0x7a0 mm/swapfile.c:1509 __swap_entries_free mm/swapfile.c:1467 [inline] free_swap_and_cache_nr+0xaee/0xb90 mm/swapfile.c:1794 zap_nonpresent_ptes mm/memory.c:1636 [inline] do_zap_pte_range mm/memory.c:1702 [inline] zap_pte_range mm/memory.c:1740 [inline] zap_pmd_range mm/memory.c:1823 [inline] zap_pud_range mm/memory.c:1852 [inline] zap_p4d_range mm/memory.c:1873 [inline] unmap_page_range+0x1a61/0x48d0 mm/memory.c:1894 unmap_vmas+0x3cc/0x5f0 mm/memory.c:1984 exit_mmap+0x283/0xd50 mm/mmap.c:1284 __mmput+0x115/0x420 kernel/fork.c:1298 exit_mm+0x220/0x310 kernel/exit.c:570 do_exit+0x9ad/0x28e0 kernel/exit.c:925 do_group_exit+0x207/0x2c0 kernel/exit.c:1087 get_signal+0x16b2/0x1750 kernel/signal.c:3017 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xce/0x340 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&cluster_info[i].lock){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] lock_cluster mm/swapfile.c:445 [inline] __swap_duplicate+0x112/0x440 mm/swapfile.c:3540 swap_duplicate+0x20/0x70 mm/swapfile.c:3619 try_to_unmap_one+0x149f/0x29d0 mm/rmap.c:1901 rmap_walk_anon+0x4be/0x720 mm/rmap.c:2646 try_to_unmap+0x243/0x2e0 shrink_folio_list+0x1bcc/0x5910 mm/vmscan.c:1343 reclaim_folio_list+0x13c/0x5f0 mm/vmscan.c:2186 reclaim_pages+0x49e/0x5e0 mm/vmscan.c:2223 madvise_cold_or_pageout_pte_range+0x1ea5/0x2350 mm/madvise.c:558 walk_pmd_range mm/pagewalk.c:130 [inline] walk_pud_range mm/pagewalk.c:226 [inline] walk_p4d_range mm/pagewalk.c:264 [inline] walk_pgd_range+0xc3d/0x17e0 mm/pagewalk.c:305 __walk_page_range+0x15f/0x700 mm/pagewalk.c:412 walk_page_range_mm+0x58f/0x7c0 mm/pagewalk.c:505 madvise_pageout_page_range mm/madvise.c:617 [inline] madvise_pageout mm/madvise.c:644 [inline] madvise_vma_behavior mm/madvise.c:1266 [inline] madvise_walk_vmas mm/madvise.c:1502 [inline] do_madvise+0x393b/0x4d90 mm/madvise.c:1689 __do_sys_madvise mm/madvise.c:1705 [inline] __se_sys_madvise mm/madvise.c:1703 [inline] __x64_sys_madvise+0xa6/0xc0 mm/madvise.c:1703 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (ptlock_ptr(ptdesc)#2){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] __pte_offset_map_lock+0x1ba/0x300 mm/pgtable-generic.c:402 pte_offset_map_lock include/linux/mm.h:3131 [inline] filemap_map_pages+0x91e/0x1900 mm/filemap.c:3714 do_fault_around mm/memory.c:5350 [inline] do_read_fault mm/memory.c:5383 [inline] do_fault mm/memory.c:5526 [inline] do_pte_missing mm/memory.c:4047 [inline] handle_pte_fault mm/memory.c:5889 [inline] __handle_mm_fault+0x4ac5/0x70f0 mm/memory.c:6032 handle_mm_fault+0x3e2/0x8c0 mm/memory.c:6201 do_user_addr_fault arch/x86/mm/fault.c:1337 [inline] handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x459/0x8b0 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #0 (vm_lock){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3906 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 vma_start_read include/linux/mm.h:749 [inline] lock_vma_under_rcu+0x35f/0x9a0 mm/memory.c:6436 binder_alloc_free_page+0x150/0xd50 drivers/android/binder_alloc.c:1156 __list_lru_walk_one+0x170/0x470 mm/list_lru.c:300 list_lru_walk_one mm/list_lru.c:337 [inline] list_lru_walk_node+0xc4/0xa70 mm/list_lru.c:357 list_lru_walk include/linux/list_lru.h:282 [inline] binder_shrink_scan+0x138/0x260 drivers/android/binder_alloc.c:1226 do_shrink_slab+0x72d/0x1160 mm/shrinker.c:437 shrink_slab+0x1093/0x14d0 mm/shrinker.c:664 drop_slab_node mm/vmscan.c:421 [inline] drop_slab+0x142/0x280 mm/vmscan.c:439 drop_caches_sysctl_handler+0xbc/0x160 fs/drop_caches.c:68 proc_sys_call_handler+0x5ec/0x920 fs/proc/proc_sysctl.c:601 do_iter_readv_writev+0x71a/0x9d0 vfs_writev+0x38b/0xbc0 fs/read_write.c:1050 do_writev+0x1b6/0x360 fs/read_write.c:1096 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: vm_lock --> &cluster_info[i].lock --> &l->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&l->lock); lock(&cluster_info[i].lock); lock(&l->lock); rlock(vm_lock); *** DEADLOCK *** 4 locks held by syz.3.134/6548: #0: ffff888034245978 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x254/0x320 fs/file.c:1192 #1: ffff88805b7de420 (sb_writers#3){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3016 [inline] #1: ffff88805b7de420 (sb_writers#3){.+.+}-{0:0}, at: vfs_writev+0x2d6/0xbc0 fs/read_write.c:1048 #2: ffff88802ec1b430 (&l->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] #2: ffff88802ec1b430 (&l->lock){+.+.}-{3:3}, at: lock_list_lru_of_memcg+0x24c/0x4d0 mm/list_lru.c:77 #3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:3}, at: lock_vma_under_rcu+0x1dd/0x9a0 mm/memory.c:6431 stack backtrace: CPU: 1 UID: 0 PID: 6548 Comm: syz.3.134 Not tainted 6.13.0-rc6-next-20250107-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2076 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2208 check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3906 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 vma_start_read include/linux/mm.h:749 [inline] lock_vma_under_rcu+0x35f/0x9a0 mm/memory.c:6436 binder_alloc_free_page+0x150/0xd50 drivers/android/binder_alloc.c:1156 __list_lru_walk_one+0x170/0x470 mm/list_lru.c:300 list_lru_walk_one mm/list_lru.c:337 [inline] list_lru_walk_node+0xc4/0xa70 mm/list_lru.c:357 list_lru_walk include/linux/list_lru.h:282 [inline] binder_shrink_scan+0x138/0x260 drivers/android/binder_alloc.c:1226 do_shrink_slab+0x72d/0x1160 mm/shrinker.c:437 shrink_slab+0x1093/0x14d0 mm/shrinker.c:664 drop_slab_node mm/vmscan.c:421 [inline] drop_slab+0x142/0x280 mm/vmscan.c:439 drop_caches_sysctl_handler+0xbc/0x160 fs/drop_caches.c:68 proc_sys_call_handler+0x5ec/0x920 fs/proc/proc_sysctl.c:601 do_iter_readv_writev+0x71a/0x9d0 vfs_writev+0x38b/0xbc0 fs/read_write.c:1050 do_writev+0x1b6/0x360 fs/read_write.c:1096 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5c09f85d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5c0ad33038 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007f5c0a175fa0 RCX: 00007f5c09f85d29 RDX: 0000000000000001 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007f5c0a001b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f5c0a175fa0 R15: 00007ffe5ea96f58 syz.3.134 (6548): drop_caches: 2