syzbot


possible deadlock in open_xa_dir (2)

Status: upstream: reported C repro on 2024/04/02 08:22
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+8279888d43f15e7aba7e@syzkaller.appspotmail.com
First crash: 194d, last: 1d15h
Bug presence (1)
Date Name Commit Repro Result
2024/04/02 upstream (ToT) 026e680b0a08 C [report] possible deadlock in open_xa_dir
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in open_xa_dir 4 536d 551d 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 C 138 1d14h 196d 0/3 upstream: reported C repro on 2024/03/31 06:40
upstream possible deadlock in open_xa_dir reiserfs C done done 7667 256d 652d 0/28 auto-obsoleted due to no activity on 2024/04/09 20:57
linux-6.1 possible deadlock in open_xa_dir 3 544d 554d 0/3 auto-obsoleted due to no activity on 2023/08/15 19:04
linux-4.19 possible deadlock in open_xa_dir reiserfs C error 3 648d 654d 0/1 upstream: reported C repro on 2022/12/29 15:01

Sample crash report:
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
5.15.153-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor297/3964 is trying to acquire lock:
ffff0000df0a8980 (&type->i_mutex_dir_key#6/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:824 [inline]
ffff0000df0a8980 (&type->i_mutex_dir_key#6/3){+.+.}-{3:3}, at: open_xa_root fs/reiserfs/xattr.c:127 [inline]
ffff0000df0a8980 (&type->i_mutex_dir_key#6/3){+.+.}-{3:3}, at: open_xa_dir+0x11c/0x578 fs/reiserfs/xattr.c:152

but task is already holding lock:
ffff0000d844f090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock_nested+0x68/0xd8 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+0x194/0x2154 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0xa4/0xf8 kernel/locking/mutex.c:743
       reiserfs_write_lock+0x7c/0xe8 fs/reiserfs/lock.c:27
       reiserfs_mkdir+0x280/0x77c 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+0x288/0x578 fs/reiserfs/xattr.c:152
       xattr_lookup+0x3c/0x268 fs/reiserfs/xattr.c:395
       reiserfs_xattr_set_handle+0xe4/0xc10 fs/reiserfs/xattr.c:540
       __reiserfs_set_acl+0x434/0x5b8 fs/reiserfs/xattr_acl.c:276
       reiserfs_set_acl+0x428/0x60c fs/reiserfs/xattr_acl.c:50
       set_posix_acl fs/posix_acl.c:947 [inline]
       posix_acl_xattr_set+0x2cc/0x378 fs/posix_acl.c:966
       __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:303
       do_setxattr fs/xattr.c:588 [inline]
       setxattr+0x250/0x2b4 fs/xattr.c:611
       __do_sys_fsetxattr fs/xattr.c:667 [inline]
       __se_sys_fsetxattr fs/xattr.c:656 [inline]
       __arm64_sys_fsetxattr+0x1a8/0x224 fs/xattr.c:656
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
       el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #0 (&type->i_mutex_dir_key#6/3){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain kernel/locking/lockdep.c:3788 [inline]
       __lock_acquire+0x32d4/0x7638 kernel/locking/lockdep.c:5012
       lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623
       down_write_nested+0x118/0x26c kernel/locking/rwsem.c:1657
       inode_lock_nested include/linux/fs.h:824 [inline]
       open_xa_root fs/reiserfs/xattr.c:127 [inline]
       open_xa_dir+0x11c/0x578 fs/reiserfs/xattr.c:152
       reiserfs_for_each_xattr+0x16c/0x8d8 fs/reiserfs/xattr.c:252
       reiserfs_delete_xattrs+0x2c/0xa4 fs/reiserfs/xattr.c:364
       reiserfs_evict_inode+0x1dc/0x3f0 fs/reiserfs/inode.c:53
       evict+0x260/0x68c fs/inode.c:587
       iput_final fs/inode.c:1705 [inline]
       iput+0x744/0x824 fs/inode.c:1731
       reiserfs_new_inode+0xc24/0x1724 fs/reiserfs/inode.c:2164
       reiserfs_mkdir+0x4ac/0x77c fs/reiserfs/namei.c:845
       vfs_mkdir+0x350/0x514 fs/namei.c:4065
       do_mkdirat+0x20c/0x610 fs/namei.c:4090
       __do_sys_mkdirat fs/namei.c:4105 [inline]
       __se_sys_mkdirat fs/namei.c:4103 [inline]
       __arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4103
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
       el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

other info that might help us debug this:

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

3 locks held by syz-executor297/3964:
 #0: ffff0000c90a0460 (sb_writers#8){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:377
 #1: ffff0000df0a82e0 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:824 [inline]
 #1: ffff0000df0a82e0 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: filename_create+0x204/0x468 fs/namei.c:3835
 #2: ffff0000d844f090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock_nested+0x68/0xd8 fs/reiserfs/lock.c:78

stack backtrace:
CPU: 0 PID: 3964 Comm: syz-executor297 Not tainted 5.15.153-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 dump_stack+0x1c/0x58 lib/dump_stack.c:113
 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2011
 check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain kernel/locking/lockdep.c:3788 [inline]
 __lock_acquire+0x32d4/0x7638 kernel/locking/lockdep.c:5012
 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623
 down_write_nested+0x118/0x26c kernel/locking/rwsem.c:1657
 inode_lock_nested include/linux/fs.h:824 [inline]
 open_xa_root fs/reiserfs/xattr.c:127 [inline]
 open_xa_dir+0x11c/0x578 fs/reiserfs/xattr.c:152
 reiserfs_for_each_xattr+0x16c/0x8d8 fs/reiserfs/xattr.c:252
 reiserfs_delete_xattrs+0x2c/0xa4 fs/reiserfs/xattr.c:364
 reiserfs_evict_inode+0x1dc/0x3f0 fs/reiserfs/inode.c:53
 evict+0x260/0x68c fs/inode.c:587
 iput_final fs/inode.c:1705 [inline]
 iput+0x744/0x824 fs/inode.c:1731
 reiserfs_new_inode+0xc24/0x1724 fs/reiserfs/inode.c:2164
 reiserfs_mkdir+0x4ac/0x77c fs/reiserfs/namei.c:845
 vfs_mkdir+0x350/0x514 fs/namei.c:4065
 do_mkdirat+0x20c/0x610 fs/namei.c:4090
 __do_sys_mkdirat fs/namei.c:4105 [inline]
 __se_sys_mkdirat fs/namei.c:4103 [inline]
 __arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4103
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Crashes (224):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/02 08:56 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/11 07:03 linux-5.15.y 3a5928702e71 cd942402 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/09 21:24 linux-5.15.y 3a5928702e71 56fb2cb7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/09 10:13 linux-5.15.y 3a5928702e71 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/01 13:54 linux-5.15.y 3a5928702e71 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/01 13:52 linux-5.15.y 3a5928702e71 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/09/30 09:32 linux-5.15.y 3a5928702e71 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/09/29 16:47 linux-5.15.y 3a5928702e71 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/09/24 17:25 linux-5.15.y 3a5928702e71 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/09/16 18:28 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/09/14 11:55 linux-5.15.y 3a5928702e71 c7e35043 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/09/10 03:39 linux-5.15.y 14e468424d3e 784df80e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/09/05 11:00 linux-5.15.y 14e468424d3e 464ac2ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/09/05 11:00 linux-5.15.y 14e468424d3e 464ac2ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/09/04 21:11 linux-5.15.y 14e468424d3e dfbe2ed4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/09/04 07:39 linux-5.15.y fa93fa65db6e 9d47f20a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/09/03 00:00 linux-5.15.y fa93fa65db6e 8045124c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/11 23:26 linux-5.15.y 3a5928702e71 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/11 10:06 linux-5.15.y 3a5928702e71 cd942402 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/11 08:24 linux-5.15.y 3a5928702e71 cd942402 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/10 19:23 linux-5.15.y 3a5928702e71 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/10 06:49 linux-5.15.y 3a5928702e71 0278d004 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/09 16:03 linux-5.15.y 3a5928702e71 56fb2cb7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/08 00:32 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/07 16:32 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/05 19:35 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/02 13:36 linux-5.15.y 3a5928702e71 02f9582a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/30 03:47 linux-5.15.y 3a5928702e71 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/26 21:40 linux-5.15.y 3a5928702e71 9314348a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/25 10:19 linux-5.15.y 3a5928702e71 349a68c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/24 00:27 linux-5.15.y 3a5928702e71 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/21 23:45 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/20 00:11 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/19 21:38 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/19 21:37 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/19 17:12 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/19 03:12 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/16 19:58 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/16 17:11 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/15 03:41 linux-5.15.y 3a5928702e71 08d8a733 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/13 03:42 linux-5.15.y 3a5928702e71 73e8a465 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/11 21:38 linux-5.15.y 14e468424d3e d94c83d8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/11 06:03 linux-5.15.y 14e468424d3e 8ab55d0e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/07 05:22 linux-5.15.y 14e468424d3e 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/09/02 05:34 linux-5.15.y fa93fa65db6e 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/04/02 08:21 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
* Struck through repros no longer work on HEAD.