====================================================== WARNING: possible circular locking dependency detected 5.19.0-syzkaller-00428-g9de1f9c8ca51 #0 Not tainted ------------------------------------------------------ kworker/u17:5/420 is trying to acquire lock: ffff888044700650 (sb_internal){.+.+}-{0:0}, at: evict+0x2ed/0x6b0 fs/inode.c:664 but task is already holding lock: ffffffff8bebf260 (fs_reclaim){+.+.}-{0:0}, at: __perform_reclaim mm/page_alloc.c:4643 [inline] ffffffff8bebf260 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_direct_reclaim mm/page_alloc.c:4668 [inline] ffffffff8bebf260 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_slowpath.constprop.0+0x9e1/0x2160 mm/page_alloc.c:5071 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (fs_reclaim){+.+.}-{0:0}: __fs_reclaim_acquire mm/page_alloc.c:4594 [inline] fs_reclaim_acquire+0x115/0x160 mm/page_alloc.c:4608 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/0x420 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:531 fscrypt_get_encryption_info+0x34a/0x3f0 fs/crypto/keysetup.c:640 fscrypt_prepare_readdir include/linux/fscrypt.h:972 [inline] ext4_readdir+0x1161/0x38b0 fs/ext4/dir.c:137 iterate_dir+0x56a/0x6f0 fs/readdir.c:65 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64 fs/readdir.c:354 [inline] __ia32_sys_getdents64+0x139/0x2c0 fs/readdir.c:354 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 -> #2 (fscrypt_init_mutex){+.+.}-{3:3}: __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:531 fscrypt_get_encryption_info+0x34a/0x3f0 fs/crypto/keysetup.c:640 fscrypt_setup_filename+0x238/0xec0 fs/crypto/fname.c:433 ext4_fname_setup_filename+0x88/0x110 fs/ext4/crypto.c:28 ext4_add_entry+0x3aa/0xe30 fs/ext4/namei.c:2344 ext4_rename+0x190a/0x2650 fs/ext4/namei.c:3864 ext4_rename2+0x1c2/0x270 fs/ext4/namei.c:4144 vfs_rename+0x115e/0x1a90 fs/namei.c:4719 do_renameat2+0xb5e/0xc80 fs/namei.c:4870 __do_sys_renameat2 fs/namei.c:4903 [inline] __se_sys_renameat2 fs/namei.c:4900 [inline] __ia32_sys_renameat2+0xe4/0x120 fs/namei.c:4900 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 (jbd2_handle){++++}-{0:0}: start_this_handle+0xfe7/0x14a0 fs/jbd2/transaction.c:463 jbd2__journal_start+0x399/0x930 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x3a8/0x4a0 fs/ext4/ext4_jbd2.c:105 ext4_sample_last_mounted fs/ext4/file.c:820 [inline] ext4_file_open+0x5e7/0xb50 fs/ext4/file.c:849 do_dentry_open+0x4a1/0x11f0 fs/open.c:878 do_open fs/namei.c:3520 [inline] path_openat+0x1c71/0x2930 fs/namei.c:3653 do_filp_open+0x1aa/0x400 fs/namei.c:3680 do_sys_openat2+0x16d/0x4c0 fs/open.c:1308 do_sys_open fs/open.c:1324 [inline] __do_sys_openat fs/open.c:1340 [inline] __se_sys_openat fs/open.c:1335 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1335 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 -> #0 (sb_internal){.+.+}-{0:0}: 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+0x2aba/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1827 [inline] sb_start_intwrite include/linux/fs.h:1949 [inline] ext4_evict_inode+0xea4/0x1970 fs/ext4/inode.c:238 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1744 [inline] iput.part.0+0x562/0x820 fs/inode.c:1770 iput+0x58/0x70 fs/inode.c:1760 dentry_unlink_inode+0x2b1/0x460 fs/dcache.c:401 __dentry_kill+0x3c0/0x640 fs/dcache.c:607 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+0x42d/0xbd0 mm/vmscan.c:770 shrink_slab_memcg mm/vmscan.c:839 [inline] shrink_slab+0x3ee/0x6f0 mm/vmscan.c:918 shrink_node_memcgs mm/vmscan.c:3124 [inline] shrink_node+0x8b3/0x1db0 mm/vmscan.c:3245 shrink_zones mm/vmscan.c:3482 [inline] do_try_to_free_pages+0x3b5/0x1700 mm/vmscan.c:3540 try_to_free_pages+0x2ac/0x840 mm/vmscan.c:3775 __perform_reclaim mm/page_alloc.c:4646 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:4668 [inline] __alloc_pages_slowpath.constprop.0+0xa8a/0x2160 mm/page_alloc.c:5071 __alloc_pages+0x436/0x510 mm/page_alloc.c:5444 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272 __get_free_pages+0x8/0x40 mm/page_alloc.c:5480 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:2625 [inline] apply_to_pmd_range mm/memory.c:2669 [inline] apply_to_pud_range mm/memory.c:2705 [inline] apply_to_p4d_range mm/memory.c:2741 [inline] __apply_to_page_range+0x686/0x1030 mm/memory.c:2775 alloc_vmap_area+0xb0f/0x1f00 mm/vmalloc.c:1594 __get_vm_area_node+0x142/0x3f0 mm/vmalloc.c:2453 __vmalloc_node_range+0x250/0x13e0 mm/vmalloc.c:3125 alloc_thread_stack_node kernel/fork.c:312 [inline] dup_task_struct kernel/fork.c:977 [inline] copy_process+0x156e/0x7020 kernel/fork.c:2071 kernel_clone+0xe7/0xab0 kernel/fork.c:2655 user_mode_thread+0xad/0xe0 kernel/fork.c:2724 call_usermodehelper_exec_sync kernel/umh.c:135 [inline] call_usermodehelper_exec_work+0x69/0x180 kernel/umh.c:166 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 other info that might help us debug this: Chain exists of: sb_internal --> fscrypt_init_mutex --> fs_reclaim Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(fscrypt_init_mutex); lock(fs_reclaim); lock(sb_internal); *** DEADLOCK *** 5 locks held by kworker/u17:5/420: #0: ffff888011871138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888011871138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff888011871138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff888011871138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline] #0: ffff888011871138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline] #0: ffff888011871138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260 #1: ffffc9000305fda8 ((work_completion)(&sub_info->work)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264 #2: ffffffff8bebf260 (fs_reclaim){+.+.}-{0:0}, at: __perform_reclaim mm/page_alloc.c:4643 [inline] #2: ffffffff8bebf260 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_direct_reclaim mm/page_alloc.c:4668 [inline] #2: ffffffff8bebf260 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_slowpath.constprop.0+0x9e1/0x2160 mm/page_alloc.c:5071 #3: ffffffff8be7edb0 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab_memcg mm/vmscan.c:812 [inline] #3: ffffffff8be7edb0 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x2b4/0x6f0 mm/vmscan.c:918 #4: ffff8880447000e0 (&type->s_umount_key#31){++++}-{3:3}, at: trylock_super fs/super.c:415 [inline] #4: ffff8880447000e0 (&type->s_umount_key#31){++++}-{3:3}, at: super_cache_scan+0x6c/0x590 fs/super.c:79 stack backtrace: CPU: 0 PID: 420 Comm: kworker/u17:5 Not tainted 5.19.0-syzkaller-00428-g9de1f9c8ca51 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Workqueue: events_unbound call_usermodehelper_exec_work 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+0x2aba/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1827 [inline] sb_start_intwrite include/linux/fs.h:1949 [inline] ext4_evict_inode+0xea4/0x1970 fs/ext4/inode.c:238 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1744 [inline] iput.part.0+0x562/0x820 fs/inode.c:1770 iput+0x58/0x70 fs/inode.c:1760 dentry_unlink_inode+0x2b1/0x460 fs/dcache.c:401 __dentry_kill+0x3c0/0x640 fs/dcache.c:607 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+0x42d/0xbd0 mm/vmscan.c:770 shrink_slab_memcg mm/vmscan.c:839 [inline] shrink_slab+0x3ee/0x6f0 mm/vmscan.c:918 shrink_node_memcgs mm/vmscan.c:3124 [inline] shrink_node+0x8b3/0x1db0 mm/vmscan.c:3245 shrink_zones mm/vmscan.c:3482 [inline] do_try_to_free_pages+0x3b5/0x1700 mm/vmscan.c:3540 try_to_free_pages+0x2ac/0x840 mm/vmscan.c:3775 __perform_reclaim mm/page_alloc.c:4646 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:4668 [inline] __alloc_pages_slowpath.constprop.0+0xa8a/0x2160 mm/page_alloc.c:5071 __alloc_pages+0x436/0x510 mm/page_alloc.c:5444 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272 __get_free_pages+0x8/0x40 mm/page_alloc.c:5480 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:2625 [inline] apply_to_pmd_range mm/memory.c:2669 [inline] apply_to_pud_range mm/memory.c:2705 [inline] apply_to_p4d_range mm/memory.c:2741 [inline] __apply_to_page_range+0x686/0x1030 mm/memory.c:2775 alloc_vmap_area+0xb0f/0x1f00 mm/vmalloc.c:1594 __get_vm_area_node+0x142/0x3f0 mm/vmalloc.c:2453 __vmalloc_node_range+0x250/0x13e0 mm/vmalloc.c:3125 alloc_thread_stack_node kernel/fork.c:312 [inline] dup_task_struct kernel/fork.c:977 [inline] copy_process+0x156e/0x7020 kernel/fork.c:2071 kernel_clone+0xe7/0xab0 kernel/fork.c:2655 user_mode_thread+0xad/0xe0 kernel/fork.c:2724 call_usermodehelper_exec_sync kernel/umh.c:135 [inline] call_usermodehelper_exec_work+0x69/0x180 kernel/umh.c:166 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306