====================================================== WARNING: possible circular locking dependency detected 6.0.0-rc3-syzkaller-00299-gd895ec7938c4 #0 Not tainted ------------------------------------------------------ syz-executor.2/13474 is trying to acquire lock: ffffffff8c147ee8 (fscrypt_init_mutex){+.+.}-{3:3}, at: fscrypt_initialize+0x3c/0xa0 fs/crypto/crypto.c:324 but task is already holding lock: ffff88801b3bc990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0xfb4/0x14a0 fs/jbd2/transaction.c:461 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (jbd2_handle){++++}-{0:0}: start_this_handle+0xfe7/0x14a0 fs/jbd2/transaction.c:463 jbd2__journal_start+0x38c/0x910 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x3a3/0x490 fs/ext4/ext4_jbd2.c:105 ext4_sample_last_mounted fs/ext4/file.c:820 [inline] ext4_file_open+0x5e5/0xb50 fs/ext4/file.c:849 do_dentry_open+0x4a4/0x13a0 fs/open.c:878 do_open fs/namei.c:3557 [inline] path_openat+0x1c92/0x28f0 fs/namei.c:3691 do_filp_open+0x1b6/0x400 fs/namei.c:3718 do_sys_openat2+0x16d/0x4c0 fs/open.c:1311 do_sys_open fs/open.c:1327 [inline] __do_sys_openat fs/open.c:1343 [inline] __se_sys_openat fs/open.c:1338 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1338 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #2 (sb_internal){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1826 [inline] sb_start_intwrite include/linux/fs.h:1948 [inline] ext4_evict_inode+0x11de/0x1d40 fs/ext4/inode.c:240 evict+0x2ed/0x6b0 fs/inode.c:665 iput_final fs/inode.c:1748 [inline] iput.part.0+0x55d/0x810 fs/inode.c:1774 iput+0x58/0x70 fs/inode.c:1764 dentry_unlink_inode+0x2b1/0x460 fs/dcache.c:401 __dentry_kill+0x3c0/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:745 [inline] dput+0x64d/0xdb0 fs/dcache.c:913 ovl_entry_stack_free fs/overlayfs/super.c:61 [inline] ovl_dentry_release+0xca/0x130 fs/overlayfs/super.c:74 __dentry_kill+0x42b/0x640 fs/dcache.c:612 shrink_dentry_list+0x23c/0x800 fs/dcache.c:1201 prune_dcache_sb+0xe7/0x140 fs/dcache.c:1282 super_cache_scan+0x336/0x590 fs/super.c:104 do_shrink_slab+0x428/0xbd0 mm/vmscan.c:831 shrink_slab_memcg mm/vmscan.c:900 [inline] shrink_slab+0x3e9/0x6f0 mm/vmscan.c:979 shrink_node_memcgs mm/vmscan.c:3182 [inline] shrink_node+0x8c9/0x1e80 mm/vmscan.c:3304 shrink_zones mm/vmscan.c:3542 [inline] do_try_to_free_pages+0x3b4/0x17a0 mm/vmscan.c:3601 try_to_free_pages+0x2a7/0x840 mm/vmscan.c:3836 __perform_reclaim mm/page_alloc.c:4726 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:4748 [inline] __alloc_pages_slowpath.constprop.0+0x8f8/0x2240 mm/page_alloc.c:5151 __alloc_pages+0x43d/0x510 mm/page_alloc.c:5528 alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2103 alloc_pages+0x22f/0x270 mm/mempolicy.c:2265 __get_free_pages+0x8/0x40 mm/page_alloc.c:5564 kasan_populate_vmalloc_pte mm/kasan/shadow.c:271 [inline] kasan_populate_vmalloc_pte+0x23/0x150 mm/kasan/shadow.c:262 apply_to_pte_range mm/memory.c:2633 [inline] apply_to_pmd_range mm/memory.c:2677 [inline] apply_to_pud_range mm/memory.c:2713 [inline] apply_to_p4d_range mm/memory.c:2749 [inline] __apply_to_page_range+0x686/0x1030 mm/memory.c:2783 alloc_vmap_area+0xacf/0x1d50 mm/vmalloc.c:1625 __get_vm_area_node+0x142/0x3f0 mm/vmalloc.c:2484 __vmalloc_node_range+0x250/0x13a0 mm/vmalloc.c:3156 __vmalloc_node mm/vmalloc.c:3261 [inline] vzalloc+0x67/0x80 mm/vmalloc.c:3334 alloc_one_pg_vec_page net/packet/af_packet.c:4323 [inline] alloc_pg_vec net/packet/af_packet.c:4348 [inline] packet_set_ring+0xb08/0x1980 net/packet/af_packet.c:4433 packet_setsockopt+0x1bda/0x3c80 net/packet/af_packet.c:3809 __sys_setsockopt+0x2d6/0x690 net/socket.c:2252 __do_sys_setsockopt net/socket.c:2263 [inline] __se_sys_setsockopt net/socket.c:2260 [inline] __ia32_sys_setsockopt+0xb9/0x150 net/socket.c:2260 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+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 -> #1 (fs_reclaim){+.+.}-{0:0}: __fs_reclaim_acquire mm/page_alloc.c:4674 [inline] fs_reclaim_acquire+0x115/0x160 mm/page_alloc.c:4688 might_alloc include/linux/sched/mm.h:271 [inline] slab_pre_alloc_hook mm/slab.h:700 [inline] slab_alloc_node mm/slub.c:3157 [inline] kmem_cache_alloc_node_trace+0x3f/0x410 mm/slub.c:3307 kmalloc_node include/linux/slab.h:618 [inline] kzalloc_node include/linux/slab.h:744 [inline] mempool_create_node mm/mempool.c:266 [inline] mempool_create+0x4e/0xc0 mm/mempool.c:255 mempool_create_page_pool include/linux/mempool.h:107 [inline] fscrypt_initialize+0x86/0xa0 fs/crypto/crypto.c:330 fscrypt_setup_encryption_info+0xef/0xe90 fs/crypto/keysetup.c:538 fscrypt_get_encryption_info+0x34a/0x3f0 fs/crypto/keysetup.c:647 fscrypt_setup_filename+0x238/0xec0 fs/crypto/fname.c:458 __fscrypt_prepare_lookup+0x28/0xf0 fs/crypto/hooks.c:102 fscrypt_prepare_lookup include/linux/fscrypt.h:952 [inline] ext4_fname_prepare_lookup+0x1ba/0x200 fs/ext4/crypto.c:46 ext4_lookup_entry fs/ext4/namei.c:1740 [inline] ext4_lookup fs/ext4/namei.c:1815 [inline] ext4_lookup+0x12d/0x700 fs/ext4/namei.c:1806 lookup_open.isra.0+0x76a/0x12a0 fs/namei.c:3391 open_last_lookups fs/namei.c:3481 [inline] path_openat+0x996/0x28f0 fs/namei.c:3688 do_filp_open+0x1b6/0x400 fs/namei.c:3718 do_sys_openat2+0x16d/0x4c0 fs/open.c:1311 do_sys_open fs/open.c:1327 [inline] __do_compat_sys_openat fs/open.c:1387 [inline] __se_compat_sys_openat fs/open.c:1385 [inline] __ia32_compat_sys_openat+0x13f/0x1f0 fs/open.c:1385 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+0x2f/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:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 fscrypt_initialize+0x3c/0xa0 fs/crypto/crypto.c:324 fscrypt_setup_encryption_info+0xef/0xe90 fs/crypto/keysetup.c:538 fscrypt_get_encryption_info+0x34a/0x3f0 fs/crypto/keysetup.c:647 fscrypt_setup_filename+0x238/0xec0 fs/crypto/fname.c:458 ext4_fname_setup_filename+0x88/0x110 fs/ext4/crypto.c:28 ext4_add_entry+0x3aa/0xef0 fs/ext4/namei.c:2367 ext4_rename+0x190a/0x2650 fs/ext4/namei.c:3884 ext4_rename2+0x1c3/0x270 fs/ext4/namei.c:4164 vfs_rename+0x115e/0x1a90 fs/namei.c:4756 do_renameat2+0xb5e/0xc80 fs/namei.c:4907 __do_sys_renameat2 fs/namei.c:4940 [inline] __se_sys_renameat2 fs/namei.c:4937 [inline] __ia32_sys_renameat2+0xe4/0x120 fs/namei.c:4937 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+0x2f/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 --> sb_internal --> jbd2_handle Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(jbd2_handle); lock(sb_internal); lock(jbd2_handle); lock(fscrypt_init_mutex); *** DEADLOCK *** 6 locks held by syz-executor.2/13474: #0: ffff88801a4f6460 (sb_writers#4){.+.+}-{0:0}, at: do_renameat2+0x37b/0xc80 fs/namei.c:4843 #1: ffff88801a4f6748 (&type->s_vfs_rename_key){+.+.}-{3:3}, at: lock_rename+0x54/0x280 fs/namei.c:2994 #2: ffff88801d1e6850 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #2: ffff88801d1e6850 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: lock_rename+0xa0/0x280 fs/namei.c:2998 #3: ffff88801d1e2c20 (&type->i_mutex_dir_key#3/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #3: ffff88801d1e2c20 (&type->i_mutex_dir_key#3/2){+.+.}-{3:3}, at: lock_rename+0xd4/0x280 fs/namei.c:2999 #4: ffff88802728e850 (&sb->s_type->i_mutex_key#8/4){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #4: ffff88802728e850 (&sb->s_type->i_mutex_key#8/4){+.+.}-{3:3}, at: lock_two_nondirectories+0xd1/0x110 fs/inode.c:1124 #5: ffff88801b3bc990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0xfb4/0x14a0 fs/jbd2/transaction.c:461 stack backtrace: CPU: 0 PID: 13474 Comm: syz-executor.2 Not tainted 6.0.0-rc3-syzkaller-00299-gd895ec7938c4 #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+0xcd/0x134 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 fscrypt_initialize+0x3c/0xa0 fs/crypto/crypto.c:324 fscrypt_setup_encryption_info+0xef/0xe90 fs/crypto/keysetup.c:538 fscrypt_get_encryption_info+0x34a/0x3f0 fs/crypto/keysetup.c:647 fscrypt_setup_filename+0x238/0xec0 fs/crypto/fname.c:458 ext4_fname_setup_filename+0x88/0x110 fs/ext4/crypto.c:28 ext4_add_entry+0x3aa/0xef0 fs/ext4/namei.c:2367 ext4_rename+0x190a/0x2650 fs/ext4/namei.c:3884 ext4_rename2+0x1c3/0x270 fs/ext4/namei.c:4164 vfs_rename+0x115e/0x1a90 fs/namei.c:4756 do_renameat2+0xb5e/0xc80 fs/namei.c:4907 __do_sys_renameat2 fs/namei.c:4940 [inline] __se_sys_renameat2 fs/namei.c:4937 [inline] __ia32_sys_renameat2+0xe4/0x120 fs/namei.c:4937 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+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7fc5549 Code: 03 74 c0 01 10 05 03 74 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 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:00000000f7fc05cc EFLAGS: 00000296 ORIG_RAX: 0000000000000161 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000020000080 RDX: 0000000000000003 RSI: 00000000200000c0 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess): 0: 03 74 c0 01 add 0x1(%rax,%rax,8),%esi 4: 10 05 03 74 b8 01 adc %al,0x1b87403(%rip) # 0x1b8740d a: 10 06 adc %al,(%rsi) c: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 10: 10 07 adc %al,(%rdi) 12: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi 16: 10 08 adc %cl,(%rax) 18: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1c: 00 00 add %al,(%rax) 1e: 00 00 add %al,(%rax) 20: 00 51 52 add %dl,0x52(%rcx) 23: 55 push %rbp 24: 89 e5 mov %esp,%ebp 26: 0f 34 sysenter 28: cd 80 int $0x80 * 2a: 5d pop %rbp <-- trapping instruction 2b: 5a pop %rdx 2c: 59 pop %rcx 2d: c3 retq 2e: 90 nop 2f: 90 nop 30: 90 nop 31: 90 nop 32: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 39: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi