====================================================== WARNING: possible circular locking dependency detected 6.8.0-rc7-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/24461 is trying to acquire lock: ffffffff8d91e080 (fs_reclaim ){+.+.}-{0:0}, at: might_alloc include/linux/sched/mm.h:303 [inline] ){+.+.}-{0:0}, at: slab_pre_alloc_hook mm/slub.c:3761 [inline] ){+.+.}-{0:0}, at: slab_alloc_node mm/slub.c:3842 [inline] ){+.+.}-{0:0}, at: kmem_cache_alloc+0x4f/0x320 mm/slub.c:3867 but task is already holding lock: ffff888021464888 (&ei->i_data_sem){++++}-{3:3} , at: ext4_da_map_blocks fs/ext4/inode.c:1776 [inline] , at: ext4_da_get_block_prep+0x770/0x1320 fs/ext4/inode.c:1817 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 ( &ei->i_data_sem){++++}-{3:3} : down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 ext4_truncate+0xd21/0x1310 fs/ext4/inode.c:4141 ext4_evict_inode+0x7a7/0x1a40 fs/ext4/inode.c:258 evict+0x2ed/0x6c0 fs/inode.c:665 iput_final fs/inode.c:1739 [inline] iput.part.0+0x563/0x7b0 fs/inode.c:1765 iput+0x5c/0x80 fs/inode.c:1755 ext4_orphan_cleanup+0x713/0x11d0 fs/ext4/orphan.c:474 __ext4_fill_super fs/ext4/super.c:5582 [inline] ext4_fill_super+0x80f1/0xaf00 fs/ext4/super.c:5703 get_tree_bdev+0x36f/0x610 fs/super.c:1614 vfs_get_tree+0x8f/0x380 fs/super.c:1779 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14ea/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd5/0x270 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6f/0x77 -> #1 ( sb_internal){.+.+}-{0:0} : percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1641 [inline] sb_start_intwrite include/linux/fs.h:1824 [inline] ext4_evict_inode+0xe5f/0x1a40 fs/ext4/inode.c:212 evict+0x2ed/0x6c0 fs/inode.c:665 iput_final fs/inode.c:1739 [inline] iput.part.0+0x563/0x7b0 fs/inode.c:1765 iput+0x5c/0x80 fs/inode.c:1755 dentry_unlink_inode+0x295/0x440 fs/dcache.c:400 __dentry_kill+0x1d0/0x600 fs/dcache.c:603 shrink_kill fs/dcache.c:1048 [inline] shrink_dentry_list+0x140/0x5d0 fs/dcache.c:1075 prune_dcache_sb+0xeb/0x150 fs/dcache.c:1156 super_cache_scan+0x32a/0x550 fs/super.c:221 do_shrink_slab+0x426/0x1120 mm/shrinker.c:435 shrink_slab_memcg mm/shrinker.c:548 [inline] shrink_slab+0xa87/0x1310 mm/shrinker.c:626 shrink_one+0x493/0x7b0 mm/vmscan.c:4767 shrink_many mm/vmscan.c:4828 [inline] lru_gen_shrink_node mm/vmscan.c:4929 [inline] shrink_node+0x214d/0x3750 mm/vmscan.c:5888 kswapd_shrink_node mm/vmscan.c:6693 [inline] balance_pgdat+0x9d2/0x1a90 mm/vmscan.c:6883 kswapd+0x5be/0xc00 mm/vmscan.c:7143 kthread+0x2c6/0x3b0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243 -> #0 (fs_reclaim){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x244f/0x3b40 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 __fs_reclaim_acquire mm/page_alloc.c:3692 [inline] fs_reclaim_acquire+0x104/0x150 mm/page_alloc.c:3706 might_alloc include/linux/sched/mm.h:303 [inline] slab_pre_alloc_hook mm/slub.c:3761 [inline] slab_alloc_node mm/slub.c:3842 [inline] kmem_cache_alloc+0x4f/0x320 mm/slub.c:3867 kmem_cache_zalloc include/linux/slab.h:701 [inline] __es_alloc_extent fs/ext4/extents_status.c:483 [inline] ext4_es_insert_delayed_block+0x546/0x760 fs/ext4/extents_status.c:2090 ext4_insert_delayed_block fs/ext4/inode.c:1676 [inline] ext4_da_map_blocks fs/ext4/inode.c:1777 [inline] ext4_da_get_block_prep+0x850/0x1320 fs/ext4/inode.c:1817 ext4_block_write_begin+0x3da/0xef0 fs/ext4/inode.c:1055 ext4_da_write_begin+0x40e/0x8c0 fs/ext4/inode.c:2894 generic_perform_write+0x273/0x620 mm/filemap.c:3930 ext4_buffered_write_iter+0x11f/0x3d0 fs/ext4/file.c:299 ext4_file_write_iter+0x819/0x1960 fs/ext4/file.c:698 call_write_iter include/linux/fs.h:2087 [inline] new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6de/0x1110 fs/read_write.c:590 ksys_write+0x12f/0x260 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd5/0x270 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6f/0x77 other info that might help us debug this: Chain exists of: fs_reclaim --> sb_internal --> &ei->i_data_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->i_data_sem ); lock( sb_internal ); lock( &ei->i_data_sem); lock(fs_reclaim ); *** DEADLOCK *** 4 locks held by syz-executor.0/24461: #0: ffff88801a33cac8 (&f->f_pos_lock ){+.+.}-{3:3} , at: __fdget_pos+0xeb/0x180 fs/file.c:1191 #1: ffff8880296b0420 ( sb_writers#5){.+.+}-{0:0}, at: ksys_write+0x12f/0x260 fs/read_write.c:643 #2: ffff888021464a00 (&sb->s_type->i_mutex_key#7){++++}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline] #2: ffff888021464a00 (&sb->s_type->i_mutex_key#7){++++}-{3:3}, at: ext4_buffered_write_iter+0xb0/0x3d0 fs/ext4/file.c:294 #3: ffff888021464888 (&ei->i_data_sem ){++++}-{3:3} , at: ext4_da_map_blocks fs/ext4/inode.c:1776 [inline] , at: ext4_da_get_block_prep+0x770/0x1320 fs/ext4/inode.c:1817 stack backtrace: CPU: 3 PID: 24461 Comm: syz-executor.0 Not tainted 6.8.0-rc7-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x31b/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x244f/0x3b40 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 __fs_reclaim_acquire mm/page_alloc.c:3692 [inline] fs_reclaim_acquire+0x104/0x150 mm/page_alloc.c:3706 might_alloc include/linux/sched/mm.h:303 [inline] slab_pre_alloc_hook mm/slub.c:3761 [inline] slab_alloc_node mm/slub.c:3842 [inline] kmem_cache_alloc+0x4f/0x320 mm/slub.c:3867 kmem_cache_zalloc include/linux/slab.h:701 [inline] __es_alloc_extent fs/ext4/extents_status.c:483 [inline] ext4_es_insert_delayed_block+0x546/0x760 fs/ext4/extents_status.c:2090 ext4_insert_delayed_block fs/ext4/inode.c:1676 [inline] ext4_da_map_blocks fs/ext4/inode.c:1777 [inline] ext4_da_get_block_prep+0x850/0x1320 fs/ext4/inode.c:1817 ext4_block_write_begin+0x3da/0xef0 fs/ext4/inode.c:1055 ext4_da_write_begin+0x40e/0x8c0 fs/ext4/inode.c:2894 generic_perform_write+0x273/0x620 mm/filemap.c:3930 ext4_buffered_write_iter+0x11f/0x3d0 fs/ext4/file.c:299 ext4_file_write_iter+0x819/0x1960 fs/ext4/file.c:698 call_write_iter include/linux/fs.h:2087 [inline] new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6de/0x1110 fs/read_write.c:590 ksys_write+0x12f/0x260 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd5/0x270 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6f/0x77 RIP: 0033:0x7f0de227dda9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0de30400c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f0de23abf80 RCX: 00007f0de227dda9 RDX: 00000000000101bf RSI: 0000000020000380 RDI: 0000000000000003 RBP: 00007f0de3040120 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 000000000000000b R14: 00007f0de23abf80 R15: 00007ffcc40d2388