syzbot


possible deadlock in do_journal_begin_r

Status: upstream: reported C repro on 2022/10/05 14:07
Subsystems: reiserfs
[Documentation on labels]
Reported-by: syzbot+7cf0f1c43fd83b12a4b4@syzkaller.appspotmail.com
First crash: 358d, last: 209d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 possible deadlock in do_journal_begin_r reiserfs C error 45 281d 366d 0/1 upstream: reported C repro on 2022/09/27 10:45
upstream possible deadlock in do_journal_begin_r reiserfs C error 218 38d 362d 0/25 upstream: reported C repro on 2022/10/01 13:48
linux-6.1 possible deadlock in do_journal_begin_r origin:upstream C 1 26d 95d 0/3 upstream: reported C repro on 2023/06/25 10:36
linux-5.15 possible deadlock in do_journal_begin_r origin:upstream C 1 51d 102d 0/3 upstream: reported C repro on 2023/06/19 07:49
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/03/04 06:16 24m bisect fix linux-4.14.y job log (0) log
2023/02/02 02:53 25m bisect fix linux-4.14.y job log (0) log

Sample crash report:
REISERFS (device loop0): journal params: device loop0, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
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
4.14.299-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor382/7960 is trying to acquire lock:
 (&journal->j_mutex){+.+.}, at: [<ffffffff81b33e3b>] reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:816 [inline]
 (&journal->j_mutex){+.+.}, at: [<ffffffff81b33e3b>] lock_journal fs/reiserfs/journal.c:537 [inline]
 (&journal->j_mutex){+.+.}, at: [<ffffffff81b33e3b>] do_journal_begin_r+0x26b/0xde0 fs/reiserfs/journal.c:3054

but task is already holding lock:
 (sb_writers#10){.+.+}, at: [<ffffffff818e1d3d>] sb_start_write include/linux/fs.h:1551 [inline]
 (sb_writers#10){.+.+}, at: [<ffffffff818e1d3d>] mnt_want_write_file+0xfd/0x3b0 fs/namespace.c:497

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (sb_writers#10){.+.+}:
       percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline]
       percpu_down_read include/linux/percpu-rwsem.h:59 [inline]
       __sb_start_write+0x64/0x260 fs/super.c:1342
       sb_start_write include/linux/fs.h:1551 [inline]
       mnt_want_write_file+0xfd/0x3b0 fs/namespace.c:497
       reiserfs_ioctl+0x18e/0x8b0 fs/reiserfs/ioctl.c:110
       vfs_ioctl fs/ioctl.c:46 [inline]
       file_ioctl fs/ioctl.c:500 [inline]
       do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
       SYSC_ioctl fs/ioctl.c:701 [inline]
       SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x5e/0xd3

-> #1 (&sbi->lock){+.+.}:
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
       reiserfs_write_lock_nested+0x59/0xd0 fs/reiserfs/lock.c:78
       reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:817 [inline]
       lock_journal fs/reiserfs/journal.c:537 [inline]
       do_journal_begin_r+0x276/0xde0 fs/reiserfs/journal.c:3054
       journal_begin+0x162/0x3d0 fs/reiserfs/journal.c:3262
       reiserfs_fill_super+0x18f4/0x2990 fs/reiserfs/super.c:2117
       mount_bdev+0x2b3/0x360 fs/super.c:1134
       mount_fs+0x92/0x2a0 fs/super.c:1237
       vfs_kern_mount.part.0+0x5b/0x470 fs/namespace.c:1046
       vfs_kern_mount fs/namespace.c:1036 [inline]
       do_new_mount fs/namespace.c:2572 [inline]
       do_mount+0xe65/0x2a30 fs/namespace.c:2905
       SYSC_mount fs/namespace.c:3121 [inline]
       SyS_mount+0xa8/0x120 fs/namespace.c:3098
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x5e/0xd3

-> #0 (&journal->j_mutex){+.+.}:
       lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
       reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:816 [inline]
       lock_journal fs/reiserfs/journal.c:537 [inline]
       do_journal_begin_r+0x26b/0xde0 fs/reiserfs/journal.c:3054
       journal_begin+0x162/0x3d0 fs/reiserfs/journal.c:3262
       reiserfs_dirty_inode+0xd9/0x200 fs/reiserfs/super.c:716
       __mark_inode_dirty+0x11e/0xf40 fs/fs-writeback.c:2134
       mark_inode_dirty include/linux/fs.h:2026 [inline]
       reiserfs_ioctl+0x6f6/0x8b0 fs/reiserfs/ioctl.c:118
       vfs_ioctl fs/ioctl.c:46 [inline]
       file_ioctl fs/ioctl.c:500 [inline]
       do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
       SYSC_ioctl fs/ioctl.c:701 [inline]
       SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x5e/0xd3

other info that might help us debug this:

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

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

1 lock held by syz-executor382/7960:
 #0:  (sb_writers#10){.+.+}, at: [<ffffffff818e1d3d>] sb_start_write include/linux/fs.h:1551 [inline]
 #0:  (sb_writers#10){.+.+}, at: [<ffffffff818e1d3d>] mnt_want_write_file+0xfd/0x3b0 fs/namespace.c:497

stack backtrace:
CPU: 1 PID: 7960 Comm: syz-executor382 Not tainted 4.14.299-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258
 check_prev_add kernel/locking/lockdep.c:1905 [inline]
 check_prevs_add kernel/locking/lockdep.c:2022 [inline]
 validate_chain kernel/locking/lockdep.c:2464 [inline]
 __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491
 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
 __mutex_lock_common kernel/locking/mutex.c:756 [inline]
 __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
 reiserfs_mutex_lock_safe fs/reiserfs/reiserfs.h:816 [inline]
 lock_journal fs/reiserfs/journal.c:537 [inline]
 do_journal_begin_r+0x26b/0xde0 fs/reiserfs/journal.c:3054
 journal_begin+0x162/0x3d0 fs/reiserfs/journal.c:3262
 reiserfs_dirty_inode+0xd9/0x200 fs/reiserfs/super.c:716
 __mark_inode_dirty+0x11e/0xf40 fs/fs-writeback.c:2134
 mark_inode_dirty include/linux/fs.h:2026 [inline]
 reiserfs_ioctl+0x6f6/0x8b0 fs/reiserfs/ioctl.c:118
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684

Crashes (55):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/11/21 14:00 linux-4.14.y e911713e40ca 5bb70014 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/19 13:45 linux-4.14.y e911713e40ca 5bb70014 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/18 13:48 linux-4.14.y e911713e40ca 5bb70014 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/17 06:53 linux-4.14.y e911713e40ca 3a127a31 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/16 15:01 linux-4.14.y e911713e40ca 3a127a31 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/16 13:51 linux-4.14.y e911713e40ca 3a127a31 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/15 09:13 linux-4.14.y e911713e40ca 97de9cfc .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/15 08:56 linux-4.14.y e911713e40ca 97de9cfc .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/14 10:02 linux-4.14.y e911713e40ca 7ba4d859 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/14 09:26 linux-4.14.y e911713e40ca 7ba4d859 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/12 22:16 linux-4.14.y e911713e40ca f42ee5d8 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/12 14:13 linux-4.14.y e911713e40ca f42ee5d8 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/12 11:41 linux-4.14.y e911713e40ca f42ee5d8 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/12 11:11 linux-4.14.y e911713e40ca f42ee5d8 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/12 09:29 linux-4.14.y e911713e40ca f42ee5d8 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/12 02:15 linux-4.14.y e911713e40ca f42ee5d8 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/12 00:26 linux-4.14.y e911713e40ca f42ee5d8 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/11 12:41 linux-4.14.y e911713e40ca f42ee5d8 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/10 10:21 linux-4.14.y a901bb6c7db7 b2488a87 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/09 12:23 linux-4.14.y a901bb6c7db7 5fa28208 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/08 21:33 linux-4.14.y a901bb6c7db7 060f945e .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/07 10:37 linux-4.14.y a901bb6c7db7 6d752409 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/07 09:48 linux-4.14.y a901bb6c7db7 6d752409 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/05 15:34 linux-4.14.y a901bb6c7db7 6d752409 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/24 23:08 linux-4.14.y 9d5c0b3a8e1a faae2fda .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/07 00:58 linux-4.14.y 9d5c0b3a8e1a 80b58a42 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/05 14:06 linux-4.14.y 9d5c0b3a8e1a 267e3bb1 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/11/08 12:31 linux-4.14.y a901bb6c7db7 6feb842b .config console log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/12/27 19:52 linux-4.14.y c4215ee4771b 44712fbc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/12/22 17:25 linux-4.14.y c4215ee4771b 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/12/22 15:23 linux-4.14.y c4215ee4771b 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/12/22 00:46 linux-4.14.y c4215ee4771b 4067838e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/12/21 20:39 linux-4.14.y c4215ee4771b 4067838e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/12/21 15:15 linux-4.14.y c4215ee4771b 4067838e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/12/19 23:55 linux-4.14.y c4215ee4771b c52b2efb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/12/15 16:07 linux-4.14.y c4215ee4771b 6f9c033e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/12/15 11:07 linux-4.14.y c4215ee4771b 6f9c033e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/12/14 21:11 linux-4.14.y c4215ee4771b b18f0a64 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/12/09 21:36 linux-4.14.y 65afe34ac33d 67be1ae7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/29 22:13 linux-4.14.y 41f36d7859a7 2a71366b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/27 00:51 linux-4.14.y 41f36d7859a7 86777b7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/24 13:14 linux-4.14.y 9d5c0b3a8e1a faae2fda .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/23 16:11 linux-4.14.y 9d5c0b3a8e1a 23bf86af .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/23 12:08 linux-4.14.y 9d5c0b3a8e1a 23bf86af .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/22 06:57 linux-4.14.y 9d5c0b3a8e1a c0b80a55 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/21 12:48 linux-4.14.y 9d5c0b3a8e1a 63e790dd .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/21 12:02 linux-4.14.y 9d5c0b3a8e1a 63e790dd .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/21 08:51 linux-4.14.y 9d5c0b3a8e1a 63e790dd .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/21 02:32 linux-4.14.y 9d5c0b3a8e1a a0fd4dab .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/20 20:53 linux-4.14.y 9d5c0b3a8e1a a0fd4dab .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/18 19:34 linux-4.14.y 9d5c0b3a8e1a b31320fc .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/18 19:12 linux-4.14.y 9d5c0b3a8e1a b31320fc .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/18 15:02 linux-4.14.y 9d5c0b3a8e1a b31320fc .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
2022/10/18 11:17 linux-4.14.y 9d5c0b3a8e1a b31320fc .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in do_journal_begin_r
* Struck through repros no longer work on HEAD.