[v6.6] possible deadlock in open_xa_dir

1 view
Skip to first unread message

syzbot

unread,
Jul 14, 2025, 6:08:36 PM7/14/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 9247f4e6573a Linux 6.6.98
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1671fd82580000
kernel config: https://syzkaller.appspot.com/x/.config?x=cfe840f14e117c98
dashboard link: https://syzkaller.appspot.com/bug?extid=acfcee4820738166a98f
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/3855f6db0ca8/disk-9247f4e6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/fe3d6afeb3a6/vmlinux-9247f4e6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/7d8784621ac6/bzImage-9247f4e6.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+acfcee...@syzkaller.appspotmail.com

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

but task is already holding lock:
ffff888053002410 (&type->i_mutex_dir_key#15/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline]
ffff888053002410 (&type->i_mutex_dir_key#15/3){+.+.}-{3:3}, at: open_xa_root fs/reiserfs/xattr.c:128 [inline]
ffff888053002410 (&type->i_mutex_dir_key#15/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#15/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_lsetxattr fs/xattr.c:684 [inline]
__se_sys_lsetxattr fs/xattr.c:680 [inline]
__x64_sys_lsetxattr+0xb8/0xd0 fs/xattr.c:680
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#15/3);
lock(&sbi->lock);
lock(&type->i_mutex_dir_key#15/3);
lock(&sbi->lock);

*** DEADLOCK ***

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

stack backtrace:
CPU: 1 PID: 7009 Comm: syz.4.340 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_lsetxattr fs/xattr.c:684 [inline]
__se_sys_lsetxattr fs/xattr.c:680 [inline]
__x64_sys_lsetxattr+0xb8/0xd0 fs/xattr.c:680
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:0x7fe2a038e929
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:00007fe2a127f038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 00007fe2a05b5fa0 RCX: 00007fe2a038e929
RDX: 0000200000000400 RSI: 00002000000000c0 RDI: 0000200000000080
RBP: 00007fe2a0410b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000104 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fe2a05b5fa0 R15: 00007ffc267d6e18
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Sep 18, 2025, 11:51:33 PM9/18/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 60a9e718726f Linux 6.6.106
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14a73f62580000
kernel config: https://syzkaller.appspot.com/x/.config?x=12606d4b8832c7e4
dashboard link: https://syzkaller.appspot.com/bug?extid=acfcee4820738166a98f
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16d46534580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1542c712580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/eca27e056a5a/disk-60a9e718.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bc64d4eeb7f6/vmlinux-60a9e718.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a345041561ac/bzImage-60a9e718.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/5a4d33932e70/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=1385e858580000)

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+acfcee...@syzkaller.appspotmail.com

REISERFS warning (device loop0): sh-2029: %s: bitmap block (#%u) reading failed reiserfs_read_bitmap_block: reiserfs_read_bitmap_block
REISERFS warning (device loop0): sh-2029: %s: bitmap block (#%u) reading failed reiserfs_read_bitmap_block: reiserfs_read_bitmap_block
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.17/5949 is trying to acquire lock:
ffff88805e8f0990 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline]
ffff88805e8f0990 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: open_xa_root fs/reiserfs/xattr.c:128 [inline]
ffff88805e8f0990 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: open_xa_dir+0x122/0x6f0 fs/reiserfs/xattr.c:153

but task is already holding lock:
ffff88807ac73090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock_nested+0x60/0xd0 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}:
__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_set_acl+0x51e/0x640 fs/reiserfs/xattr_acl.c:277
reiserfs_set_acl+0x45a/0x600 fs/reiserfs/xattr_acl.c:51
set_posix_acl fs/posix_acl.c:956 [inline]
vfs_set_acl+0x803/0xa60 fs/posix_acl.c:1135
do_set_acl+0xf5/0x180 fs/posix_acl.c:1280
do_setxattr fs/xattr.c:627 [inline]
__do_sys_fsetxattr fs/xattr.c:711 [inline]
__se_sys_fsetxattr+0x450/0x4b0 fs/xattr.c:687
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 (&type->i_mutex_dir_key#8/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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
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_mknod+0x3ee/0x6c0 fs/reiserfs/namei.c:746
vfs_mknod+0x32b/0x360 fs/namei.c:3991
do_mknodat+0x37e/0x4f0 fs/namei.c:-1
__do_sys_mknodat fs/namei.c:4069 [inline]
__se_sys_mknodat fs/namei.c:4066 [inline]
__x64_sys_mknodat+0xa9/0xc0 fs/namei.c:4066
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(&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.0.17/5949:
#0: ffff888028aee418 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:403
#1: ffff88805e8f02f0 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline]
#1: ffff88805e8f02f0 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: filename_create+0x1f6/0x460 fs/namei.c:3882
#2: ffff88807ac73090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock_nested+0x60/0xd0 fs/reiserfs/lock.c:78

stack backtrace:
CPU: 1 PID: 5949 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/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
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_mknod+0x3ee/0x6c0 fs/reiserfs/namei.c:746
vfs_mknod+0x32b/0x360 fs/namei.c:3991
do_mknodat+0x37e/0x4f0 fs/namei.c:-1
__do_sys_mknodat fs/namei.c:4069 [inline]
__se_sys_mknodat fs/namei.c:4066 [inline]
__x64_sys_mknodat+0xa9/0xc0 fs/namei.c:4066
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:0x7f272a18eba9
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:00007ffe72291bc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000103
RAX: ffffffffffffffda RBX: 00007f272a3d5fa0 RCX: 00007f272a18eba9
RDX: b0a54e68b1cd2fdb RSI: 0000200000000040 RDI: ffffffffffffff9c
RBP: 00007f272a211e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000103 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f272a3d5fa0 R14: 00007f272a3d5fa0 R15: 0000000000000004
</TASK>


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Reply all
Reply to author
Forward
0 new messages