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: 264d, last: 7h00m
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 607d 621d 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 283 7h32m 266d 0/3 upstream: reported C repro on 2024/03/31 06:40
upstream possible deadlock in open_xa_dir reiserfs C done done 7667 326d 722d 0/28 auto-obsoleted due to no activity on 2024/04/09 20:57
linux-6.1 possible deadlock in open_xa_dir 3 615d 624d 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 718d 724d 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 (351):
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/12/14 22:51 linux-5.15.y 963e654022cc 7cbfbb3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/12/13 22:57 linux-5.15.y 0a51d2d4527b 7cbfbb3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/12/13 11:59 linux-5.15.y 0a51d2d4527b 3547e30f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/12/13 09:54 linux-5.15.y 0a51d2d4527b 3547e30f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/12/12 17:26 linux-5.15.y 0a51d2d4527b 530e80f8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/12/11 14:55 linux-5.15.y 0a51d2d4527b ff949d25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/12/08 22:54 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/12/08 18:32 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/12/08 13:49 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/12/07 20:08 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in open_xa_dir
2024/12/06 09:30 linux-5.15.y 0a51d2d4527b 946d28f0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan 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/12/22 13:44 linux-5.15.y 91786f140358 b4fbdbd4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/12/12 05:12 linux-5.15.y 0a51d2d4527b 6f1b0fa8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/12/12 05:10 linux-5.15.y 0a51d2d4527b 6f1b0fa8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/12/11 17:25 linux-5.15.y 0a51d2d4527b ff949d25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/12/10 04:08 linux-5.15.y 0a51d2d4527b cfc402b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/12/09 19:15 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/12/07 13:41 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/12/05 18:37 linux-5.15.y 0a51d2d4527b 29f61fce .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/12/05 12:44 linux-5.15.y 0a51d2d4527b 29f61fce .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/12/04 12:57 linux-5.15.y 0a51d2d4527b b50eb251 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/12/03 10:45 linux-5.15.y 0a51d2d4527b 578925bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/12/03 00:22 linux-5.15.y 0a51d2d4527b b499ea68 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in open_xa_dir
2024/11/30 20:20 linux-5.15.y 0a51d2d4527b 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 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/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.