syzbot


possible deadlock in evict (2)

Status: closed as dup on 2022/04/21 19:37
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+e0fda9a3d66127dea5c2@syzkaller.appspotmail.com
First crash: 903d, last: 596d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
possible deadlock in fscrypt_initialize fscrypt 10 590d 899d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] possible deadlock in evict (2) 1 (2) 2022/04/21 19:37
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in evict ext4 3 1303d 1331d 0/28 auto-closed as invalid on 2021/07/11 09:40
upstream possible deadlock in evict (3) ext4 569 102d 586d 0/28 auto-obsoleted due to no activity on 2024/09/04 11:02

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.2.0-rc6-syzkaller-00050-g9f266ccaa2f5 #0 Not tainted
------------------------------------------------------
syz-executor.3/17156 is trying to acquire lock:
ffff888028e6a650 (sb_internal){.+.+}-{0:0}, at: evict+0x2ed/0x6b0 fs/inode.c:664

but task is already holding lock:
ffff888028e6cb98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x326/0x1ce0 fs/ext4/migrate.c:437

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&sbi->s_writepages_rwsem){++++}-{0:0}:
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       ext4_writepages+0x1a9/0x5a0 fs/ext4/inode.c:2964
       do_writepages+0x1af/0x690 mm/page-writeback.c:2581
       filemap_fdatawrite_wbc mm/filemap.c:388 [inline]
       filemap_fdatawrite_wbc+0x147/0x1b0 mm/filemap.c:378
       __filemap_fdatawrite_range+0xb8/0xf0 mm/filemap.c:421
       filemap_write_and_wait_range mm/filemap.c:674 [inline]
       filemap_write_and_wait_range+0xa1/0x120 mm/filemap.c:665
       filemap_write_and_wait include/linux/pagemap.h:60 [inline]
       ext4_end_enable_verity+0x371/0x6d0 fs/ext4/verity.c:221
       enable_verity+0x127d/0x1b50 fs/verity/enable.c:298
       fsverity_ioctl_enable+0x3db/0x580 fs/verity/enable.c:392
       __ext4_ioctl+0x22bf/0x4b60 fs/ext4/ioctl.c:1576
       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

-> #2 (&sb->s_type->i_mutex_key#8){++++}-{3:3}:
       down_read+0x9c/0x450 kernel/locking/rwsem.c:1509
       inode_lock_shared include/linux/fs.h:766 [inline]
       ext4_bmap+0x52/0x470 fs/ext4/inode.c:3243
       bmap+0xae/0x120 fs/inode.c:1798
       jbd2_journal_bmap+0xac/0x180 fs/jbd2/journal.c:977
       __jbd2_journal_erase fs/jbd2/journal.c:1789 [inline]
       jbd2_journal_flush+0x853/0xc00 fs/jbd2/journal.c:2492
       ext4_ioctl_checkpoint fs/ext4/ioctl.c:1082 [inline]
       __ext4_ioctl+0xb01/0x4b60 fs/ext4/ioctl.c:1590
       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 (&journal->j_checkpoint_mutex){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       mutex_lock_io_nested+0x143/0x11a0 kernel/locking/mutex.c:833
       __jbd2_log_wait_for_space+0x238/0x460 fs/jbd2/checkpoint.c:110
       add_transaction_credits+0xa2d/0xb70 fs/jbd2/transaction.c:298
       start_this_handle+0x3ae/0x14a0 fs/jbd2/transaction.c:422
       jbd2__journal_start+0x39d/0x9b0 fs/jbd2/transaction.c:520
       __ext4_journal_start_sb+0x6e9/0x860 fs/ext4/ext4_jbd2.c:111
       __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline]
       ext4_evict_inode+0xa27/0x1eb0 fs/ext4/inode.c:251
       evict+0x2ed/0x6b0 fs/inode.c:664
       iput_final fs/inode.c:1747 [inline]
       iput.part.0+0x59b/0x880 fs/inode.c:1773
       iput+0x5c/0x80 fs/inode.c:1763
       d_delete_notify include/linux/fsnotify.h:261 [inline]
       vfs_rmdir.part.0+0x496/0x5a0 fs/namei.c:4134
       vfs_rmdir fs/namei.c:4106 [inline]
       do_rmdir+0x395/0x410 fs/namei.c:4182
       __do_sys_unlinkat fs/namei.c:4362 [inline]
       __se_sys_unlinkat fs/namei.c:4356 [inline]
       __x64_sys_unlinkat+0xef/0x130 fs/namei.c:4356
       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 (sb_internal){.+.+}-{0:0}:
       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
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1814 [inline]
       sb_start_intwrite include/linux/fs.h:1936 [inline]
       ext4_evict_inode+0x1327/0x1eb0 fs/ext4/inode.c:240
       evict+0x2ed/0x6b0 fs/inode.c:664
       iput_final fs/inode.c:1747 [inline]
       iput.part.0+0x59b/0x880 fs/inode.c:1773
       iput+0x5c/0x80 fs/inode.c:1763
       ext4_ext_migrate+0xc99/0x1ce0 fs/ext4/migrate.c:587
       __ext4_ioctl+0x1fb2/0x4b60 fs/ext4/ioctl.c:1392
       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:
  sb_internal --> &sb->s_type->i_mutex_key#8 --> &sbi->s_writepages_rwsem

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&sbi->s_writepages_rwsem);
                               lock(&sb->s_type->i_mutex_key#8);
                               lock(&sbi->s_writepages_rwsem);
  lock(sb_internal);

 *** DEADLOCK ***

3 locks held by syz-executor.3/17156:
 #0: ffff888028e6a460 (sb_writers#4){.+.+}-{0:0}, at: __ext4_ioctl+0x1f80/0x4b60 fs/ext4/ioctl.c:1382
 #1: ffff8880871c7258 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
 #1: ffff8880871c7258 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: __ext4_ioctl+0x1faa/0x4b60 fs/ext4/ioctl.c:1391
 #2: ffff888028e6cb98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x326/0x1ce0 fs/ext4/migrate.c:437

stack backtrace:
CPU: 0 PID: 17156 Comm: syz-executor.3 Not tainted 6.2.0-rc6-syzkaller-00050-g9f266ccaa2f5 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
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
 percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
 __sb_start_write include/linux/fs.h:1814 [inline]
 sb_start_intwrite include/linux/fs.h:1936 [inline]
 ext4_evict_inode+0x1327/0x1eb0 fs/ext4/inode.c:240
 evict+0x2ed/0x6b0 fs/inode.c:664
 iput_final fs/inode.c:1747 [inline]
 iput.part.0+0x59b/0x880 fs/inode.c:1773
 iput+0x5c/0x80 fs/inode.c:1763
 ext4_ext_migrate+0xc99/0x1ce0 fs/ext4/migrate.c:587
 __ext4_ioctl+0x1fb2/0x4b60 fs/ext4/ioctl.c:1392
 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:0x7f150f28c0c9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1510035168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f150f3abf80 RCX: 00007f150f28c0c9
RDX: 0000000000000000 RSI: 0000000000006609 RDI: 0000000000000003
RBP: 00007f150f2e7ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff242f12cf R14: 00007f1510035300 R15: 0000000000022000
 </TASK>

Crashes (39):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/02/02 07:37 upstream 9f266ccaa2f5 9dfcf09c .config console log report info ci-upstream-kasan-gce-root possible deadlock in evict
2022/12/21 23:35 upstream ec34c2b4ec38 4067838e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in evict
2022/11/05 20:11 upstream b208b9fbbcba 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in evict
2022/10/01 10:15 upstream ffb4d94b4314 feb56351 .config console log report info [disk image] [vmlinux] ci-upstream-kasan-gce-root possible deadlock in evict
2022/09/13 03:50 upstream 6504d82f4440 f371ed7e .config console log report info ci-qemu-upstream possible deadlock in evict
2022/08/26 04:23 upstream 4c612826bec1 15195ea3 .config console log report info ci-upstream-kasan-gce-root possible deadlock in evict
2022/08/24 03:36 upstream df0219d11b6f cea8b0f7 .config console log report info ci-upstream-kasan-gce-root possible deadlock in evict
2022/08/18 18:34 upstream 3b06a2755758 d58e263f .config console log report info ci-upstream-kasan-gce-root possible deadlock in evict
2022/08/18 01:53 upstream 274a2eebf80c d58e263f .config console log report info ci-upstream-kasan-gce-root possible deadlock in evict
2022/04/17 12:50 upstream a2c29ccd9477 8bcc32a6 .config console log report info ci-qemu-upstream possible deadlock in evict
2022/10/05 10:59 upstream 2bca25eaeba6 e0b72940 .config console log report info ci-qemu-upstream-386 possible deadlock in evict
2022/09/29 20:37 upstream 511cce163b75 d9da3ac6 .config console log report info ci-qemu-upstream-386 possible deadlock in evict
2022/09/10 00:34 upstream ce888220d5c7 356d8217 .config console log report info ci-qemu-upstream-386 possible deadlock in evict
2022/08/02 01:42 upstream 9de1f9c8ca51 fef302b1 .config console log report info ci-qemu-upstream-386 possible deadlock in evict
2023/02/18 07:37 net-old ec35307e18ba d02e9a70 .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in evict
2023/02/09 07:27 net-old b963d9d5b943 14a312c8 .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in evict
2023/01/23 15:52 net-old e38553bdc377 9dfcf09c .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in evict
2022/11/07 15:04 net-old f9027f88f7d1 a779b11a .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in evict
2022/10/21 00:43 net-old fa182ea26ff0 a0fd4dab .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in evict
2022/09/30 16:55 net-old 0bafedc53649 feb56351 .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in evict
2022/09/30 16:15 net-old 0bafedc53649 feb56351 .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in evict
2022/09/05 11:46 net-old 060ad609fa38 922294ab .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in evict
2022/09/03 07:28 net-old 05a5474efe93 49e94a20 .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in evict
2022/09/01 06:15 net-old 90fabae8a2c2 b01ec571 .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in evict
2022/08/27 15:36 net-old ebe5555c2f34 07177916 .config console log report info ci-upstream-net-this-kasan-gce possible deadlock in evict
2023/02/15 03:11 net-next-old 2edd92570441 1d6b4af7 .config console log report info ci-upstream-net-kasan-gce possible deadlock in evict
2023/02/03 15:13 net-next-old 8065c0e13f98 1b2f701a .config console log report info ci-upstream-net-kasan-gce possible deadlock in evict
2023/01/18 07:20 net-next-old c4791b3196bf 42660d9e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in evict
2022/12/01 16:47 net-next-old 9e855b1fe37f e080de16 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in evict
2022/11/15 07:30 net-next-old f12ed9c04804 97de9cfc .config console log report info ci-upstream-net-kasan-gce possible deadlock in evict
2022/11/08 05:32 net-next-old fbeb229a6622 881db35d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in evict
2022/11/07 13:32 net-next-old fbeb229a6622 a779b11a .config console log report info ci-upstream-net-kasan-gce possible deadlock in evict
2022/10/03 11:12 net-next-old 9d43507319cc feb56351 .config console log report info ci-upstream-net-kasan-gce possible deadlock in evict
2022/09/26 06:33 net-next-old 9258b8b1be2e 0042f2b4 .config console log report info ci-upstream-net-kasan-gce possible deadlock in evict
2022/09/22 03:18 net-next-old 6fb4825e492b 60af5050 .config console log report info ci-upstream-net-kasan-gce possible deadlock in evict
2022/09/10 08:53 net-next-old 169ccf0e4082 356d8217 .config console log report info ci-upstream-net-kasan-gce possible deadlock in evict
2022/09/08 21:28 net-next-old 929d43421ee5 f3027468 .config console log report info ci-upstream-net-kasan-gce possible deadlock in evict
2022/12/22 23:41 linux-next e45fb347b630 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in evict
2022/08/19 20:07 linux-next 8755ae45a9e8 26a13b38 .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in evict
* Struck through repros no longer work on HEAD.