possible deadlock in delete_one_xattr

Status: upstream: reported on 2026/09/22 08:06
Reported-by: syzbot+3c4db27049db1f2ba938@syzkaller.appspotmail.com
First crash: 16d, last: 13h13m
▶ ▼ Similar bugs (7)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 possible deadlock in delete_one_xattr reiserfs 4 2 1338d 1398d 0/1 upstream: reported on 2022/12/10 02:38
linux-5.15 possible deadlock in delete_one_xattr missing-backport origin:upstream 4 syz, C error 22 38d 891d 0/3 upstream: reported C repro on 2024/04/30 00:40
linux-6.1 possible deadlock in delete_one_xattr (2) origin:lts-only 4 syz, C error 33 12d 646d 0/3 upstream: reported C repro on 2024/12/31 02:53
upstream possible deadlock in delete_one_xattr (2) fs 4 syz, C done error 4 1036d 1316d 0/29 auto-obsoleted due to no activity on 2024/03/16 04:41
linux-6.1 possible deadlock in delete_one_xattr 4 15 748d 785d 0/3 auto-obsoleted due to no activity on 2024/11/28 23:18
upstream possible deadlock in delete_one_xattr fs 4 syz, C error 4 1338d 1338d 0/29 closed as invalid on 2023/02/08 16:28
linux-4.14 possible deadlock in delete_one_xattr reiserfs 4 1 1338d 1338d 0/1 upstream: reported on 2023/02/08 17:45

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.4.1018/9520 is trying to acquire lock:
ffff88805c18a410 (&type->i_mutex_dir_key#15/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline]
ffff88805c18a410 (&type->i_mutex_dir_key#15/2){+.+.}-{3:3}, at: xattr_rmdir fs/reiserfs/xattr.c:107 [inline]
ffff88805c18a410 (&type->i_mutex_dir_key#15/2){+.+.}-{3:3}, at: delete_one_xattr+0xfa/0x2d0 fs/reiserfs/xattr.c:339

but task is already holding lock:
ffff88805c189d70 (&type->i_mutex_dir_key#15/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline]
ffff88805c189d70 (&type->i_mutex_dir_key#15/3){+.+.}-{3:3}, at: reiserfs_for_each_xattr+0x89a/0xa30 fs/reiserfs/xattr.c:310

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&type->i_mutex_dir_key#15/3){+.+.}-{3:3}:
       down_write_nested+0x9e/0x200 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+0x146/0x6f0 fs/reiserfs/xattr.c:153
       xattr_lookup+0x22/0x2a0 fs/reiserfs/xattr.c:396
       reiserfs_xattr_set_handle+0x11a/0xd10 fs/reiserfs/xattr.c:535
       reiserfs_xattr_set+0x47b/0x5b0 fs/reiserfs/xattr.c:635
       __vfs_setxattr+0x437/0x470 fs/xattr.c:201
       __vfs_setxattr_noperm+0x12a/0x5e0 fs/xattr.c:235
       vfs_setxattr+0x16b/0x2f0 fs/xattr.c:322
       do_setxattr fs/xattr.c:630 [inline]
       path_setxattr+0x33a/0x590 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:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #1 (&sb->s_type->i_mutex_key#30){+.+.}-{3:3}:
       down_write+0x97/0x200 kernel/locking/rwsem.c:1573
       inode_lock include/linux/fs.h:804 [inline]
       vfs_rename+0x6f4/0xe60 fs/namei.c:-1
       do_renameat2+0x8b0/0xc80 fs/namei.c:5080
       __do_sys_renameat2 fs/namei.c:5113 [inline]
       __se_sys_renameat2 fs/namei.c:5110 [inline]
       __x64_sys_renameat2+0xd2/0xe0 fs/namei.c:5110
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&type->i_mutex_dir_key#15/2){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3162 [inline]
       check_prevs_add kernel/locking/lockdep.c:3281 [inline]
       validate_chain kernel/locking/lockdep.c:3897 [inline]
       __lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171
       lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790
       down_write_nested+0x9e/0x200 kernel/locking/rwsem.c:1689
       inode_lock_nested include/linux/fs.h:839 [inline]
       xattr_rmdir fs/reiserfs/xattr.c:107 [inline]
       delete_one_xattr+0xfa/0x2d0 fs/reiserfs/xattr.c:339
       reiserfs_for_each_xattr+0x8a6/0xa30 fs/reiserfs/xattr.c:312
       reiserfs_delete_xattrs+0x20/0x90 fs/reiserfs/xattr.c:365
       reiserfs_evict_inode+0x24a/0x4c0 fs/reiserfs/inode.c:53
       evict+0x4b7/0x8a0 fs/inode.c:705
       d_delete_notify include/linux/fsnotify.h:269 [inline]
       vfs_rmdir+0x378/0x4b0 fs/namei.c:4264
       do_rmdir+0x29f/0x590 fs/namei.c:4310
       __do_sys_unlinkat fs/namei.c:4488 [inline]
       __se_sys_unlinkat fs/namei.c:4482 [inline]
       __x64_sys_unlinkat+0xc4/0xe0 fs/namei.c:4482
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

Chain exists of:
  &type->i_mutex_dir_key#15/2 --> &sb->s_type->i_mutex_key#30 --> &type->i_mutex_dir_key#15/3

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&type->i_mutex_dir_key#15/3);
                               lock(&sb->s_type->i_mutex_key#30);
                               lock(&type->i_mutex_dir_key#15/3);
  lock(&type->i_mutex_dir_key#15/2);

 *** DEADLOCK ***

3 locks held by syz.4.1018/9520:
 #0: ffff888058c3c418 (sb_writers#24){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412
 #1: ffff88805e7fd910 (&type->i_mutex_dir_key#15/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline]
 #1: ffff88805e7fd910 (&type->i_mutex_dir_key#15/1){+.+.}-{3:3}, at: do_rmdir+0x1c6/0x590 fs/namei.c:4298
 #2: ffff88805c189d70 (&type->i_mutex_dir_key#15/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:839 [inline]
 #2: ffff88805c189d70 (&type->i_mutex_dir_key#15/3){+.+.}-{3:3}, at: reiserfs_for_each_xattr+0x89a/0xa30 fs/reiserfs/xattr.c:310

stack backtrace:
CPU: 1 PID: 9520 Comm: syz.4.1018 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2215
 check_prev_add kernel/locking/lockdep.c:3162 [inline]
 check_prevs_add kernel/locking/lockdep.c:3281 [inline]
 validate_chain kernel/locking/lockdep.c:3897 [inline]
 __lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171
 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790
 down_write_nested+0x9e/0x200 kernel/locking/rwsem.c:1689
 inode_lock_nested include/linux/fs.h:839 [inline]
 xattr_rmdir fs/reiserfs/xattr.c:107 [inline]
 delete_one_xattr+0xfa/0x2d0 fs/reiserfs/xattr.c:339
 reiserfs_for_each_xattr+0x8a6/0xa30 fs/reiserfs/xattr.c:312
 reiserfs_delete_xattrs+0x20/0x90 fs/reiserfs/xattr.c:365
 reiserfs_evict_inode+0x24a/0x4c0 fs/reiserfs/inode.c:53
 evict+0x4b7/0x8a0 fs/inode.c:705
 d_delete_notify include/linux/fsnotify.h:269 [inline]
 vfs_rmdir+0x378/0x4b0 fs/namei.c:4264
 do_rmdir+0x29f/0x590 fs/namei.c:4310
 __do_sys_unlinkat fs/namei.c:4488 [inline]
 __se_sys_unlinkat fs/namei.c:4482 [inline]
 __x64_sys_unlinkat+0xc4/0xe0 fs/namei.c:4482
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f549299e199
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f5490bf6028 EFLAGS: 00000246 ORIG_RAX: 0000000000000107
RAX: ffffffffffffffda RBX: 00007f5492c25fa0 RCX: 00007f549299e199
RDX: 0000000000000200 RSI: 00002000000001c0 RDI: ffffffffffffff9c
RBP: 00007f5492a35888 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5492c26038 R14: 00007f5492c25fa0 R15: 00007ffc272afeb8
 </TASK>

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/08 09:10 linux-6.6.y a91a6aa9253c 4f6a9fcf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in delete_one_xattr
2026/10/01 14:56 linux-6.6.y 79643295eba1 f5cdae2f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in delete_one_xattr
2026/10/01 14:56 linux-6.6.y 79643295eba1 f5cdae2f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in delete_one_xattr
2026/09/22 08:05 linux-6.6.y 79643295eba1 e12281bd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in delete_one_xattr
2026/09/22 08:05 linux-6.6.y 79643295eba1 e12281bd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in delete_one_xattr
* Struck through repros no longer work on HEAD.