REISERFS (device loop0): checking transaction log (loop0) REISERFS (device loop0): Using r5 hash to sort names REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage. ====================================================== WARNING: possible circular locking dependency detected 6.3.0-rc1-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/5418 is trying to acquire lock: ffff8880742c8980 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] ffff8880742c8980 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: open_xa_root fs/reiserfs/xattr.c:127 [inline] ffff8880742c8980 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: open_xa_dir+0x134/0x540 fs/reiserfs/xattr.c:152 but task is already holding lock: ffff88807568d090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock_nested+0x4a/0xb0 fs/reiserfs/lock.c:78 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&sbi->lock){+.+.}-{3:3}: lock_acquire+0x23e/0x630 kernel/locking/lockdep.c:5669 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 reiserfs_write_lock+0x70/0xc0 fs/reiserfs/lock.c:27 reiserfs_mkdir+0x321/0x870 fs/reiserfs/namei.c:831 xattr_mkdir fs/reiserfs/xattr.c:76 [inline] open_xa_root fs/reiserfs/xattr.c:136 [inline] open_xa_dir+0x259/0x540 fs/reiserfs/xattr.c:152 xattr_lookup+0x17/0x210 fs/reiserfs/xattr.c:395 reiserfs_xattr_set_handle+0xda/0xc80 fs/reiserfs/xattr.c:533 reiserfs_security_write+0x134/0x190 fs/reiserfs/xattr_security.c:106 reiserfs_new_inode+0x13bf/0x1a90 fs/reiserfs/inode.c:2113 reiserfs_create+0x3b1/0x680 fs/reiserfs/namei.c:668 lookup_open fs/namei.c:3416 [inline] open_last_lookups fs/namei.c:3484 [inline] path_openat+0xf1e/0x2c10 fs/namei.c:3712 do_filp_open+0x22a/0x440 fs/namei.c:3742 do_sys_openat2+0x10f/0x430 fs/open.c:1348 do_sys_open fs/open.c:1364 [inline] __do_sys_creat fs/open.c:1440 [inline] __se_sys_creat fs/open.c:1434 [inline] __x64_sys_creat+0x11e/0x160 fs/open.c:1434 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3832 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056 lock_acquire+0x23e/0x630 kernel/locking/lockdep.c:5669 down_write_nested+0x3d/0x50 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:793 [inline] open_xa_root fs/reiserfs/xattr.c:127 [inline] open_xa_dir+0x134/0x540 fs/reiserfs/xattr.c:152 xattr_lookup+0x17/0x210 fs/reiserfs/xattr.c:395 reiserfs_xattr_get+0xe1/0x4a0 fs/reiserfs/xattr.c:677 __vfs_getxattr+0x2fe/0x350 fs/xattr.c:426 smk_fetch+0x98/0xf0 security/smack/smack_lsm.c:295 smack_d_instantiate+0x5d5/0xa20 security/smack/smack_lsm.c:3491 security_d_instantiate+0x6b/0xb0 security/security.c:3760 d_instantiate_new+0x5e/0xe0 fs/dcache.c:2053 reiserfs_create+0x5ee/0x680 fs/reiserfs/namei.c:694 lookup_open fs/namei.c:3416 [inline] open_last_lookups fs/namei.c:3484 [inline] path_openat+0xf1e/0x2c10 fs/namei.c:3712 do_filp_open+0x22a/0x440 fs/namei.c:3742 do_sys_openat2+0x10f/0x430 fs/open.c:1348 do_sys_open fs/open.c:1364 [inline] __do_sys_creat fs/open.c:1440 [inline] __se_sys_creat fs/open.c:1434 [inline] __x64_sys_creat+0x11e/0x160 fs/open.c:1434 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sbi->lock); lock(&type->i_mutex_dir_key#8/3); lock(&sbi->lock); lock(&type->i_mutex_dir_key#8/3); *** DEADLOCK *** 3 locks held by syz-executor.0/5418: #0: ffff888026b3c460 (sb_writers#14){.+.+}-{0:0}, at: mnt_want_write+0x3a/0x70 fs/namespace.c:394 #1: ffff8880742c82e0 (&type->i_mutex_dir_key#8){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff8880742c82e0 (&type->i_mutex_dir_key#8){+.+.}-{3:3}, at: open_last_lookups fs/namei.c:3481 [inline] #1: ffff8880742c82e0 (&type->i_mutex_dir_key#8){+.+.}-{3:3}, at: path_openat+0x6ed/0x2c10 fs/namei.c:3712 #2: ffff88807568d090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock_nested+0x4a/0xb0 fs/reiserfs/lock.c:78 stack backtrace: CPU: 0 PID: 5418 Comm: syz-executor.0 Not tainted 6.3.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x167/0x220 lib/dump_stack.c:106 check_noncircular+0x2fe/0x3b0 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3832 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056 lock_acquire+0x23e/0x630 kernel/locking/lockdep.c:5669 down_write_nested+0x3d/0x50 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:793 [inline] open_xa_root fs/reiserfs/xattr.c:127 [inline] open_xa_dir+0x134/0x540 fs/reiserfs/xattr.c:152 xattr_lookup+0x17/0x210 fs/reiserfs/xattr.c:395 reiserfs_xattr_get+0xe1/0x4a0 fs/reiserfs/xattr.c:677 __vfs_getxattr+0x2fe/0x350 fs/xattr.c:426 smk_fetch+0x98/0xf0 security/smack/smack_lsm.c:295 smack_d_instantiate+0x5d5/0xa20 security/smack/smack_lsm.c:3491 security_d_instantiate+0x6b/0xb0 security/security.c:3760 d_instantiate_new+0x5e/0xe0 fs/dcache.c:2053 reiserfs_create+0x5ee/0x680 fs/reiserfs/namei.c:694 lookup_open fs/namei.c:3416 [inline] open_last_lookups fs/namei.c:3484 [inline] path_openat+0xf1e/0x2c10 fs/namei.c:3712 do_filp_open+0x22a/0x440 fs/namei.c:3742 do_sys_openat2+0x10f/0x430 fs/open.c:1348 do_sys_open fs/open.c:1364 [inline] __do_sys_creat fs/open.c:1440 [inline] __se_sys_creat fs/open.c:1434 [inline] __x64_sys_creat+0x11e/0x160 fs/open.c:1434 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f363da8c169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f363e76d168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f363dbabf80 RCX: 00007f363da8c169 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000080 RBP: 00007f363dae7ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcf155b81f R14: 00007f363e76d300 R15: 0000000000022000