------------[ cut here ]------------
Looking for class "&ea_inode->i_rwsem" with key ext4_fs_type, but found a different class "&sb->s_type->i_mutex_key" with the same key
WARNING: CPU: 0 PID: 22745 at kernel/locking/lockdep.c:941 look_up_lock_class+0xec/0x158 kernel/locking/lockdep.c:938
Modules linked in:
CPU: 0 PID: 22745 Comm: syz-executor.2 Not tainted 6.1.27-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : look_up_lock_class+0xec/0x158 kernel/locking/lockdep.c:938
lr : look_up_lock_class+0xec/0x158 kernel/locking/lockdep.c:938
sp : ffff8000200a6b80
x29: ffff8000200a6b80 x28: dfff800000000000 x27: ffff800008f47694
x26: ffff8000195af780 x25: ffff8000195af000 x24: 0000000000000000
x23: 0000000000000000 x22: 0000000000000000 x21: ffff800015900b18
x20: ffff0000e71c9810 x19: ffff8000181ea9c0 x18: 1ffff00004014da8
x17: 0000000000000000 x16: ffff8000120e6354 x15: 0000000000000000
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000001
x11: ff808000081ae818 x10: 0000000000000000 x9 : 3e75c3455bea5400
x8 : 3e75c3455bea5400 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff8000200a6478 x4 : ffff800015672960 x3 : ffff800008585158
x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000
Call trace:
look_up_lock_class+0xec/0x158 kernel/locking/lockdep.c:938
register_lock_class+0x90/0x6a8 kernel/locking/lockdep.c:1290
__lock_acquire+0x184/0x764c kernel/locking/lockdep.c:4935
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
down_write+0x5c/0x88 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:756 [inline]
ext4_xattr_inode_iget+0x3a8/0x4b8 fs/ext4/xattr.c:438
ext4_xattr_inode_inc_ref_all+0x120/0x484 fs/ext4/xattr.c:1077
ext4_xattr_block_set+0x1c64/0x2cc4 fs/ext4/xattr.c:2110
ext4_xattr_set_handle+0xae8/0x1294 fs/ext4/xattr.c:2407
ext4_xattr_set+0x1dc/0x350 fs/ext4/xattr.c:2509
ext4_xattr_trusted_set+0x4c/0x64 fs/ext4/xattr_trusted.c:38
__vfs_setxattr+0x388/0x3a4 fs/xattr.c:182
__vfs_setxattr_noperm+0x110/0x528 fs/xattr.c:216
__vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277
vfs_setxattr+0x1a8/0x344 fs/xattr.c:309
do_setxattr fs/xattr.c:594 [inline]
setxattr+0x230/0x294 fs/xattr.c:617
path_setxattr+0x17c/0x258 fs/xattr.c:636
__do_sys_setxattr fs/xattr.c:652 [inline]
__se_sys_setxattr fs/xattr.c:648 [inline]
__arm64_sys_setxattr+0xbc/0xd8 fs/xattr.c:648
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
irq event stamp: 217
hardirqs last enabled at (217): [<ffff8000120e4420>] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:84 [inline]
hardirqs last enabled at (217): [<ffff8000120e4420>] exit_to_kernel_mode+0xe8/0x118 arch/arm64/kernel/entry-common.c:94
hardirqs last disabled at (216): [<ffff8000120e20fc>] __el1_irq arch/arm64/kernel/entry-common.c:468 [inline]
hardirqs last disabled at (216): [<ffff8000120e20fc>] el1_interrupt+0x24/0x68 arch/arm64/kernel/entry-common.c:486
softirqs last enabled at (8): [<ffff800008032b74>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (6): [<ffff800008032b40>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
---[ end trace 0000000000000000 ]---
============================================
WARNING: possible recursive locking detected
6.1.27-syzkaller #0 Tainted: G W
--------------------------------------------
syz-executor.2/22745 is trying to acquire lock:
ffff0000e71c9810 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
ffff0000e71c9810 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_xattr_inode_iget+0x3a8/0x4b8 fs/ext4/xattr.c:438
but task is already holding lock:
ffff0000e7274030 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
ffff0000e7274030 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: vfs_setxattr+0x17c/0x344 fs/xattr.c:308
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&sb->s_type->i_mutex_key#9);
lock(&sb->s_type->i_mutex_key#9);
*** DEADLOCK ***
May be due to missing lock nesting notation
3 locks held by syz-executor.2/22745:
#0: ffff0000c9c50460 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:393
#1: ffff0000e7274030 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
#1: ffff0000e7274030 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: vfs_setxattr+0x17c/0x344 fs/xattr.c:308
#2: ffff0000e7273cf8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline]
#2: ffff0000e7273cf8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_xattr_set_handle+0x1e0/0x1294 fs/ext4/xattr.c:2322
stack backtrace:
CPU: 0 PID: 22745 Comm: syz-executor.2 Tainted: G W 6.1.27-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x5c lib/dump_stack.c:113
__lock_acquire+0x6310/0x764c kernel/locking/lockdep.c:5056
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
down_write+0x5c/0x88 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:756 [inline]
ext4_xattr_inode_iget+0x3a8/0x4b8 fs/ext4/xattr.c:438
ext4_xattr_inode_inc_ref_all+0x120/0x484 fs/ext4/xattr.c:1077
ext4_xattr_block_set+0x1c64/0x2cc4 fs/ext4/xattr.c:2110
ext4_xattr_set_handle+0xae8/0x1294 fs/ext4/xattr.c:2407
ext4_xattr_set+0x1dc/0x350 fs/ext4/xattr.c:2509
ext4_xattr_trusted_set+0x4c/0x64 fs/ext4/xattr_trusted.c:38
__vfs_setxattr+0x388/0x3a4 fs/xattr.c:182
__vfs_setxattr_noperm+0x110/0x528 fs/xattr.c:216
__vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277
vfs_setxattr+0x1a8/0x344 fs/xattr.c:309
do_setxattr fs/xattr.c:594 [inline]
setxattr+0x230/0x294 fs/xattr.c:617
path_setxattr+0x17c/0x258 fs/xattr.c:636
__do_sys_setxattr fs/xattr.c:652 [inline]
__se_sys_setxattr fs/xattr.c:648 [inline]
__arm64_sys_setxattr+0xbc/0xd8 fs/xattr.c:648
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581