syzbot


possible deadlock in quotactl_fd

Status: fixed on 2023/08/17 04:20
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+cdcd444e4d3a256ada13@syzkaller.appspotmail.com
Fix commit: 949f95ff39bf ext4: fix lockdep warning when enabling MMP
First crash: 418d, last: 330d
Cause bisection: failed (error log, bisect log)
  
Fix bisection: fixed by (bisect log) :
commit 949f95ff39bf188e594e7ecd8e29b82eb108f5bf
Author: Jan Kara <jack@suse.cz>
Date: Tue Apr 11 12:10:19 2023 +0000

  ext4: fix lockdep warning when enabling MMP

  
Discussions (3)
Title Replies (including bot) Last reply
[syzbot] [fs?] possible deadlock in quotactl_fd 5 (8) 2023/08/16 03:22
[syzbot] Monthly ext4 report (Jul 2023) 0 (1) 2023/07/06 14:18
[syzbot] Monthly fs report (May 2023) 0 (1) 2023/05/06 14:02

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.4.0-rc1-syzkaller-00011-g1dc3731daf1f #0 Not tainted
------------------------------------------------------
syz-executor197/5038 is trying to acquire lock:
ffff88802b6260e0 (&type->s_umount_key#32){++++}-{3:3}, at: __do_sys_quotactl_fd+0x27e/0x3f0 fs/quota/quota.c:999

but task is already holding lock:
ffff88802b626460 (sb_writers#4){.+.+}-{0:0}, at: __do_sys_quotactl_fd+0xd3/0x3f0 fs/quota/quota.c:990

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (sb_writers#4){.+.+}-{0:0}:
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1494 [inline]
       sb_start_write include/linux/fs.h:1569 [inline]
       write_mmp_block+0xc4/0x820 fs/ext4/mmp.c:50
       ext4_multi_mount_protect+0x50d/0xac0 fs/ext4/mmp.c:347
       __ext4_remount fs/ext4/super.c:6578 [inline]
       ext4_reconfigure+0x242b/0x2b60 fs/ext4/super.c:6677
       reconfigure_super+0x40c/0xa30 fs/super.c:956
       vfs_fsconfig_locked fs/fsopen.c:254 [inline]
       __do_sys_fsconfig+0xa5e/0xc50 fs/fsopen.c:439
       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 (&type->s_umount_key#32){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3108 [inline]
       check_prevs_add kernel/locking/lockdep.c:3227 [inline]
       validate_chain kernel/locking/lockdep.c:3842 [inline]
       __lock_acquire+0x2f21/0x5df0 kernel/locking/lockdep.c:5074
       lock_acquire kernel/locking/lockdep.c:5691 [inline]
       lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5656
       down_read+0x3d/0x50 kernel/locking/rwsem.c:1520
       __do_sys_quotactl_fd+0x27e/0x3f0 fs/quota/quota.c:999
       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:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(sb_writers#4);
                               lock(&type->s_umount_key#32);
                               lock(sb_writers#4);
  rlock(&type->s_umount_key#32);

 *** DEADLOCK ***

1 lock held by syz-executor197/5038:
 #0: ffff88802b626460 (sb_writers#4){.+.+}-{0:0}, at: __do_sys_quotactl_fd+0xd3/0x3f0 fs/quota/quota.c:990

stack backtrace:
CPU: 1 PID: 5038 Comm: syz-executor197 Not tainted 6.4.0-rc1-syzkaller-00011-g1dc3731daf1f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2188
 check_prev_add kernel/locking/lockdep.c:3108 [inline]
 check_prevs_add kernel/locking/lockdep.c:3227 [inline]
 validate_chain kernel/locking/lockdep.c:3842 [inline]
 __lock_acquire+0x2f21/0x5df0 kernel/locking/lockdep.c:5074
 lock_acquire kernel/locking/lockdep.c:5691 [inline]
 lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5656
 down_read+0x3d/0x50 kernel/locking/rwsem.c:1520
 __do_sys_quotactl_fd+0x27e/0x3f0 fs/quota/quota.c:999
 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:0x7fc4ee1d7359
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 15 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:00007fc4ee1832f8 EFLAGS: 00000246 ORIG_RAX: 00000000000001bb
RAX: ffffffffffffffda RBX: 00007fc4ee25b7a0 RCX: 00007fc4ee1d7359
RDX: 00000000ffffffff RSI: ffffffff80000802 RDI: 0000000000000003
RBP: 00007fc4ee22858c R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 7272655f61746164
R13: 6974797a616c6f6e R14: 0030656c69662f2e R15: 00007fc4ee25b7a8
 </TASK>

Crashes (141):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/10 07:30 upstream 1dc3731daf1f 1964022b .config strace log report syz C [mounted in repro] ci-upstream-kasan-gce-root possible deadlock in quotactl_fd
2023/05/14 03:15 upstream d4d58949a6ea 2b9ba477 .config console log report info ci-upstream-kasan-gce-selinux-root possible deadlock in quotactl_fd
2023/05/13 22:15 upstream d4d58949a6ea 2b9ba477 .config console log report info ci-upstream-kasan-gce-selinux-root possible deadlock in quotactl_fd
2023/05/13 22:15 upstream d4d58949a6ea 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in quotactl_fd
2023/05/13 10:26 upstream 76c7f8873a76 2b9ba477 .config console log report info ci-qemu-upstream possible deadlock in quotactl_fd
2023/05/13 04:51 upstream 9a48d6046722 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in quotactl_fd
2023/05/13 00:55 upstream cc3c44c9fda2 ecca8a24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in quotactl_fd
2023/05/12 21:52 upstream cc3c44c9fda2 893599a2 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in quotactl_fd
2023/05/11 23:54 upstream 105131df9c3b adb9a3cd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in quotactl_fd
2023/05/11 21:19 upstream 105131df9c3b adb9a3cd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in quotactl_fd
2023/05/11 11:27 upstream 80e62bc8487b 0fbd49f4 .config console log report info ci-qemu-upstream possible deadlock in quotactl_fd
2023/05/11 09:57 upstream 80e62bc8487b 0fbd49f4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in quotactl_fd
2023/05/10 20:38 upstream ad2fd53a7870 0fbd49f4 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in quotactl_fd
2023/05/10 19:04 upstream 16a8829130ca 0fbd49f4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in quotactl_fd
2023/05/10 08:31 upstream 1dc3731daf1f 1964022b .config console log report info ci-upstream-kasan-gce-selinux-root possible deadlock in quotactl_fd
2023/05/10 02:30 upstream 1dc3731daf1f 1964022b .config console log report info ci-upstream-kasan-gce-root possible deadlock in quotactl_fd
2023/05/09 19:30 upstream 1dc3731daf1f 1964022b .config console log report info ci-qemu-upstream possible deadlock in quotactl_fd
2023/05/09 04:44 upstream ba0ad6ed89fd f4168103 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in quotactl_fd
2023/05/09 01:13 upstream ba0ad6ed89fd f4168103 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in quotactl_fd
2023/05/07 19:31 upstream 17784de648be 90c93c40 .config console log report info ci-qemu-upstream possible deadlock in quotactl_fd
2023/04/11 03:27 upstream 0d3eb744aed4 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in quotactl_fd
2023/04/07 13:07 upstream f2afccfefe7b f7ba566d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in quotactl_fd
2023/04/04 08:05 upstream 148341f0a2f5 7db618d0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in quotactl_fd
2023/05/13 14:32 upstream 9a48d6046722 2b9ba477 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in quotactl_fd
2023/05/13 02:03 upstream 76c7f8873a76 2b9ba477 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in quotactl_fd
2023/05/12 12:52 upstream cc3c44c9fda2 893599a2 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in quotactl_fd
2023/05/11 17:48 upstream 105131df9c3b adb9a3cd .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in quotactl_fd
2023/05/10 22:43 upstream ad2fd53a7870 0fbd49f4 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in quotactl_fd
2023/05/10 20:33 upstream ad2fd53a7870 0fbd49f4 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in quotactl_fd
2023/05/09 21:28 upstream 1dc3731daf1f 1964022b .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in quotactl_fd
2023/05/09 09:51 upstream ba0ad6ed89fd f4168103 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in quotactl_fd
2023/05/08 12:54 upstream ac9a78681b92 90c93c40 .config console log report info ci-qemu-upstream-386 possible deadlock in quotactl_fd
2023/05/08 11:14 upstream ac9a78681b92 90c93c40 .config console log report info ci-qemu-upstream-386 possible deadlock in quotactl_fd
2023/05/05 07:19 linux-next 145e5cddfe8b 518a39a6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in quotactl_fd
2023/07/01 01:19 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 af3053d2 .config console log report info ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/30 08:59 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 01298212 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/30 05:20 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 01298212 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/29 15:35 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 134ddc02 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/29 13:59 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 134ddc02 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/28 07:00 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 4cd5bb25 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/27 13:18 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 4cd5bb25 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/27 12:11 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 4cd5bb25 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/27 00:09 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 4cd5bb25 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/20 22:22 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 0cf1feea .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/16 06:09 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 f3921d4d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/15 13:14 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c ff5fb304 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/15 10:17 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c ff5fb304 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/13 06:59 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 749afb64 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/10 21:41 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 49519f06 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/06/09 03:15 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 49a0a3731596 058b3a5a .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in quotactl_fd
2023/05/31 01:05 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 950b879b7f02 09898419 .config console log report info ci-qemu2-riscv64 possible deadlock in quotactl_fd
* Struck through repros no longer work on HEAD.