syzbot


possible deadlock in ext4_multi_mount_protect

Status: fixed on 2023/06/19 12:27
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+87a27427c88da34e9fc7@syzkaller.appspotmail.com
Fix commit: 19fb73b8eaef ext4: fix lockdep warning when enabling MMP
First crash: 607d, last: 565d
Fix bisection: fixed by (bisect log) :
commit 19fb73b8eaefccc48918c2f915d021bd4a5572a7
Author: Jan Kara <jack@suse.cz>
Date: Tue Apr 11 12:10:19 2023 +0000

  ext4: fix lockdep warning when enabling MMP

  
Bug presence (1)
Date Name Commit Repro Result
2023/05/09 upstream (ToT) ba0ad6ed89fd C [report] possible deadlock in ext4_multi_mount_protect
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in ext4_multi_mount_protect ext4 C 584 520d 604d 22/28 fixed on 2023/07/01 16:05
linux-5.15 possible deadlock in ext4_multi_mount_protect origin:lts-only C error 171 558d 607d 0/3 auto-obsoleted due to no activity on 2024/10/04 00:46

Sample crash report:
EXT4-fs (loop0): 1 truncate cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Quota mode: writeback.
======================================================
WARNING: possible circular locking dependency detected
6.1.27-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor110/4217 is trying to acquire lock:
ffff0000d516a460 (sb_writers#3){.+.+}-{0:0}, at: ext4_multi_mount_protect+0x2e0/0x8a4 fs/ext4/mmp.c:349

but task is already holding lock:
ffff0000d516a0e0 (&type->s_umount_key#30){++++}-{3:3}, at: vfs_fsconfig_locked fs/fsopen.c:253 [inline]
ffff0000d516a0e0 (&type->s_umount_key#30){++++}-{3:3}, at: __do_sys_fsconfig fs/fsopen.c:439 [inline]
ffff0000d516a0e0 (&type->s_umount_key#30){++++}-{3:3}, at: __se_sys_fsconfig fs/fsopen.c:314 [inline]
ffff0000d516a0e0 (&type->s_umount_key#30){++++}-{3:3}, at: __arm64_sys_fsconfig+0xa14/0xd18 fs/fsopen.c:314

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&type->s_umount_key#30){++++}-{3:3}:
       down_write+0x5c/0x88 kernel/locking/rwsem.c:1573
       __do_sys_quotactl_fd fs/quota/quota.c:997 [inline]
       __se_sys_quotactl_fd fs/quota/quota.c:972 [inline]
       __arm64_sys_quotactl_fd+0x2fc/0x4a4 fs/quota/quota.c:972
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
       el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
       el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
       el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

-> #0 (sb_writers#3){.+.+}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3098 [inline]
       check_prevs_add kernel/locking/lockdep.c:3217 [inline]
       validate_chain kernel/locking/lockdep.c:3832 [inline]
       __lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5056
       lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1832 [inline]
       sb_start_write include/linux/fs.h:1907 [inline]
       write_mmp_block+0x100/0xb8c fs/ext4/mmp.c:50
       ext4_multi_mount_protect+0x2e0/0x8a4 fs/ext4/mmp.c:349
       __ext4_remount fs/ext4/super.c:6530 [inline]
       ext4_reconfigure+0x218c/0x2934 fs/ext4/super.c:6629
       reconfigure_super+0x328/0x738 fs/super.c:957
       vfs_fsconfig_locked fs/fsopen.c:254 [inline]
       __do_sys_fsconfig fs/fsopen.c:439 [inline]
       __se_sys_fsconfig fs/fsopen.c:314 [inline]
       __arm64_sys_fsconfig+0xa1c/0xd18 fs/fsopen.c:314
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
       el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
       el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
       el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&type->s_umount_key#30);
                               lock(sb_writers#3);
                               lock(&type->s_umount_key#30);
  lock(sb_writers#3);

 *** DEADLOCK ***

2 locks held by syz-executor110/4217:
 #0: ffff0000cf976870 (&fc->uapi_mutex){+.+.}-{3:3}, at: __do_sys_fsconfig fs/fsopen.c:437 [inline]
 #0: ffff0000cf976870 (&fc->uapi_mutex){+.+.}-{3:3}, at: __se_sys_fsconfig fs/fsopen.c:314 [inline]
 #0: ffff0000cf976870 (&fc->uapi_mutex){+.+.}-{3:3}, at: __arm64_sys_fsconfig+0x720/0xd18 fs/fsopen.c:314
 #1: ffff0000d516a0e0 (&type->s_umount_key#30){++++}-{3:3}, at: vfs_fsconfig_locked fs/fsopen.c:253 [inline]
 #1: ffff0000d516a0e0 (&type->s_umount_key#30){++++}-{3:3}, at: __do_sys_fsconfig fs/fsopen.c:439 [inline]
 #1: ffff0000d516a0e0 (&type->s_umount_key#30){++++}-{3:3}, at: __se_sys_fsconfig fs/fsopen.c:314 [inline]
 #1: ffff0000d516a0e0 (&type->s_umount_key#30){++++}-{3:3}, at: __arm64_sys_fsconfig+0xa14/0xd18 fs/fsopen.c:314

stack backtrace:
CPU: 1 PID: 4217 Comm: syz-executor110 Not tainted 6.1.27-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 dump_stack+0x1c/0x5c lib/dump_stack.c:113
 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2056
 check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2178
 check_prev_add kernel/locking/lockdep.c:3098 [inline]
 check_prevs_add kernel/locking/lockdep.c:3217 [inline]
 validate_chain kernel/locking/lockdep.c:3832 [inline]
 __lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5056
 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
 percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
 __sb_start_write include/linux/fs.h:1832 [inline]
 sb_start_write include/linux/fs.h:1907 [inline]
 write_mmp_block+0x100/0xb8c fs/ext4/mmp.c:50
 ext4_multi_mount_protect+0x2e0/0x8a4 fs/ext4/mmp.c:349
 __ext4_remount fs/ext4/super.c:6530 [inline]
 ext4_reconfigure+0x218c/0x2934 fs/ext4/super.c:6629
 reconfigure_super+0x328/0x738 fs/super.c:957
 vfs_fsconfig_locked fs/fsopen.c:254 [inline]
 __do_sys_fsconfig fs/fsopen.c:439 [inline]
 __se_sys_fsconfig fs/fsopen.c:314 [inline]
 __arm64_sys_fsconfig+0xa1c/0xd18 fs/fsopen.c:314
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
EXT4-fs warning (device loop0): ext4_enable_quotas:6988: Failed to enable quota tracking (type=2, err=-22, ino=15). Please run e2fsck to fix.

Crashes (165):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/08 05:13 linux-6.1.y ca48fc16c493 90c93c40 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/16 19:34 linux-6.1.y bf4ad6fa4e53 11c89444 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_multi_mount_protect
2023/05/16 10:49 linux-6.1.y bf4ad6fa4e53 71b00cfb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_multi_mount_protect
2023/05/15 22:56 linux-6.1.y bf4ad6fa4e53 c4d362e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_multi_mount_protect
2023/05/15 19:09 linux-6.1.y bf4ad6fa4e53 c4d362e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_multi_mount_protect
2023/05/13 06:01 linux-6.1.y bf4ad6fa4e53 ecca8a24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_multi_mount_protect
2023/05/12 08:56 linux-6.1.y bf4ad6fa4e53 adb9a3cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_multi_mount_protect
2023/05/05 22:36 linux-6.1.y ca48fc16c493 de870ca5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_multi_mount_protect
2023/05/04 07:37 linux-6.1.y ca48fc16c493 5b7ff9dd .config console log report info ci2-linux-6-1-kasan possible deadlock in ext4_multi_mount_protect
2023/05/04 03:00 linux-6.1.y ca48fc16c493 b5918830 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ext4_multi_mount_protect
2023/05/17 12:31 linux-6.1.y bf4ad6fa4e53 eaac4681 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/17 10:24 linux-6.1.y bf4ad6fa4e53 eaac4681 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/16 21:23 linux-6.1.y bf4ad6fa4e53 11c89444 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/16 07:04 linux-6.1.y bf4ad6fa4e53 71b00cfb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/16 02:25 linux-6.1.y bf4ad6fa4e53 71b00cfb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/15 16:17 linux-6.1.y bf4ad6fa4e53 c4d362e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/15 14:57 linux-6.1.y bf4ad6fa4e53 c4d362e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/15 13:23 linux-6.1.y bf4ad6fa4e53 c4d362e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/15 11:48 linux-6.1.y bf4ad6fa4e53 c4d362e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/15 10:28 linux-6.1.y bf4ad6fa4e53 c4d362e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/13 12:13 linux-6.1.y bf4ad6fa4e53 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/13 07:29 linux-6.1.y bf4ad6fa4e53 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/12 18:43 linux-6.1.y bf4ad6fa4e53 ecca8a24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/12 17:24 linux-6.1.y bf4ad6fa4e53 ecca8a24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/12 14:57 linux-6.1.y bf4ad6fa4e53 ecca8a24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/12 12:50 linux-6.1.y bf4ad6fa4e53 ecca8a24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/12 05:13 linux-6.1.y bf4ad6fa4e53 adb9a3cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/12 02:40 linux-6.1.y bf4ad6fa4e53 adb9a3cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/11 23:08 linux-6.1.y bf4ad6fa4e53 adb9a3cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/11 20:07 linux-6.1.y bf4ad6fa4e53 0fbd49f4 .config console log report info ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/11 19:02 linux-6.1.y bf4ad6fa4e53 0fbd49f4 .config console log report info ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/11 13:01 linux-6.1.y ca48fc16c493 0fbd49f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/11 10:11 linux-6.1.y ca48fc16c493 0fbd49f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/11 07:00 linux-6.1.y ca48fc16c493 0fbd49f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/11 05:39 linux-6.1.y ca48fc16c493 0fbd49f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/10 17:27 linux-6.1.y ca48fc16c493 14b12a99 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/10 15:26 linux-6.1.y ca48fc16c493 14b12a99 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/10 12:09 linux-6.1.y ca48fc16c493 14b12a99 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/10 02:49 linux-6.1.y ca48fc16c493 30aa2a7e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/10 02:49 linux-6.1.y ca48fc16c493 30aa2a7e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/09 13:13 linux-6.1.y ca48fc16c493 30aa2a7e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/09 00:19 linux-6.1.y ca48fc16c493 c7a5e2a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/08 09:56 linux-6.1.y ca48fc16c493 90c93c40 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/06 13:44 linux-6.1.y ca48fc16c493 90c93c40 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/05 21:21 linux-6.1.y ca48fc16c493 de870ca5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/05 17:46 linux-6.1.y ca48fc16c493 de870ca5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/04 17:25 linux-6.1.y ca48fc16c493 518a39a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/05/04 05:38 linux-6.1.y ca48fc16c493 5b7ff9dd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
2023/04/04 22:16 linux-6.1.y 3b29299e5f60 831373d3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ext4_multi_mount_protect
* Struck through repros no longer work on HEAD.