====================================================== WARNING: possible circular locking dependency detected 6.13.0-rc6-next-20250107-syzkaller #0 Not tainted ------------------------------------------------------ syz.4.48/6104 is trying to acquire lock: ffff88807bf7f0c8 (vm_lock){++++}-{0:0}, at: binder_alloc_free_page+0x150/0xd50 drivers/android/binder_alloc.c:1156 but task is already holding lock: ffff88814d0daa30 (&l->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff88814d0daa30 (&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_add+0x59/0x270 mm/list_lru.c:163 list_lru_add_obj+0x17b/0x250 mm/list_lru.c:186 d_lru_add+0xdb/0x170 fs/dcache.c:452 retain_dentry fs/dcache.c:734 [inline] fast_dput+0x321/0x420 fs/dcache.c:821 dput+0xe8/0x2b0 fs/dcache.c:861 path_put fs/namei.c:625 [inline] put_link fs/namei.c:1093 [inline] walk_component+0x202/0x410 fs/namei.c:2117 link_path_walk+0x797/0xea0 fs/namei.c:2474 path_openat+0x266/0x3580 fs/namei.c:3983 do_filp_open+0x27f/0x4e0 fs/namei.c:4014 do_open_execat+0x165/0x4f0 fs/exec.c:895 open_exec+0x40/0x60 fs/exec.c:932 load_elf_binary+0x1957/0x2820 fs/binfmt_elf.c:899 search_binary_handler fs/exec.c:1775 [inline] exec_binprm fs/exec.c:1807 [inline] bprm_execve+0x979/0x1430 fs/exec.c:1859 kernel_execve+0x931/0xa50 fs/exec.c:2026 try_to_run_init_process init/main.c:1385 [inline] kernel_init+0xed/0x2b0 init/main.c:1513 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #2 (&dentry->d_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] __d_instantiate+0x19f/0x740 fs/dcache.c:1867 d_instantiate fs/dcache.c:1904 [inline] d_make_root+0x9f/0xe0 fs/dcache.c:1944 shmem_fill_super+0xc81/0x1110 mm/shmem.c:4997 vfs_get_super fs/super.c:1280 [inline] get_tree_nodev+0xb7/0x140 fs/super.c:1299 vfs_get_tree+0x90/0x2b0 fs/super.c:1814 fc_mount fs/namespace.c:1271 [inline] vfs_kern_mount+0xbc/0x160 fs/namespace.c:1301 kern_mount+0x43/0x90 fs/namespace.c:5744 shmem_init+0xf5/0x2a0 mm/shmem.c:5305 mnt_init+0x1a8/0x210 fs/namespace.c:5728 vfs_caches_init+0xf8/0x160 fs/dcache.c:3245 start_kernel+0x443/0x510 init/main.c:1082 x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:515 x86_64_start_kernel+0x9f/0xa0 arch/x86/kernel/head64.c:496 common_startup_64+0x13e/0x147 -> #1 (&sb->s_type->i_lock_key){+.+.}-{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] inode_add_bytes+0x37/0x150 fs/stat.c:915 __dquot_alloc_space+0x2d0/0x10c0 fs/quota/dquot.c:1695 dquot_alloc_space_nodirty include/linux/quotaops.h:299 [inline] dquot_alloc_block_nodirty include/linux/quotaops.h:326 [inline] shmem_inode_acct_blocks+0x2b4/0x460 mm/shmem.c:244 shmem_alloc_and_add_folio+0x9e2/0x1090 mm/shmem.c:1932 shmem_get_folio_gfp+0x621/0x1840 mm/shmem.c:2422 shmem_fault+0x220/0x5b0 mm/shmem.c:2623 __do_fault+0x135/0x390 mm/memory.c:4977 do_shared_fault mm/memory.c:5456 [inline] do_fault mm/memory.c:5530 [inline] do_pte_missing mm/memory.c:4047 [inline] handle_pte_fault mm/memory.c:5889 [inline] __handle_mm_fault+0x2204/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 --> &dentry->d_lock --> &l->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&l->lock); lock(&dentry->d_lock); lock(&l->lock); rlock(vm_lock); *** DEADLOCK *** 4 locks held by syz.4.48/6104: #0: ffff8880276aa0f8 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x254/0x320 fs/file.c:1192 #1: ffff88802a9ce420 (sb_writers#3){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3016 [inline] #1: ffff88802a9ce420 (sb_writers#3){.+.+}-{0:0}, at: vfs_writev+0x2d6/0xbc0 fs/read_write.c:1048 #2: ffff88814d0daa30 (&l->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] #2: ffff88814d0daa30 (&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: 6104 Comm: syz.4.48 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:0x7fc760385d29 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:00007fc7610fe038 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007fc760575fa0 RCX: 00007fc760385d29 RDX: 0000000000000001 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007fc760401b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fc760575fa0 R15: 00007ffc3e8ce458 syz.4.48 (6104): drop_caches: 2