syzbot


possible deadlock in open_xa_dir

Status: upstream: reported on 2025/07/14 22:08
Reported-by: syzbot+acfcee4820738166a98f@syzkaller.appspotmail.com
First crash: 3d00h, last: 18h47m
Similar bugs (6)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in open_xa_dir 4 4 814d 828d 0/3 auto-obsoleted due to no activity on 2023/08/23 09:03
linux-6.1 possible deadlock in open_xa_dir (2) origin:upstream missing-backport 4 C done 388 2d14h 473d 0/3 upstream: reported C repro on 2024/03/31 06:40
upstream possible deadlock in open_xa_dir reiserfs 4 C done done 7667 534d 929d 0/29 auto-obsoleted due to no activity on 2024/04/09 20:57
linux-6.1 possible deadlock in open_xa_dir 4 3 822d 831d 0/3 auto-obsoleted due to no activity on 2023/08/15 19:04
linux-4.19 possible deadlock in open_xa_dir reiserfs 4 C error 3 925d 931d 0/1 upstream: reported C repro on 2022/12/29 15:01
linux-5.15 possible deadlock in open_xa_dir (2) missing-backport origin:upstream 4 C error 494 22h10m 471d 0/3 upstream: reported C repro on 2024/04/02 08:22

Sample crash report:
REISERFS (device loop0): Using tea hash to sort names
REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage.
======================================================
WARNING: possible circular locking dependency detected
6.6.98-syzkaller #0 Not tainted
------------------------------------------------------
syz.0.70/6109 is trying to acquire lock:
ffff88807d85b090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x79/0xd0 fs/reiserfs/lock.c:27

but task is already holding lock:
ffff88805e9d82f0 (&type->i_mutex_dir_key#9/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline]
ffff88805e9d82f0 (&type->i_mutex_dir_key#9/3){+.+.}-{3:3}, at: open_xa_root fs/reiserfs/xattr.c:128 [inline]
ffff88805e9d82f0 (&type->i_mutex_dir_key#9/3){+.+.}-{3:3}, at: open_xa_dir+0x122/0x6f0 fs/reiserfs/xattr.c:153

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&type->i_mutex_dir_key#9/3){+.+.}-{3:3}:
       down_write_nested+0x9e/0x1f0 kernel/locking/rwsem.c:1689
       inode_lock_nested include/linux/fs.h:839 [inline]
       open_xa_root fs/reiserfs/xattr.c:128 [inline]
       open_xa_dir+0x122/0x6f0 fs/reiserfs/xattr.c:153
       reiserfs_for_each_xattr+0x17b/0x960 fs/reiserfs/xattr.c:253
       reiserfs_delete_xattrs+0x20/0x90 fs/reiserfs/xattr.c:365
       reiserfs_evict_inode+0x225/0x490 fs/reiserfs/inode.c:53
       evict+0x486/0x870 fs/inode.c:705
       reiserfs_new_inode+0x5cc/0x17d0 fs/reiserfs/inode.c:2152
       reiserfs_mkdir+0x55b/0x970 fs/reiserfs/namei.c:843
       vfs_mkdir+0x296/0x440 fs/namei.c:4113
       do_mkdirat+0x1d4/0x440 fs/namei.c:4136
       __do_sys_mkdirat fs/namei.c:4151 [inline]
       __se_sys_mkdirat fs/namei.c:4149 [inline]
       __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4149
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&sbi->lock){+.+.}-{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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
       lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x129/0xcc0 kernel/locking/mutex.c:747
       reiserfs_write_lock+0x79/0xd0 fs/reiserfs/lock.c:27
       reiserfs_mkdir+0x310/0x970 fs/reiserfs/namei.c:829
       xattr_mkdir fs/reiserfs/xattr.c:77 [inline]
       open_xa_root fs/reiserfs/xattr.c:137 [inline]
       open_xa_dir+0x31a/0x6f0 fs/reiserfs/xattr.c:153
       xattr_lookup+0x22/0x2a0 fs/reiserfs/xattr.c:396
       reiserfs_xattr_set_handle+0xf9/0xd40 fs/reiserfs/xattr.c:535
       reiserfs_xattr_set+0x439/0x550 fs/reiserfs/xattr.c:635
       __vfs_setxattr+0x431/0x470 fs/xattr.c:201
       __vfs_setxattr_noperm+0x12d/0x5e0 fs/xattr.c:235
       vfs_setxattr+0x16c/0x2f0 fs/xattr.c:322
       do_setxattr fs/xattr.c:630 [inline]
       path_setxattr+0x362/0x550 fs/xattr.c:659
       __do_sys_setxattr fs/xattr.c:677 [inline]
       __se_sys_setxattr fs/xattr.c:673 [inline]
       __x64_sys_setxattr+0xbb/0xd0 fs/xattr.c:673
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&type->i_mutex_dir_key#9/3);
                               lock(&sbi->lock);
                               lock(&type->i_mutex_dir_key#9/3);
  lock(&sbi->lock);

 *** DEADLOCK ***

3 locks held by syz.0.70/6109:
 #0: ffff88807b238418 (sb_writers#15){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:403
 #1: ffff88805e9db150 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
 #1: ffff88805e9db150 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: vfs_setxattr+0x145/0x2f0 fs/xattr.c:321
 #2: ffff88805e9d82f0 (&type->i_mutex_dir_key#9/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline]
 #2: ffff88805e9d82f0 (&type->i_mutex_dir_key#9/3){+.+.}-{3:3}, at: open_xa_root fs/reiserfs/xattr.c:128 [inline]
 #2: ffff88805e9d82f0 (&type->i_mutex_dir_key#9/3){+.+.}-{3:3}, at: open_xa_dir+0x122/0x6f0 fs/reiserfs/xattr.c:153

stack backtrace:
CPU: 1 PID: 6109 Comm: syz.0.70 Not tainted 6.6.98-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
 check_noncircular+0x2bd/0x3c0 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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x129/0xcc0 kernel/locking/mutex.c:747
 reiserfs_write_lock+0x79/0xd0 fs/reiserfs/lock.c:27
 reiserfs_mkdir+0x310/0x970 fs/reiserfs/namei.c:829
 xattr_mkdir fs/reiserfs/xattr.c:77 [inline]
 open_xa_root fs/reiserfs/xattr.c:137 [inline]
 open_xa_dir+0x31a/0x6f0 fs/reiserfs/xattr.c:153
 xattr_lookup+0x22/0x2a0 fs/reiserfs/xattr.c:396
 reiserfs_xattr_set_handle+0xf9/0xd40 fs/reiserfs/xattr.c:535
 reiserfs_xattr_set+0x439/0x550 fs/reiserfs/xattr.c:635
 __vfs_setxattr+0x431/0x470 fs/xattr.c:201
 __vfs_setxattr_noperm+0x12d/0x5e0 fs/xattr.c:235
 vfs_setxattr+0x16c/0x2f0 fs/xattr.c:322
 do_setxattr fs/xattr.c:630 [inline]
 path_setxattr+0x362/0x550 fs/xattr.c:659
 __do_sys_setxattr fs/xattr.c:677 [inline]
 __se_sys_setxattr fs/xattr.c:673 [inline]
 __x64_sys_setxattr+0xbb/0xd0 fs/xattr.c:673
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f3afb98e929
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f3afc854038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc
RAX: ffffffffffffffda RBX: 00007f3afbbb5fa0 RCX: 00007f3afb98e929
RDX: 0000200000002280 RSI: 0000200000000080 RDI: 0000200000000040
RBP: 00007f3afba10ca1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000b81 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f3afbbb5fa0 R15: 00007ffe6abb91f8
 </TASK>

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/17 03:29 linux-6.6.y 9247f4e6573a 44f8051e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in open_xa_dir
2025/07/17 03:26 linux-6.6.y 9247f4e6573a 44f8051e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in open_xa_dir
2025/07/15 07:56 linux-6.6.y 9247f4e6573a 03fcfc4b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in open_xa_dir
2025/07/15 07:53 linux-6.6.y 9247f4e6573a 03fcfc4b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in open_xa_dir
2025/07/15 07:53 linux-6.6.y 9247f4e6573a 03fcfc4b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in open_xa_dir
2025/07/15 07:52 linux-6.6.y 9247f4e6573a 03fcfc4b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in open_xa_dir
2025/07/14 22:08 linux-6.6.y 9247f4e6573a d8fc7335 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in open_xa_dir
2025/07/14 22:08 linux-6.6.y 9247f4e6573a d8fc7335 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in open_xa_dir
* Struck through repros no longer work on HEAD.