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: 236d, last: 8h41m
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 578d 593d 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 208 3d06h 238d 0/3 upstream: reported C repro on 2024/03/31 06:40
upstream possible deadlock in open_xa_dir reiserfs C done done 7667 298d 694d 0/28 auto-obsoleted due to no activity on 2024/04/09 20:57
linux-6.1 possible deadlock in open_xa_dir 3 586d 596d 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 690d 695d 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 (309):
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/11/14 22:19 linux-5.15.y d98fd109f827 a8c99394 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/11/11 23:06 linux-5.15.y 3c17fc483905 0c4b1325 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/11/09 01:25 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/11/08 21:55 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/11/08 07:01 linux-5.15.y 72244eab0dad 179b040e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/11/06 19:42 linux-5.15.y 72244eab0dad df3dc63b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/11/06 19:36 linux-5.15.y 72244eab0dad df3dc63b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/11/06 05:22 linux-5.15.y 72244eab0dad 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/11/05 15:22 linux-5.15.y 72244eab0dad da38b4c9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/11/04 21:10 linux-5.15.y 72244eab0dad 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/30 20:50 linux-5.15.y 74cdd62cb470 fb888278 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/30 20:50 linux-5.15.y 74cdd62cb470 fb888278 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/29 18:11 linux-5.15.y 74cdd62cb470 66aeb999 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/29 07:32 linux-5.15.y 74cdd62cb470 66aeb999 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/25 08:23 linux-5.15.y 74cdd62cb470 c79b8ca5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/25 03:00 linux-5.15.y 74cdd62cb470 c79b8ca5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/24 13:12 linux-5.15.y 74cdd62cb470 0d144d1a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/22 17:43 linux-5.15.y 74cdd62cb470 a93682b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/22 12:01 linux-5.15.y 584a40a22cb9 a93682b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/10/18 23:03 linux-5.15.y 584a40a22cb9 cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/11/24 01:37 linux-5.15.y 0a51d2d4527b 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/23 03:18 linux-5.15.y 0a51d2d4527b 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/22 09:35 linux-5.15.y 0a51d2d4527b 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/22 04:41 linux-5.15.y 0a51d2d4527b 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/19 04:22 linux-5.15.y 0a51d2d4527b 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/18 05:21 linux-5.15.y 0a51d2d4527b cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/18 03:12 linux-5.15.y 0a51d2d4527b cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/16 19:16 linux-5.15.y d98fd109f827 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/15 09:38 linux-5.15.y d98fd109f827 f6ede3a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/14 11:51 linux-5.15.y 3c17fc483905 a8c99394 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/13 00:19 linux-5.15.y 3c17fc483905 62026c85 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/11 21:58 linux-5.15.y 3c17fc483905 0c4b1325 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/11 02:31 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/10 20:04 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/09 09:55 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/04 14:38 linux-5.15.y 72244eab0dad f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/03 00:11 linux-5.15.y 72244eab0dad f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/01 20:27 linux-5.15.y 72244eab0dad f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/01 04:52 linux-5.15.y 72244eab0dad 96eb609f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/29 01:46 linux-5.15.y 74cdd62cb470 9efb3cc7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/21 14:52 linux-5.15.y 584a40a22cb9 f1e4447c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/21 14:50 linux-5.15.y 584a40a22cb9 f1e4447c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/20 22:09 linux-5.15.y 584a40a22cb9 cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/19 23:08 linux-5.15.y 584a40a22cb9 cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/17 21:52 linux-5.15.y 584a40a22cb9 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/17 16:52 linux-5.15.y 584a40a22cb9 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/16 20:29 linux-5.15.y 3a5928702e71 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/16 00:33 linux-5.15.y 3a5928702e71 bde2d81c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/15 17:04 linux-5.15.y 3a5928702e71 7eb57b4a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/10/15 12:28 linux-5.15.y 3a5928702e71 7eb57b4a .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.