syzbot


possible deadlock in ext4_bmap

Status: upstream: reported C repro on 2022/08/08 07:33
Reported-by: syzbot+9543479984ae9e576000@syzkaller.appspotmail.com
First crash: 181d, last: now

Cause bisection: failed (bisect log)
Last patch testing requests:
Created Duration User Patch Repo Result
2022/08/09 11:10 18m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git ca688bff68bc OK log

Sample crash report:
warning: checkpointing journal with EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT can be slow
======================================================
WARNING: possible circular locking dependency detected
6.2.0-rc2-syzkaller-00010-g69b41ac87e4a #0 Not tainted
------------------------------------------------------
syz-executor504/5066 is trying to acquire lock:
ffff888140d10400 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock_shared include/linux/fs.h:766 [inline]
ffff888140d10400 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_bmap+0x55/0x410 fs/ext4/inode.c:3243

but task is already holding lock:
ffff88814c1483f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: jbd2_journal_flush+0x330/0xca0 fs/jbd2/journal.c:2474

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&journal->j_checkpoint_mutex){+.+.}-{3:3}:
       lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668
       __mutex_lock_common+0x1bd/0x26e0 kernel/locking/mutex.c:603
       mutex_lock_io_nested+0x43/0x60 kernel/locking/mutex.c:833
       jbd2_journal_flush+0x2a6/0xca0 fs/jbd2/journal.c:2464
       ext4_ioctl_checkpoint fs/ext4/ioctl.c:1082 [inline]
       __ext4_ioctl fs/ext4/ioctl.c:1590 [inline]
       ext4_ioctl+0x3224/0x54f0 fs/ext4/ioctl.c:1610
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #2 (&journal->j_barrier){+.+.}-{3:3}:
       lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668
       __mutex_lock_common+0x1bd/0x26e0 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
       jbd2_journal_lock_updates+0x29d/0x370 fs/jbd2/transaction.c:904
       ext4_change_inode_journal_flag+0x1a2/0x6c0 fs/ext4/inode.c:6158
       ext4_ioctl_setflags fs/ext4/ioctl.c:687 [inline]
       ext4_fileattr_set+0xdf1/0x1810 fs/ext4/ioctl.c:1004
       vfs_fileattr_set+0x8be/0xd20 fs/ioctl.c:696
       ioctl_setflags fs/ioctl.c:728 [inline]
       do_vfs_ioctl+0x1d02/0x2980 fs/ioctl.c:839
       __do_sys_ioctl fs/ioctl.c:868 [inline]
       __se_sys_ioctl+0x83/0x170 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #1 (&sbi->s_writepages_rwsem){++++}-{0:0}:
       lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668
       percpu_down_write+0x50/0x300 kernel/locking/percpu-rwsem.c:227
       ext4_ind_migrate+0x262/0x730 fs/ext4/migrate.c:624
       ext4_ioctl_setflags fs/ext4/ioctl.c:696 [inline]
       ext4_fileattr_set+0xe7c/0x1810 fs/ext4/ioctl.c:1004
       vfs_fileattr_set+0x8be/0xd20 fs/ioctl.c:696
       ioctl_setflags fs/ioctl.c:728 [inline]
       do_vfs_ioctl+0x1d02/0x2980 fs/ioctl.c:839
       __do_sys_ioctl fs/ioctl.c:868 [inline]
       __se_sys_ioctl+0x83/0x170 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&sb->s_type->i_mutex_key#8){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3097 [inline]
       check_prevs_add kernel/locking/lockdep.c:3216 [inline]
       validate_chain+0x1898/0x6ae0 kernel/locking/lockdep.c:3831
       __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055
       lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668
       down_read+0x39/0x50 kernel/locking/rwsem.c:1509
       inode_lock_shared include/linux/fs.h:766 [inline]
       ext4_bmap+0x55/0x410 fs/ext4/inode.c:3243
       bmap+0xa1/0xd0 fs/inode.c:1798
       jbd2_journal_bmap fs/jbd2/journal.c:977 [inline]
       __jbd2_journal_erase fs/jbd2/journal.c:1789 [inline]
       jbd2_journal_flush+0x5d0/0xca0 fs/jbd2/journal.c:2492
       ext4_ioctl_checkpoint fs/ext4/ioctl.c:1082 [inline]
       __ext4_ioctl fs/ext4/ioctl.c:1590 [inline]
       ext4_ioctl+0x3224/0x54f0 fs/ext4/ioctl.c:1610
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/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:
  &sb->s_type->i_mutex_key#8 --> &journal->j_barrier --> &journal->j_checkpoint_mutex

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&journal->j_checkpoint_mutex);
                               lock(&journal->j_barrier);
                               lock(&journal->j_checkpoint_mutex);
  lock(&sb->s_type->i_mutex_key#8);

 *** DEADLOCK ***

2 locks held by syz-executor504/5066:
 #0: ffff88814c148170 (&journal->j_barrier){+.+.}-{3:3}, at: jbd2_journal_lock_updates+0x29d/0x370 fs/jbd2/transaction.c:904
 #1: ffff88814c1483f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: jbd2_journal_flush+0x330/0xca0 fs/jbd2/journal.c:2474

stack backtrace:
CPU: 1 PID: 5066 Comm: syz-executor504 Not tainted 6.2.0-rc2-syzkaller-00010-g69b41ac87e4a #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+0x1b1/0x290 lib/dump_stack.c:106
 check_noncircular+0x2cc/0x390 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+0x1898/0x6ae0 kernel/locking/lockdep.c:3831
 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055
 lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668
 down_read+0x39/0x50 kernel/locking/rwsem.c:1509
 inode_lock_shared include/linux/fs.h:766 [inline]
 ext4_bmap+0x55/0x410 fs/ext4/inode.c:3243
 bmap+0xa1/0xd0 fs/inode.c:1798
 jbd2_journal_bmap fs/jbd2/journal.c:977 [inline]
 __jbd2_journal_erase fs/jbd2/journal.c:1789 [inline]
 jbd2_journal_flush+0x5d0/0xca0 fs/jbd2/journal.c:2492
 ext4_ioctl_checkpoint fs/ext4/ioctl.c:1082 [inline]
 __ext4_ioctl fs/ext4/ioctl.c:1590 [inline]
 ext4_ioctl+0x3224/0x54f0 fs/ext4/ioctl.c:1610
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7ff52217bb79
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 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:00007ffca38b40d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff52217bb79
RDX: 0000000020000000 RSI: 000000004004662b RDI: 0000000000000004
RBP: 00007ff52213fd20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000

Crashes (64772):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci2-upstream-fs 2023/01/05 01:42 upstream 69b41ac87e4a 1dac8c7a .config strace log report syz C [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-smack-root 2022/12/18 21:52 upstream f9ff5644bcc0 05494336 .config strace log report syz C [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-selinux-root 2022/12/07 08:13 upstream 8ed710da2873 d88f3abb .config strace log report syz C [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-root 2022/08/21 13:03 upstream 15b3f48a4339 26a13b38 .config strace log report syz C possible deadlock in ext4_bmap
ci-upstream-bpf-kasan-gce 2022/12/02 00:32 bpf 01f856ae6d0c e080de16 .config strace log report syz C [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-bpf-kasan-gce 2022/08/24 22:03 bpf 0947ae112108 514514f6 .config strace log report syz C possible deadlock in ext4_bmap
ci-upstream-bpf-kasan-gce 2022/08/24 21:50 bpf 0947ae112108 514514f6 .config console log report syz C possible deadlock in ext4_bmap
ci-upstream-bpf-next-kasan-gce 2022/08/24 20:42 bpf-next d24433c0f4a3 514514f6 .config strace log report syz C possible deadlock in ext4_bmap
ci-upstream-bpf-next-kasan-gce 2022/08/24 20:23 bpf-next d24433c0f4a3 514514f6 .config console log report syz C possible deadlock in ext4_bmap
ci-upstream-linux-next-kasan-gce-root 2022/11/06 17:49 linux-next 0cdb3579f1ee 6d752409 .config strace log report syz C [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-linux-next-kasan-gce-root 2022/08/08 19:02 linux-next ca688bff68bc 88e3a122 .config strace log report syz C possible deadlock in ext4_bmap
ci-upstream-kasan-gce-smack-root 2023/02/05 21:35 upstream 837c07cf68fe be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-selinux-root 2023/02/05 19:26 upstream 837c07cf68fe be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci2-upstream-fs 2023/02/05 17:17 upstream 837c07cf68fe be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-smack-root 2023/02/05 15:49 upstream 95078069c1e7 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-qemu-upstream 2023/02/05 14:37 upstream 837c07cf68fe be607b78 .config console log report info possible deadlock in ext4_bmap
ci2-upstream-fs 2023/02/05 13:27 upstream 837c07cf68fe be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-qemu-upstream 2023/02/05 12:26 upstream 837c07cf68fe be607b78 .config console log report info possible deadlock in ext4_bmap
ci2-upstream-fs 2023/02/05 11:22 upstream 837c07cf68fe be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-smack-root 2023/02/05 10:56 upstream 95078069c1e7 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-root 2023/02/05 09:50 upstream 95078069c1e7 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-selinux-root 2023/02/05 09:10 upstream 95078069c1e7 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-selinux-root 2023/02/05 07:26 upstream 95078069c1e7 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-smack-root 2023/02/05 06:21 upstream 95078069c1e7 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-root 2023/02/05 05:13 upstream 95078069c1e7 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-root 2023/02/05 04:11 upstream 95078069c1e7 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-selinux-root 2023/02/05 04:09 upstream 95078069c1e7 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-qemu-upstream 2023/02/04 21:57 upstream db27c22251e7 be607b78 .config console log report info possible deadlock in ext4_bmap
ci2-upstream-fs 2023/02/04 20:10 upstream 0136d86b7852 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci2-upstream-fs 2023/02/04 18:55 upstream 0136d86b7852 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-selinux-root 2023/02/04 16:49 upstream 0136d86b7852 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-smack-root 2023/02/04 15:00 upstream 0136d86b7852 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-root 2023/02/04 14:03 upstream 0136d86b7852 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-selinux-root 2023/02/04 13:39 upstream 0136d86b7852 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-root 2023/02/04 12:36 upstream 0136d86b7852 1b2f701a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-selinux-root 2023/02/04 10:23 upstream 0136d86b7852 1b2f701a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-kasan-gce-root 2023/02/04 09:22 upstream 0136d86b7852 1b2f701a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-qemu-upstream-386 2023/02/04 10:36 upstream 0136d86b7852 be607b78 .config console log report info possible deadlock in ext4_bmap
ci-upstream-bpf-kasan-gce 2023/02/06 00:16 bpf a6efc42a86c0 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-net-this-kasan-gce 2023/02/05 18:26 net a05e7a67986c be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-net-this-kasan-gce 2023/02/05 02:05 net a05e7a67986c be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-bpf-kasan-gce 2023/02/04 20:06 bpf a6efc42a86c0 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-bpf-kasan-gce 2023/02/04 19:06 bpf a6efc42a86c0 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-bpf-kasan-gce 2023/02/04 17:49 bpf a6efc42a86c0 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-net-this-kasan-gce 2023/02/04 16:07 net a05e7a67986c be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-net-this-kasan-gce 2023/02/04 06:47 net cbe83191d40d 1b2f701a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-net-kasan-gce 2023/02/05 23:16 net-next 042b7858d50f be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-bpf-next-kasan-gce 2023/02/05 22:44 bpf-next 17c9b4e1a7d1 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-net-kasan-gce 2023/02/05 20:54 net-next 042b7858d50f be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-bpf-next-kasan-gce 2023/02/05 13:36 bpf-next 17c9b4e1a7d1 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-bpf-next-kasan-gce 2023/02/05 08:06 bpf-next 17c9b4e1a7d1 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-bpf-next-kasan-gce 2023/02/05 03:07 bpf-next 17c9b4e1a7d1 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-bpf-next-kasan-gce 2023/02/05 01:26 bpf-next 17c9b4e1a7d1 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-bpf-next-kasan-gce 2023/02/05 00:24 bpf-next 17c9b4e1a7d1 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-bpf-next-kasan-gce 2023/02/05 00:00 bpf-next 17c9b4e1a7d1 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-bpf-next-kasan-gce 2023/02/04 22:58 bpf-next 17c9b4e1a7d1 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-net-kasan-gce 2023/02/04 21:16 net-next 042b7858d50f be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-linux-next-kasan-gce-root 2023/02/05 06:16 linux-next 4fafd96910ad be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-linux-next-kasan-gce-root 2023/02/04 15:36 linux-next 4fafd96910ad be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-linux-next-kasan-gce-root 2022/08/08 07:09 linux-next ca688bff68bc 88e3a122 .config console log report info possible deadlock in ext4_bmap
ci-upstream-linux-next-kasan-gce-root 2022/08/08 04:36 linux-next ca688bff68bc 88e3a122 .config console log report info possible deadlock in ext4_bmap
ci-upstream-gce-arm64 2023/02/06 00:22 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci ca72d58361ee be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-gce-arm64 2023/02/05 19:33 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci ca72d58361ee be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-gce-arm64 2023/02/05 16:17 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci ca72d58361ee be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-gce-arm64 2023/02/04 11:47 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci ca72d58361ee 1b2f701a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
ci-upstream-gce-arm64 2023/02/04 08:17 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci ca72d58361ee 1b2f701a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ext4_bmap
* Struck through repros no longer work on HEAD.