syzbot


possible deadlock in do_journal_begin_r

Status: upstream: reported C repro on 2022/10/01 13:48
Reported-by: syzbot+5e385bfa7d505b075d9f@syzkaller.appspotmail.com
First crash: 66d, last: 11d

Cause bisection: failed (bisect log)
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 possible deadlock in do_journal_begin_r C 42 11d 66d 0/1 upstream: reported C repro on 2022/09/27 10:45
linux-4.14 possible deadlock in do_journal_begin_r C 43 11d 58d 0/1 upstream: reported C repro on 2022/10/05 14:07

Sample crash report:
REISERFS (device loop0): checking transaction log (loop0)
REISERFS (device loop0): Using rupasov hash to sort names
REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage.
======================================================
WARNING: possible circular locking dependency detected
6.1.0-rc5-syzkaller-00320-gb6e7fdfd6f6a #0 Not tainted
------------------------------------------------------
syz-executor927/3633 is trying to acquire lock:
ffffc90003d310f0 (&journal->j_mutex){+.+.}-{3:3}, at: reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:814 [inline]
ffffc90003d310f0 (&journal->j_mutex){+.+.}-{3:3}, at: lock_journal fs/reiserfs/journal.c:534 [inline]
ffffc90003d310f0 (&journal->j_mutex){+.+.}-{3:3}, at: do_journal_begin_r+0x293/0x10e0 fs/reiserfs/journal.c:3047

but task is already holding lock:
ffff88807cc30460 (sb_writers#9){.+.+}-{0:0}, at: reiserfs_ioctl+0x1a2/0x330 fs/reiserfs/ioctl.c:103

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (sb_writers#9){.+.+}-{0:0}:
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1826 [inline]
       sb_start_write include/linux/fs.h:1901 [inline]
       mnt_want_write_file+0x92/0x590 fs/namespace.c:437
       reiserfs_ioctl+0x1a2/0x330 fs/reiserfs/ioctl.c:103
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl fs/ioctl.c:856 [inline]
       __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #1 (&sbi->lock){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x12f/0x1360 kernel/locking/mutex.c:747
       reiserfs_write_lock_nested+0x69/0xe0 fs/reiserfs/lock.c:78
       reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:815 [inline]
       lock_journal fs/reiserfs/journal.c:534 [inline]
       do_journal_begin_r+0x29d/0x10e0 fs/reiserfs/journal.c:3047
       journal_begin+0x166/0x400 fs/reiserfs/journal.c:3255
       reiserfs_fill_super+0x1c2f/0x2e90 fs/reiserfs/super.c:2104
       mount_bdev+0x351/0x410 fs/super.c:1401
       legacy_get_tree+0x109/0x220 fs/fs_context.c:610
       vfs_get_tree+0x8d/0x2f0 fs/super.c:1531
       do_new_mount fs/namespace.c:3040 [inline]
       path_mount+0x132a/0x1e20 fs/namespace.c:3370
       do_mount fs/namespace.c:3383 [inline]
       __do_sys_mount fs/namespace.c:3591 [inline]
       __se_sys_mount fs/namespace.c:3568 [inline]
       __x64_sys_mount+0x283/0x300 fs/namespace.c:3568
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&journal->j_mutex){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3097 [inline]
       check_prevs_add kernel/locking/lockdep.c:3216 [inline]
       validate_chain kernel/locking/lockdep.c:3831 [inline]
       __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055
       lock_acquire kernel/locking/lockdep.c:5668 [inline]
       lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x12f/0x1360 kernel/locking/mutex.c:747
       reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:814 [inline]
       lock_journal fs/reiserfs/journal.c:534 [inline]
       do_journal_begin_r+0x293/0x10e0 fs/reiserfs/journal.c:3047
       journal_begin+0x166/0x400 fs/reiserfs/journal.c:3255
       reiserfs_dirty_inode+0x103/0x260 fs/reiserfs/super.c:710
       __mark_inode_dirty+0x247/0x11e0 fs/fs-writeback.c:2400
       mark_inode_dirty include/linux/fs.h:2467 [inline]
       reiserfs_ioctl+0x2ca/0x330 fs/reiserfs/ioctl.c:111
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl fs/ioctl.c:856 [inline]
       __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

Chain exists of:
  &journal->j_mutex --> &sbi->lock --> sb_writers#9

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sb_writers#9);
                               lock(&sbi->lock);
                               lock(sb_writers#9);
  lock(&journal->j_mutex);

 *** DEADLOCK ***

1 lock held by syz-executor927/3633:
 #0: ffff88807cc30460 (sb_writers#9){.+.+}-{0:0}, at: reiserfs_ioctl+0x1a2/0x330 fs/reiserfs/ioctl.c:103

stack backtrace:
CPU: 0 PID: 3633 Comm: syz-executor927 Not tainted 6.1.0-rc5-syzkaller-00320-gb6e7fdfd6f6a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106
 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2177
 check_prev_add kernel/locking/lockdep.c:3097 [inline]
 check_prevs_add kernel/locking/lockdep.c:3216 [inline]
 validate_chain kernel/locking/lockdep.c:3831 [inline]
 __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055
 lock_acquire kernel/locking/lockdep.c:5668 [inline]
 lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x12f/0x1360 kernel/locking/mutex.c:747
 reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:814 [inline]
 lock_journal fs/reiserfs/journal.c:534 [inline]
 do_journal_begin_r+0x293/0x10e0 fs/reiserfs/journal.c:3047
 journal_begin+0x166/0x400 fs/reiserfs/journal.c:3255
 reiserfs_dirty_inode+0x103/0x260 fs/reiserfs/super.c:710
 __mark_inode_dirty+0x247/0x11e0 fs/fs-writeback.c:2400
 mark_inode_dirty include/linux/fs.h:2467 [inline]
 reiserfs_ioctl+0x2ca/0x330 fs/reiserfs/ioctl.c:111
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fbd8dd138f9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd0ab48018 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fbd8dd138f9
RDX: 0000000020000080 RSI: 0000000040087602 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffd0ab48040
R13: 0000000000000000 R14: 431bde82d7b634db R15: 0000000000000000
 </TASK>

Crashes (201):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2022/11/20 16:51 upstream b6e7fdfd6f6a 5bb70014 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/20 16:07 upstream 77c51ba552a1 5bb70014 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/20 15:52 upstream 77c51ba552a1 5bb70014 .config log report syz C possible deadlock in do_journal_begin_r
ci-upstream-kasan-gce-root 2022/11/20 13:36 upstream b6e7fdfd6f6a 5bb70014 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/20 07:44 upstream fe24a97cf254 5bb70014 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/19 16:45 upstream ab290eaddc4c 5bb70014 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/19 13:58 upstream ab290eaddc4c 5bb70014 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/19 12:58 upstream ab290eaddc4c 5bb70014 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/18 09:44 upstream 84368d882b96 5bb70014 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/17 21:34 upstream 81ac25651a62 4ba8ab94 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/17 06:24 upstream 59d0d52c30d4 3a127a31 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/17 02:50 upstream 59d0d52c30d4 3a127a31 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/16 15:59 upstream 81e7cfa3a9eb 3a127a31 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/16 03:04 upstream 81e7cfa3a9eb 3a127a31 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/16 00:23 upstream 81e7cfa3a9eb 3a127a31 .config log report syz C possible deadlock in do_journal_begin_r
ci-upstream-kasan-gce-root 2022/11/15 20:51 upstream e01d50cbd6ee 97de9cfc .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/14 10:56 upstream 094226ad94f4 943f4cb8 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/14 09:47 upstream 094226ad94f4 7ba4d859 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/14 06:51 upstream af7a05689189 7ba4d859 .config log report syz C possible deadlock in do_journal_begin_r
ci-upstream-kasan-gce-root 2022/11/14 06:35 upstream af7a05689189 3ead01ad .config log report syz C possible deadlock in do_journal_begin_r
ci-upstream-kasan-gce-root 2022/11/14 05:40 upstream af7a05689189 3ead01ad .config log report syz C possible deadlock in do_journal_begin_r
ci-upstream-kasan-gce-root 2022/11/14 01:26 upstream af7a05689189 3ead01ad .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/13 21:46 upstream af7a05689189 7ba4d859 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/13 17:44 upstream af7a05689189 7ba4d859 .config log report syz C possible deadlock in do_journal_begin_r
ci-upstream-kasan-gce-root 2022/11/13 16:27 upstream fef7fd48922d 3ead01ad .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/12 23:39 upstream 8f2975c2bb4c f42ee5d8 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/12 10:06 upstream 8f2975c2bb4c f42ee5d8 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/11 19:59 upstream eb037f16f7e8 f42ee5d8 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/11 18:07 upstream 4bbf3422df78 f42ee5d8 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/11 12:28 upstream 4bbf3422df78 f42ee5d8 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/11 11:59 upstream 4bbf3422df78 f42ee5d8 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/11 07:41 upstream 4bbf3422df78 f42ee5d8 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/10 10:19 upstream f67dd6ce0723 b2488a87 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/10 08:05 upstream f67dd6ce0723 b2488a87 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/08 13:21 upstream 59f2f4b8a757 060f945e .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/06 22:58 upstream 089d1c31224e 6d752409 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/06 06:32 upstream b208b9fbbcba 6d752409 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/05 08:05 upstream 64c3dd0b98f5 6d752409 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/05 06:52 upstream 64c3dd0b98f5 6d752409 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/10/05 11:05 upstream 0326074ff465 267e3bb1 .config log report syz C possible deadlock in do_journal_begin_r
ci-upstream-linux-next-kasan-gce-root 2022/11/07 08:27 linux-next 0cdb3579f1ee 6d752409 .config log report syz C possible deadlock in do_journal_begin_r
ci-upstream-linux-next-kasan-gce-root 2022/11/07 01:22 linux-next 0cdb3579f1ee 6d752409 .config log report syz C possible deadlock in do_journal_begin_r
ci-upstream-linux-next-kasan-gce-root 2022/11/06 17:20 linux-next 0cdb3579f1ee 6d752409 .config log report syz C possible deadlock in do_journal_begin_r
ci-upstream-gce-arm64 2022/09/27 17:23 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c194837ebb57 87840e00 .config log report syz C possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/21 11:26 upstream eb7081409f94 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/21 06:28 upstream eb7081409f94 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/20 22:45 upstream 77c51ba552a1 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/20 13:17 upstream fe24a97cf254 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/20 03:38 upstream fe24a97cf254 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/19 23:44 upstream fe24a97cf254 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/19 17:52 upstream ab290eaddc4c 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/19 09:51 upstream ab290eaddc4c 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/19 08:30 upstream ab290eaddc4c 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/19 07:20 upstream ab290eaddc4c 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/19 01:01 upstream ab290eaddc4c 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/18 21:17 upstream ab290eaddc4c 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/18 18:18 upstream 84368d882b96 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/18 16:39 upstream 84368d882b96 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/18 12:03 upstream 84368d882b96 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/18 07:59 upstream 84368d882b96 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/18 04:22 upstream 84368d882b96 5bb70014 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/18 01:24 upstream 81ac25651a62 4ba8ab94 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/18 00:15 upstream 81ac25651a62 4ba8ab94 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/17 14:42 upstream cc675d22e422 3a127a31 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/17 12:17 upstream cc675d22e422 3a127a31 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/17 08:38 upstream cc675d22e422 3a127a31 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/17 04:09 upstream 59d0d52c30d4 3a127a31 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/16 21:38 upstream 59d0d52c30d4 3a127a31 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/16 20:28 upstream 59d0d52c30d4 3a127a31 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/16 17:45 upstream 59d0d52c30d4 3a127a31 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/16 12:40 upstream 81e7cfa3a9eb 3a127a31 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/16 10:56 upstream 81e7cfa3a9eb 3a127a31 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/16 09:30 upstream 81e7cfa3a9eb 3a127a31 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/15 22:57 upstream 81e7cfa3a9eb 3a127a31 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/15 20:39 upstream e01d50cbd6ee 97de9cfc .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/15 17:02 upstream e01d50cbd6ee 97de9cfc .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/15 00:09 upstream e01d50cbd6ee 97de9cfc .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/14 18:39 upstream 094226ad94f4 943f4cb8 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/14 17:09 upstream 094226ad94f4 943f4cb8 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/14 13:15 upstream 094226ad94f4 943f4cb8 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/14 03:48 upstream af7a05689189 7ba4d859 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/14 00:44 upstream af7a05689189 7ba4d859 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/13 23:02 upstream af7a05689189 7ba4d859 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/12 19:42 upstream 8f2975c2bb4c f42ee5d8 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/12 15:52 upstream 8f2975c2bb4c f42ee5d8 .config log report info possible deadlock in do_journal_begin_r
ci2-upstream-fs 2022/11/12 13:16 upstream 8f2975c2bb4c f42ee5d8 .config log report info possible deadlock in do_journal_begin_r
* Struck through repros no longer work on HEAD.