====================================================== WARNING: possible circular locking dependency detected 6.0.0-rc5-syzkaller-00007-g6504d82f4440 #0 Not tainted ------------------------------------------------------ kswapd0/128 is trying to acquire lock: ffff88801af58650 (sb_internal){.+.+}-{0:0}, at: evict+0x2ed/0x6b0 fs/inode.c:665 but task is already holding lock: ffffffff8c0be7e0 (fs_reclaim){+.+.}-{0:0}, at: try_to_freeze_unsafe include/linux/freezer.h:58 [inline] ffffffff8c0be7e0 (fs_reclaim){+.+.}-{0:0}, at: try_to_freeze include/linux/freezer.h:67 [inline] ffffffff8c0be7e0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0xd1e/0x1580 mm/vmscan.c:4291 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: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/slab.c:3194 [inline] kmem_cache_alloc_node_trace+0x47/0x570 mm/slab.c:3601 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_slow+0x24c/0x460 fs/namei.c:1685 lookup_slow fs/namei.c:1702 [inline] walk_component+0x33f/0x5a0 fs/namei.c:1993 lookup_last fs/namei.c:2450 [inline] path_lookupat+0x1ba/0x840 fs/namei.c:2474 filename_lookup+0x1ce/0x590 fs/namei.c:2503 user_path_at_empty+0x42/0x60 fs/namei.c:2876 user_path_at include/linux/namei.h:57 [inline] path_removexattr+0x85/0x1a0 fs/xattr.c:894 __do_sys_removexattr fs/xattr.c:913 [inline] __se_sys_removexattr fs/xattr.c:910 [inline] __x64_sys_removexattr+0x55/0x80 fs/xattr.c:910 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 (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: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] __x64_sys_renameat2+0xe4/0x120 fs/namei.c:4937 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 -> #1 (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 -> #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+0x2a43/0x56d0 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: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 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+0x17c/0x6f0 mm/vmscan.c:991 shrink_node_memcgs mm/vmscan.c:3182 [inline] shrink_node+0x8c9/0x1e80 mm/vmscan.c:3304 kswapd_shrink_node mm/vmscan.c:4086 [inline] balance_pgdat+0x8ef/0x1580 mm/vmscan.c:4277 kswapd+0x79b/0xf80 mm/vmscan.c:4537 kthread+0x2e4/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 *** 3 locks held by kswapd0/128: #0: ffffffff8c0be7e0 (fs_reclaim){+.+.}-{0:0}, at: try_to_freeze_unsafe include/linux/freezer.h:58 [inline] #0: ffffffff8c0be7e0 (fs_reclaim){+.+.}-{0:0}, at: try_to_freeze include/linux/freezer.h:67 [inline] #0: ffffffff8c0be7e0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0xd1e/0x1580 mm/vmscan.c:4291 #1: ffffffff8c07e7f0 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0xc9/0x6f0 mm/vmscan.c:981 #2: ffff88801af580e0 (&type->s_umount_key#42){++++}-{3:3}, at: trylock_super fs/super.c:415 [inline] #2: ffff88801af580e0 (&type->s_umount_key#42){++++}-{3:3}, at: super_cache_scan+0x6c/0x590 fs/super.c:79 stack backtrace: CPU: 2 PID: 128 Comm: kswapd0 Not tainted 6.0.0-rc5-syzkaller-00007-g6504d82f4440 #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 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 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+0x17c/0x6f0 mm/vmscan.c:991 shrink_node_memcgs mm/vmscan.c:3182 [inline] shrink_node+0x8c9/0x1e80 mm/vmscan.c:3304 kswapd_shrink_node mm/vmscan.c:4086 [inline] balance_pgdat+0x8ef/0x1580 mm/vmscan.c:4277 kswapd+0x79b/0xf80 mm/vmscan.c:4537 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306