====================================================== WARNING: possible circular locking dependency detected 6.3.0-rc3-syzkaller-00317-g65aca32efdcb #0 Not tainted ------------------------------------------------------ syz-executor.1/1214 is trying to acquire lock: ffffffff8c9707a8 (fscrypt_init_mutex){+.+.}-{3:3}, at: fscrypt_initialize+0x40/0xa0 fs/crypto/crypto.c:326 but task is already holding lock: ffff88801a9dc990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0xfb4/0x14e0 fs/jbd2/transaction.c:461 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (jbd2_handle){++++}-{0:0}: start_this_handle+0xfe7/0x14e0 fs/jbd2/transaction.c:463 jbd2__journal_start+0x390/0x850 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x411/0x5d0 fs/ext4/ext4_jbd2.c:111 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_dirty_inode+0xa5/0x130 fs/ext4/inode.c:6110 __mark_inode_dirty+0x1e0/0xd60 fs/fs-writeback.c:2421 mark_inode_dirty_sync include/linux/fs.h:2132 [inline] iput.part.0+0x57/0x740 fs/inode.c:1771 iput+0x5c/0x80 fs/inode.c:1764 dentry_unlink_inode+0x2b1/0x460 fs/dcache.c:401 __dentry_kill+0x3c0/0x640 fs/dcache.c:607 shrink_dentry_list+0x12c/0x4f0 fs/dcache.c:1201 prune_dcache_sb+0xeb/0x150 fs/dcache.c:1282 super_cache_scan+0x33a/0x590 fs/super.c:104 do_shrink_slab+0x428/0xaa0 mm/vmscan.c:853 shrink_slab_memcg mm/vmscan.c:922 [inline] shrink_slab+0x388/0x660 mm/vmscan.c:1001 shrink_one+0x502/0x810 mm/vmscan.c:5343 shrink_many mm/vmscan.c:5394 [inline] lru_gen_shrink_node mm/vmscan.c:5511 [inline] shrink_node+0x2064/0x35f0 mm/vmscan.c:6459 kswapd_shrink_node mm/vmscan.c:7262 [inline] balance_pgdat+0xa02/0x1ac0 mm/vmscan.c:7452 kswapd+0x677/0xd60 mm/vmscan.c:7712 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 -> #1 (fs_reclaim){+.+.}-{0:0}: __fs_reclaim_acquire mm/page_alloc.c:4717 [inline] fs_reclaim_acquire+0x11d/0x160 mm/page_alloc.c:4731 might_alloc include/linux/sched/mm.h:271 [inline] slab_pre_alloc_hook mm/slab.h:728 [inline] slab_alloc_node mm/slub.c:3434 [inline] __kmem_cache_alloc_node+0x41/0x320 mm/slub.c:3491 kmalloc_node_trace+0x21/0xd0 mm/slab_common.c:1074 kmalloc_node include/linux/slab.h:606 [inline] kzalloc_node include/linux/slab.h:731 [inline] mempool_create_node mm/mempool.c:272 [inline] mempool_create+0x52/0xc0 mm/mempool.c:261 mempool_create_page_pool include/linux/mempool.h:112 [inline] fscrypt_initialize+0x8a/0xa0 fs/crypto/crypto.c:332 fscrypt_setup_encryption_info+0xef/0xeb0 fs/crypto/keysetup.c:563 fscrypt_get_encryption_info+0x375/0x450 fs/crypto/keysetup.c:668 fscrypt_setup_filename+0x23c/0xec0 fs/crypto/fname.c:458 __fscrypt_prepare_lookup+0x2c/0xf0 fs/crypto/hooks.c:100 fscrypt_prepare_lookup include/linux/fscrypt.h:935 [inline] ext4_fname_prepare_lookup+0x1be/0x200 fs/ext4/crypto.c:46 ext4_lookup_entry fs/ext4/namei.c:1744 [inline] ext4_lookup fs/ext4/namei.c:1819 [inline] ext4_lookup+0x131/0x700 fs/ext4/namei.c:1810 __lookup_slow+0x24c/0x460 fs/namei.c:1686 lookup_slow fs/namei.c:1703 [inline] lookup_one_unlocked+0x12a/0x150 fs/namei.c:2773 ovl_lookup_positive_unlocked fs/overlayfs/namei.c:207 [inline] ovl_lookup_single+0x115/0xcf0 fs/overlayfs/namei.c:233 ovl_lookup_layer+0x3d3/0x480 fs/overlayfs/namei.c:320 ovl_lookup+0x49d/0x1db0 fs/overlayfs/namei.c:868 __lookup_hash+0x117/0x180 fs/namei.c:1602 do_unlinkat+0x294/0x670 fs/namei.c:4302 __do_sys_unlink fs/namei.c:4364 [inline] __se_sys_unlink fs/namei.c:4362 [inline] __ia32_sys_unlink+0xca/0x110 fs/namei.c:4362 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 -> #0 (fscrypt_init_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1af/0x520 kernel/locking/lockdep.c:5634 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 fscrypt_initialize+0x40/0xa0 fs/crypto/crypto.c:326 fscrypt_setup_encryption_info+0xef/0xeb0 fs/crypto/keysetup.c:563 fscrypt_get_encryption_info+0x375/0x450 fs/crypto/keysetup.c:668 fscrypt_setup_filename+0x23c/0xec0 fs/crypto/fname.c:458 ext4_fname_setup_filename+0x8c/0x110 fs/ext4/crypto.c:28 ext4_add_entry+0x3aa/0xe30 fs/ext4/namei.c:2379 ext4_rename+0x1a6a/0x2790 fs/ext4/namei.c:3915 ext4_rename2+0x1c7/0x270 fs/ext4/namei.c:4200 vfs_rename+0xef6/0x17a0 fs/namei.c:4772 do_renameat2+0xb62/0xc90 fs/namei.c:4923 __do_sys_renameat2 fs/namei.c:4956 [inline] __se_sys_renameat2 fs/namei.c:4953 [inline] __ia32_sys_renameat2+0xe8/0x120 fs/namei.c:4953 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 other info that might help us debug this: Chain exists of: fscrypt_init_mutex --> fs_reclaim --> jbd2_handle Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(jbd2_handle); lock(fs_reclaim); lock(jbd2_handle); lock(fscrypt_init_mutex); *** DEADLOCK *** 6 locks held by syz-executor.1/1214: #0: ffff88801a6ba460 (sb_writers#4){.+.+}-{0:0}, at: do_renameat2+0x37f/0xc90 fs/namei.c:4859 #1: ffff88801a6ba748 (&type->s_vfs_rename_key){+.+.}-{3:3}, at: lock_rename+0x58/0x280 fs/namei.c:2995 #2: ffff88801c6e8e08 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #2: ffff88801c6e8e08 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: lock_rename+0xa4/0x280 fs/namei.c:2999 #3: ffff888012264a38 (&type->i_mutex_dir_key#3/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #3: ffff888012264a38 (&type->i_mutex_dir_key#3/2){+.+.}-{3:3}, at: lock_rename+0xd8/0x280 fs/namei.c:3000 #4: ffff888012265440 (&sb->s_type->i_mutex_key#8/4){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #4: ffff888012265440 (&sb->s_type->i_mutex_key#8/4){+.+.}-{3:3}, at: lock_two_nondirectories+0xd5/0x110 fs/inode.c:1124 #5: ffff88801a9dc990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0xfb4/0x14e0 fs/jbd2/transaction.c:461 stack backtrace: CPU: 1 PID: 1214 Comm: syz-executor.1 Not tainted 6.3.0-rc3-syzkaller-00317-g65aca32efdcb #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1af/0x520 kernel/locking/lockdep.c:5634 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 fscrypt_initialize+0x40/0xa0 fs/crypto/crypto.c:326 fscrypt_setup_encryption_info+0xef/0xeb0 fs/crypto/keysetup.c:563 fscrypt_get_encryption_info+0x375/0x450 fs/crypto/keysetup.c:668 fscrypt_setup_filename+0x23c/0xec0 fs/crypto/fname.c:458 ext4_fname_setup_filename+0x8c/0x110 fs/ext4/crypto.c:28 ext4_add_entry+0x3aa/0xe30 fs/ext4/namei.c:2379 ext4_rename+0x1a6a/0x2790 fs/ext4/namei.c:3915 ext4_rename2+0x1c7/0x270 fs/ext4/namei.c:4200 vfs_rename+0xef6/0x17a0 fs/namei.c:4772 do_renameat2+0xb62/0xc90 fs/namei.c:4923 __do_sys_renameat2 fs/namei.c:4956 [inline] __se_sys_renameat2 fs/namei.c:4953 [inline] __ia32_sys_renameat2+0xe8/0x120 fs/namei.c:4953 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7f2c579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f7f275cc EFLAGS: 00000296 ORIG_RAX: 0000000000000161 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00000000200001c0 RDX: 0000000000000004 RSI: 0000000020000200 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 retq 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi