====================================================== WARNING: possible circular locking dependency detected 6.13.0-rc6-syzkaller #0 Not tainted ------------------------------------------------------ syz.3.720/6427 is trying to acquire lock: ffff888104ad94c8 (vm_lock){++++}-{0:0}, at: binder_alloc_free_page+0x63/0x410 drivers/android/binder_alloc.c:1156 but task is already holding lock: ffff8881027020b0 (&l->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff8881027020b0 (&l->lock){+.+.}-{3:3}, at: lock_list_lru_of_memcg+0x120/0x1e0 mm/list_lru.c:77 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&l->lock){+.+.}-{3:3}: __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+0x120/0x1e0 mm/list_lru.c:77 list_lru_add+0x33/0xe0 mm/list_lru.c:163 list_lru_add_obj+0xd0/0x170 mm/list_lru.c:186 __inode_add_lru fs/inode.c:534 [inline] iput_final fs/inode.c:1923 [inline] iput+0x225/0x250 fs/inode.c:1972 __dentry_kill+0xa2/0x1d0 fs/dcache.c:625 shrink_kill+0x6c/0x1b0 fs/dcache.c:1070 shrink_dentry_list+0x40/0x210 fs/dcache.c:1097 shrink_dcache_sb+0xbe/0x150 fs/dcache.c:1217 reconfigure_super+0xc7/0x220 fs/super.c:1061 do_remount fs/namespace.c:3100 [inline] path_mount+0x40a/0x570 fs/namespace.c:3879 do_mount fs/namespace.c:3900 [inline] __do_sys_mount fs/namespace.c:4111 [inline] __se_sys_mount+0x174/0x1e0 fs/namespace.c:4088 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xa0/0x1b0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #3 (&sb->s_type->i_lock_key#22){+.+.}-{3:3}: __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] __dquot_alloc_space+0x196/0x600 fs/quota/dquot.c:1691 dquot_reserve_block include/linux/quotaops.h:356 [inline] ext4_da_reserve_space+0x36/0x110 fs/ext4/inode.c:1484 ext4_insert_delayed_blocks fs/ext4/inode.c:1704 [inline] ext4_da_map_blocks fs/ext4/inode.c:1834 [inline] ext4_da_get_block_prep+0x293/0x570 fs/ext4/inode.c:1873 ext4_block_write_begin+0x184/0x500 fs/ext4/inode.c:1063 ext4_da_write_begin+0x1a4/0x2f0 fs/ext4/inode.c:2946 generic_perform_write+0xee/0x280 mm/filemap.c:4113 ext4_buffered_write_iter+0xbf/0x140 fs/ext4/file.c:299 ext4_file_write_iter+0x37b/0x760 new_sync_write fs/read_write.c:586 [inline] vfs_write+0x2a5/0x3a0 fs/read_write.c:679 ksys_write+0x73/0xe0 fs/read_write.c:731 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xa0/0x1b0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&ei->i_data_sem){++++}-{4:4}: down_read+0x4a/0x440 kernel/locking/rwsem.c:1524 ext4_map_blocks+0x121/0x570 fs/ext4/inode.c:665 ext4_mpage_readpages+0x390/0x840 fs/ext4/readpage.c:289 read_pages+0x8b/0x160 mm/readahead.c:161 page_cache_ra_unbounded+0x1d8/0x240 mm/readahead.c:286 page_cache_sync_readahead include/linux/pagemap.h:1413 [inline] filemap_get_pages+0x167/0x850 mm/filemap.c:2519 filemap_read+0xfa/0x390 mm/filemap.c:2619 __kernel_read+0x190/0x280 fs/read_write.c:523 prepare_binprm fs/exec.c:1675 [inline] search_binary_handler fs/exec.c:1724 [inline] exec_binprm fs/exec.c:1782 [inline] bprm_execve+0x38d/0x740 fs/exec.c:1834 kernel_execve+0x1fa/0x230 fs/exec.c:2001 try_to_run_init_process init/main.c:1384 [inline] kernel_init+0xd0/0x190 init/main.c:1512 ret_from_fork+0x32/0x40 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #1 (mapping.invalidate_lock){++++}-{4:4}: down_read+0x4a/0x440 kernel/locking/rwsem.c:1524 filemap_invalidate_lock_shared include/linux/fs.h:920 [inline] filemap_fault+0x158/0x670 mm/filemap.c:3359 __do_fault+0x3c/0xd0 mm/memory.c:4977 do_read_fault mm/memory.c:5392 [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 mm/memory.c:6032 [inline] handle_mm_fault+0xa81/0x1da0 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+0x3cf/0x6a0 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 kernel/locking/lockdep.c:3906 [inline] __lock_acquire+0x1236/0x2570 kernel/locking/lockdep.c:5228 lock_acquire+0xeb/0x270 kernel/locking/lockdep.c:5851 vma_start_read include/linux/mm.h:749 [inline] lock_vma_under_rcu+0x187/0x2c0 mm/memory.c:6436 binder_alloc_free_page+0x63/0x410 drivers/android/binder_alloc.c:1156 __list_lru_walk_one+0xb4/0x1a0 mm/list_lru.c:300 list_lru_walk_one mm/list_lru.c:337 [inline] list_lru_walk_node+0x46/0x4b0 mm/list_lru.c:357 list_lru_walk include/linux/list_lru.h:282 [inline] binder_shrink_scan+0x62/0xc0 drivers/android/binder_alloc.c:1226 do_shrink_slab+0x24f/0x5a0 mm/shrinker.c:437 shrink_slab+0x1d3/0x7e0 mm/shrinker.c:664 drop_slab_node mm/vmscan.c:421 [inline] drop_slab+0x89/0x100 mm/vmscan.c:439 drop_caches_sysctl_handler+0x4b/0xb0 fs/drop_caches.c:68 proc_sys_call_handler+0x1ac/0x310 fs/proc/proc_sysctl.c:601 do_iter_readv_writev+0x18d/0x1e0 vfs_writev+0x1e0/0x3e0 fs/read_write.c:1050 do_writev+0x71/0x110 fs/read_write.c:1096 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xa0/0x1b0 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 --> &sb->s_type->i_lock_key#22 --> &l->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&l->lock); lock(&sb->s_type->i_lock_key#22); lock(&l->lock); rlock(vm_lock); *** DEADLOCK *** 4 locks held by syz.3.720/6427: #0: ffff8881027f9178 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x7c/0xb0 fs/file.c:1192 #1: ffff8881027a03f8 (sb_writers#3){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3016 [inline] #1: ffff8881027a03f8 (sb_writers#3){.+.+}-{0:0}, at: vfs_writev+0x1ba/0x3e0 fs/read_write.c:1048 #2: ffff8881027020b0 (&l->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] #2: ffff8881027020b0 (&l->lock){+.+.}-{3:3}, at: lock_list_lru_of_memcg+0x120/0x1e0 mm/list_lru.c:77 #3: ffffffff83f81d58 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #3: ffffffff83f81d58 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #3: ffffffff83f81d58 (rcu_read_lock){....}-{1:3}, at: lock_vma_under_rcu+0x83/0x2c0 mm/memory.c:6431 stack backtrace: CPU: 0 UID: 0 PID: 6427 Comm: syz.3.720 Not tainted 6.13.0-rc6-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+0xa3/0x100 lib/dump_stack.c:120 print_circular_bug+0x28d/0x2a0 kernel/locking/lockdep.c:2076 check_noncircular+0x119/0x140 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 kernel/locking/lockdep.c:3906 [inline] __lock_acquire+0x1236/0x2570 kernel/locking/lockdep.c:5228 lock_acquire+0xeb/0x270 kernel/locking/lockdep.c:5851 vma_start_read include/linux/mm.h:749 [inline] lock_vma_under_rcu+0x187/0x2c0 mm/memory.c:6436 binder_alloc_free_page+0x63/0x410 drivers/android/binder_alloc.c:1156 __list_lru_walk_one+0xb4/0x1a0 mm/list_lru.c:300 list_lru_walk_one mm/list_lru.c:337 [inline] list_lru_walk_node+0x46/0x4b0 mm/list_lru.c:357 list_lru_walk include/linux/list_lru.h:282 [inline] binder_shrink_scan+0x62/0xc0 drivers/android/binder_alloc.c:1226 do_shrink_slab+0x24f/0x5a0 mm/shrinker.c:437 shrink_slab+0x1d3/0x7e0 mm/shrinker.c:664 drop_slab_node mm/vmscan.c:421 [inline] drop_slab+0x89/0x100 mm/vmscan.c:439 drop_caches_sysctl_handler+0x4b/0xb0 fs/drop_caches.c:68 proc_sys_call_handler+0x1ac/0x310 fs/proc/proc_sysctl.c:601 do_iter_readv_writev+0x18d/0x1e0 vfs_writev+0x1e0/0x3e0 fs/read_write.c:1050 do_writev+0x71/0x110 fs/read_write.c:1096 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xa0/0x1b0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7eff45385d29 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:00007eff460cf038 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007eff45575fa0 RCX: 00007eff45385d29 RDX: 0000000000000001 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007eff45401b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007eff45575fa0 R15: 00007fffac1f23b8 syz.3.720 (6427): drop_caches: 2