fscrypt: key with description 'fscrypt:85baa174f0cb1142' has invalid payload fscrypt: key with description 'fscrypt:85baa174f0cb1142' has invalid payload ====================================================== WARNING: possible circular locking dependency detected 6.8.0-rc7-syzkaller-00017-g29cd507cbec2 #0 Not tainted ------------------------------------------------------ syz-executor.2/4088 is trying to acquire lock: ffff888029660cd8 (&type->lock_class#3){++++}-{3:3}, at: find_and_lock_process_key+0x97/0x390 fs/crypto/keysetup_v1.c:112 but task is already holding lock: ffff888024484950 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x10dd/0x15e0 fs/jbd2/transaction.c:463 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (jbd2_handle){++++}-{0:0}: start_this_handle+0x1103/0x15e0 fs/jbd2/transaction.c:463 jbd2__journal_start+0x395/0x850 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x347/0x5e0 fs/ext4/ext4_jbd2.c:112 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_dirty_inode+0xa1/0x130 fs/ext4/inode.c:5939 __mark_inode_dirty+0x1e0/0xd60 fs/fs-writeback.c:2452 mark_inode_dirty_sync include/linux/fs.h:2387 [inline] iput.part.0+0x5b/0x7b0 fs/inode.c:1762 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+0x18a/0x1310 mm/shrinker.c:662 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 -> #1 (fs_reclaim){+.+.}-{0:0}: __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] __do_kmalloc_node mm/slub.c:3980 [inline] __kmalloc+0xb5/0x440 mm/slub.c:3994 kmalloc include/linux/slab.h:594 [inline] setup_v1_file_key_derived fs/crypto/keysetup_v1.c:278 [inline] fscrypt_setup_v1_file_key+0x167/0x550 fs/crypto/keysetup_v1.c:299 fscrypt_setup_v1_file_key_via_subscribed_keyrings+0x159/0x2e0 fs/crypto/keysetup_v1.c:321 setup_file_encryption_key fs/crypto/keysetup.c:485 [inline] fscrypt_setup_encryption_info+0xb6d/0x1080 fs/crypto/keysetup.c:590 fscrypt_get_encryption_info+0x3d7/0x4b0 fs/crypto/keysetup.c:675 fscrypt_setup_filename+0x238/0xd80 fs/crypto/fname.c:458 __fscrypt_prepare_lookup+0x2c/0xf0 fs/crypto/hooks.c:100 fscrypt_prepare_lookup include/linux/fscrypt.h:979 [inline] ext4_fname_prepare_lookup+0x1e0/0x350 fs/ext4/crypto.c:48 ext4_lookup_entry fs/ext4/namei.c:1764 [inline] ext4_lookup+0x14b/0x740 fs/ext4/namei.c:1839 lookup_one_qstr_excl+0x11d/0x190 fs/namei.c:1608 filename_create+0x1ed/0x530 fs/namei.c:3896 do_symlinkat+0xbf/0x310 fs/namei.c:4503 __do_sys_symlinkat fs/namei.c:4526 [inline] __se_sys_symlinkat fs/namei.c:4523 [inline] __x64_sys_symlinkat+0x97/0xc0 fs/namei.c:4523 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 -> #0 (&type->lock_class#3){++++}-{3:3}: 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 down_read+0x9a/0x330 kernel/locking/rwsem.c:1526 find_and_lock_process_key+0x97/0x390 fs/crypto/keysetup_v1.c:112 fscrypt_setup_v1_file_key_via_subscribed_keyrings+0x115/0x2e0 fs/crypto/keysetup_v1.c:310 setup_file_encryption_key fs/crypto/keysetup.c:485 [inline] fscrypt_setup_encryption_info+0xb6d/0x1080 fs/crypto/keysetup.c:590 fscrypt_get_encryption_info+0x3d7/0x4b0 fs/crypto/keysetup.c:675 fscrypt_setup_filename+0x238/0xd80 fs/crypto/fname.c:458 ext4_fname_setup_filename+0xa3/0x260 fs/ext4/crypto.c:28 ext4_add_entry+0x2e3/0xdf0 fs/ext4/namei.c:2401 ext4_rename+0x16a9/0x28a0 fs/ext4/namei.c:3937 ext4_rename2+0x1bc/0x270 fs/ext4/namei.c:4215 vfs_rename+0xf87/0x20b0 fs/namei.c:4883 do_renameat2+0xc54/0xdc0 fs/namei.c:5040 __do_sys_renameat fs/namei.c:5081 [inline] __se_sys_renameat fs/namei.c:5078 [inline] __x64_sys_renameat+0xc6/0x100 fs/namei.c:5078 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: &type->lock_class#3 --> fs_reclaim --> jbd2_handle Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(jbd2_handle); lock(fs_reclaim); lock(jbd2_handle); rlock(&type->lock_class#3); *** DEADLOCK *** 6 locks held by syz-executor.2/4088: #0: ffff888024480420 (sb_writers#5){.+.+}-{0:0}, at: do_renameat2+0x3d6/0xdc0 fs/namei.c:4970 #1: ffff888024480708 (&type->s_vfs_rename_key#2){+.+.}-{3:3}, at: lock_rename fs/namei.c:3073 [inline] #1: ffff888024480708 (&type->s_vfs_rename_key#2){+.+.}-{3:3}, at: do_renameat2+0x4ef/0xdc0 fs/namei.c:4975 #2: ffff88802e932c00 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline] #2: ffff88802e932c00 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: lock_two_directories+0x92/0x2d0 fs/namei.c:3039 #3: ffff888060038400 (&type->i_mutex_dir_key#3/5){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline] #3: ffff888060038400 (&type->i_mutex_dir_key#3/5){+.+.}-{3:3}, at: lock_two_directories+0xc6/0x2d0 fs/namei.c:3040 #4: ffff88801933f200 (&type->i_mutex_dir_key#3/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline] #4: ffff88801933f200 (&type->i_mutex_dir_key#3/2){+.+.}-{3:3}, at: vfs_rename+0x117e/0x20b0 fs/namei.c:4846 #5: ffff888024484950 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x10dd/0x15e0 fs/jbd2/transaction.c:463 stack backtrace: CPU: 2 PID: 4088 Comm: syz-executor.2 Not tainted 6.8.0-rc7-syzkaller-00017-g29cd507cbec2 #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 down_read+0x9a/0x330 kernel/locking/rwsem.c:1526 find_and_lock_process_key+0x97/0x390 fs/crypto/keysetup_v1.c:112 fscrypt_setup_v1_file_key_via_subscribed_keyrings+0x115/0x2e0 fs/crypto/keysetup_v1.c:310 setup_file_encryption_key fs/crypto/keysetup.c:485 [inline] fscrypt_setup_encryption_info+0xb6d/0x1080 fs/crypto/keysetup.c:590 fscrypt_get_encryption_info+0x3d7/0x4b0 fs/crypto/keysetup.c:675 fscrypt_setup_filename+0x238/0xd80 fs/crypto/fname.c:458 ext4_fname_setup_filename+0xa3/0x260 fs/ext4/crypto.c:28 ext4_add_entry+0x2e3/0xdf0 fs/ext4/namei.c:2401 ext4_rename+0x16a9/0x28a0 fs/ext4/namei.c:3937 ext4_rename2+0x1bc/0x270 fs/ext4/namei.c:4215 vfs_rename+0xf87/0x20b0 fs/namei.c:4883 do_renameat2+0xc54/0xdc0 fs/namei.c:5040 __do_sys_renameat fs/namei.c:5081 [inline] __se_sys_renameat fs/namei.c:5078 [inline] __x64_sys_renameat+0xc6/0x100 fs/namei.c:5078 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:0x7fb76cc7dda9 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:00007fb76d9fc0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000108 RAX: ffffffffffffffda RBX: 00007fb76cdabf80 RCX: 00007fb76cc7dda9 RDX: 0000000000000004 RSI: 0000000020000100 RDI: ffffffffffffff9c RBP: 00007fb76ccca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020000140 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fb76cdabf80 R15: 00007ffc80b01f98 fscrypt: key with description 'fscrypt:85baa174f0cb1142' has invalid payload