syzbot


possible deadlock in delete_one_xattr

Status: closed as invalid on 2023/02/08 16:28
Subsystems: reiserfs
[Documentation on labels]
First crash: 441d, last: 440d
Cause bisection: failed (error log, bisect log)
  
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 possible deadlock in delete_one_xattr reiserfs 2 440d 501d 0/1 upstream: reported on 2022/12/10 02:38
upstream possible deadlock in delete_one_xattr (2) reiserfs C done error 4 138d 418d 0/26 auto-obsoleted due to no activity on 2024/03/16 04:41
linux-4.14 possible deadlock in delete_one_xattr reiserfs 1 440d 440d 0/1 upstream: reported on 2023/02/08 17:45

Sample crash report:
overlayfs: upper fs needs to support d_type.
overlayfs: upper fs does not support tmpfile.
overlayfs: upper fs does not support RENAME_WHITEOUT.
======================================================
WARNING: possible circular locking dependency detected
6.2.0-rc7-syzkaller-00013-g513c1a3d3f19 #0 Not tainted
------------------------------------------------------
syz-executor421/5078 is trying to acquire lock:
ffff888072c7b7e0 (&type->i_mutex_dir_key#6/2){+.+.}-{3:3}, at: delete_one_xattr+0x106/0x2f0

but task is already holding lock:
ffff888072c7a400 (&type->i_mutex_dir_key#6/3){+.+.}-{3:3}, at: reiserfs_for_each_xattr+0x9a2/0xb50

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&type->i_mutex_dir_key#6/3){+.+.}-{3:3}:
       lock_acquire+0x20b/0x600
       down_write_nested+0x3d/0x60
       open_xa_dir+0x122/0x650
       xattr_lookup+0x24/0x280
       reiserfs_xattr_set_handle+0xfd/0xdc0
       reiserfs_xattr_set+0x428/0x550
       __vfs_setxattr+0x460/0x4a0
       __vfs_setxattr_noperm+0x12e/0x5e0
       vfs_setxattr+0x221/0x420
       ovl_get_workdir+0xcf6/0x16c0
       ovl_fill_super+0x1b8a/0x29c0
       mount_nodev+0x56/0xe0
       legacy_get_tree+0xef/0x190
       vfs_get_tree+0x8c/0x270
       do_new_mount+0x28f/0xae0
       __se_sys_mount+0x2c9/0x3b0
       do_syscall_64+0x41/0xc0
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #1 (&type->i_mutex_dir_key#6){++++}-{3:3}:
       lock_acquire+0x20b/0x600
       down_write+0x3a/0x60
       vfs_rename+0x797/0x1190
       do_renameat2+0xa70/0x1250
       __x64_sys_rename+0x86/0x90
       do_syscall_64+0x41/0xc0
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&type->i_mutex_dir_key#6/2){+.+.}-{3:3}:
       validate_chain+0x166b/0x5860
       __lock_acquire+0x125b/0x1f80
       lock_acquire+0x20b/0x600
       down_write_nested+0x3d/0x60
       delete_one_xattr+0x106/0x2f0
       reiserfs_for_each_xattr+0x9b0/0xb50
       reiserfs_delete_xattrs+0x1f/0x90
       reiserfs_evict_inode+0x207/0x470
       evict+0x2a4/0x620
       __dentry_kill+0x436/0x650
       dentry_kill+0xbb/0x290
       dput+0x1d8/0x3f0
       cleanup_mnt+0x469/0x520
       task_work_run+0x24a/0x300
       do_exit+0x605/0x2210
       do_group_exit+0x206/0x2c0
       __x64_sys_exit_group+0x3f/0x40
       do_syscall_64+0x41/0xc0
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

Chain exists of:
  &type->i_mutex_dir_key#6/2 --> &type->i_mutex_dir_key#6 --> &type->i_mutex_dir_key#6/3

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

1 lock held by syz-executor421/5078:
 #0: ffff888072c7a400 (&type->i_mutex_dir_key#6/3){+.+.}-{3:3}, at: reiserfs_for_each_xattr+0x9a2/0xb50

stack backtrace:
CPU: 0 PID: 5078 Comm: syz-executor421 Not tainted 6.2.0-rc7-syzkaller-00013-g513c1a3d3f19 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
Call Trace:
 <TASK>
 dump_stack_lvl+0x1b5/0x2a0
 check_noncircular+0x2d1/0x390
 validate_chain+0x166b/0x5860
 __lock_acquire+0x125b/0x1f80
 lock_acquire+0x20b/0x600
 down_write_nested+0x3d/0x60
 delete_one_xattr+0x106/0x2f0
 reiserfs_for_each_xattr+0x9b0/0xb50
 reiserfs_delete_xattrs+0x1f/0x90
 reiserfs_evict_inode+0x207/0x470
 evict+0x2a4/0x620
 __dentry_kill+0x436/0x650
 dentry_kill+0xbb/0x290
 dput+0x1d8/0x3f0
 cleanup_mnt+0x469/0x520
 task_work_run+0x24a/0x300
 do_exit+0x605/0x2210
 do_group_exit+0x206/0x2c0
 __x64_sys_exit_group+0x3f/0x40
 do_syscall_64+0x41/0xc0
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fc0d1cccbb9
Code: Unable to access opcode bytes at 0x7fc0d1cccb8f.
RSP: 002b:00007ffc7f488aa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007fc0d1d43330 RCX: 00007fc0d1cccbb9
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001
RBP: 0000000000000001 R08: ffffffffffffffc0 R09: 00007fc0d1d3de40
R10: 00007fc0d1d3de40 R11: 0000000000000246 R12: 00007fc0d1d43330
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001
 

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/02/08 03:45 upstream 513c1a3d3f19 15c3d445 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs possible deadlock in delete_one_xattr
2023/02/08 13:10 upstream 0983f6bf2bfc abbb67b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in delete_one_xattr
2023/02/08 12:51 upstream 0983f6bf2bfc abbb67b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in delete_one_xattr
2023/02/08 09:41 upstream 0983f6bf2bfc 15c3d445 .config console log report info ci-upstream-kasan-gce-root possible deadlock in delete_one_xattr
* Struck through repros no longer work on HEAD.