syzbot


possible deadlock in do_qc

Status: upstream: reported on 2024/04/28 01:25
Reported-by: syzbot+bdc96b32d35cce7a6064@syzkaller.appspotmail.com
First crash: 490d, last: 6h08m
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in do_qc gfs2 4 785 383d 511d 0/29 auto-obsoleted due to no activity on 2024/10/22 09:11
linux-5.15 possible deadlock in do_qc 4 684 16h07m 490d 0/3 upstream: reported on 2024/04/27 22:18
linux-6.6 possible deadlock in do_qc 4 40 8h12m 75d 0/2 upstream: reported on 2025/06/17 09:35

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.1.148-syzkaller #0 Not tainted
------------------------------------------------------
syz.3.512/6554 is trying to acquire lock:
ffff888029764ae0 (&sdp->sd_quota_mutex){+.+.}-{3:3}, at: do_qc+0xca/0x730 fs/gfs2/quota.c:682

but task is already holding lock:
ffff888054334fd0 (&ip->i_rw_mutex){++++}-{3:3}, at: sweep_bh_for_rgrps fs/gfs2/bmap.c:1512 [inline]
ffff888054334fd0 (&ip->i_rw_mutex){++++}-{3:3}, at: punch_hole+0x241b/0x35c0 fs/gfs2/bmap.c:1837

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&ip->i_rw_mutex){++++}-{3:3}:
       down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520
       __gfs2_iomap_get+0x155/0x13e0 fs/gfs2/bmap.c:856
       gfs2_iomap_get+0xc1/0x120 fs/gfs2/bmap.c:1396
       bh_get+0x241/0x730 fs/gfs2/quota.c:385
       qdsb_get+0x21c/0x3c0 fs/gfs2/quota.c:522
       gfs2_quota_hold+0x194/0x5d0 fs/gfs2/quota.c:608
       punch_hole+0xd16/0x35c0 fs/gfs2/bmap.c:1798
       gfs2_iomap_end+0x4f2/0x6b0 fs/gfs2/bmap.c:1157
       iomap_iter+0x21a/0x1040 fs/iomap/iter.c:79
       iomap_file_buffered_write+0x74a/0x880 fs/iomap/buffered-io.c:846
       gfs2_file_buffered_write+0x4fe/0x880 fs/gfs2/file.c:1057
       gfs2_file_write_iter+0x42c/0xdf0 fs/gfs2/file.c:1158
       call_write_iter include/linux/fs.h:2265 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x44c/0x960 fs/read_write.c:584
       ksys_write+0x143/0x240 fs/read_write.c:637
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&sdp->sd_quota_mutex){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3090 [inline]
       check_prevs_add kernel/locking/lockdep.c:3209 [inline]
       validate_chain kernel/locking/lockdep.c:3825 [inline]
       __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
       lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x120/0xaf0 kernel/locking/mutex.c:747
       do_qc+0xca/0x730 fs/gfs2/quota.c:682
       gfs2_quota_change+0x2f5/0x8e0 fs/gfs2/quota.c:1295
       punch_hole+0x304c/0x35c0 fs/gfs2/bmap.c:1938
       gfs2_iomap_end+0x4f2/0x6b0 fs/gfs2/bmap.c:1157
       iomap_iter+0x21a/0x1040 fs/iomap/iter.c:79
       iomap_file_buffered_write+0x74a/0x880 fs/iomap/buffered-io.c:846
       gfs2_file_buffered_write+0x4fe/0x880 fs/gfs2/file.c:1057
       gfs2_file_write_iter+0x42c/0xdf0 fs/gfs2/file.c:1158
       call_write_iter include/linux/fs.h:2265 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x44c/0x960 fs/read_write.c:584
       ksys_write+0x143/0x240 fs/read_write.c:637
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&ip->i_rw_mutex);
                               lock(&sdp->sd_quota_mutex);
                               lock(&ip->i_rw_mutex);
  lock(&sdp->sd_quota_mutex);

 *** DEADLOCK ***

6 locks held by syz.3.512/6554:
 #0: ffff88807d183768 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2ae/0x360 fs/file.c:1040
 #1: ffff88807d236460 (sb_writers#26){.+.+}-{0:0}, at: vfs_write+0x256/0x960 fs/read_write.c:580
 #2: ffff888054334b38 (&sb->s_type->i_mutex_key#33){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
 #2: ffff888054334b38 (&sb->s_type->i_mutex_key#33){+.+.}-{3:3}, at: gfs2_file_write_iter+0x308/0xdf0 fs/gfs2/file.c:1115
 #3: ffff88807d236650 (sb_internal#6){.+.+}-{0:0}, at: gfs2_trans_begin+0x6b/0xe0 fs/gfs2/trans.c:118
 #4: ffff888029765058 (&sdp->sd_log_flush_lock){.+.+}-{3:3}, at: __gfs2_trans_begin+0x50d/0x880 fs/gfs2/trans.c:87
 #5: ffff888054334fd0 (&ip->i_rw_mutex){++++}-{3:3}, at: sweep_bh_for_rgrps fs/gfs2/bmap.c:1512 [inline]
 #5: ffff888054334fd0 (&ip->i_rw_mutex){++++}-{3:3}, at: punch_hole+0x241b/0x35c0 fs/gfs2/bmap.c:1837

stack backtrace:
CPU: 1 PID: 6554 Comm: syz.3.512 Not tainted 6.1.148-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2170
 check_prev_add kernel/locking/lockdep.c:3090 [inline]
 check_prevs_add kernel/locking/lockdep.c:3209 [inline]
 validate_chain kernel/locking/lockdep.c:3825 [inline]
 __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x120/0xaf0 kernel/locking/mutex.c:747
 do_qc+0xca/0x730 fs/gfs2/quota.c:682
 gfs2_quota_change+0x2f5/0x8e0 fs/gfs2/quota.c:1295
 punch_hole+0x304c/0x35c0 fs/gfs2/bmap.c:1938
 gfs2_iomap_end+0x4f2/0x6b0 fs/gfs2/bmap.c:1157
 iomap_iter+0x21a/0x1040 fs/iomap/iter.c:79
 iomap_file_buffered_write+0x74a/0x880 fs/iomap/buffered-io.c:846
 gfs2_file_buffered_write+0x4fe/0x880 fs/gfs2/file.c:1057
 gfs2_file_write_iter+0x42c/0xdf0 fs/gfs2/file.c:1158
 call_write_iter include/linux/fs.h:2265 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x44c/0x960 fs/read_write.c:584
 ksys_write+0x143/0x240 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7ff5e418ebe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff5e50ae038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ff5e43b5fa0 RCX: 00007ff5e418ebe9
RDX: 000000000208e24b RSI: 0000200000000040 RDI: 0000000000000004
RBP: 00007ff5e4211e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ff5e43b6038 R14: 00007ff5e43b5fa0 R15: 00007ffc3bad47e8
 </TASK>

Crashes (639):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/26 02:12 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2025/08/24 03:13 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2025/08/21 05:11 linux-6.1.y 0bc96de781b4 0b9605c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2025/08/20 01:32 linux-6.1.y 0bc96de781b4 254a27c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2025/08/18 14:53 linux-6.1.y 0bc96de781b4 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2025/08/31 07:09 linux-6.1.y f89b6e15694c 807a3b61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/31 03:39 linux-6.1.y f89b6e15694c 807a3b61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/31 01:08 linux-6.1.y f89b6e15694c 807a3b61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/30 23:48 linux-6.1.y f89b6e15694c 807a3b61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/30 02:58 linux-6.1.y f89b6e15694c 807a3b61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/29 21:08 linux-6.1.y f89b6e15694c 3e1beec6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/29 14:59 linux-6.1.y f89b6e15694c 3e1beec6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/29 00:50 linux-6.1.y f89b6e15694c d401b9d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/29 00:46 linux-6.1.y f89b6e15694c d401b9d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/28 12:56 linux-6.1.y 0bc96de781b4 e12e5ba4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/27 21:03 linux-6.1.y 0bc96de781b4 e12e5ba4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/27 17:32 linux-6.1.y 0bc96de781b4 e12e5ba4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/27 04:52 linux-6.1.y 0bc96de781b4 e12e5ba4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/26 21:02 linux-6.1.y 0bc96de781b4 e12e5ba4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/26 13:13 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/26 09:52 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/26 08:05 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/26 00:37 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/26 00:35 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/25 12:46 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/25 07:35 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/25 02:33 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/24 18:56 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/24 16:46 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/24 05:13 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/24 01:05 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/23 21:15 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/23 06:56 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/22 16:04 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/22 16:04 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/22 10:39 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/22 08:03 linux-6.1.y 0bc96de781b4 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/21 17:32 linux-6.1.y 0bc96de781b4 3e79b825 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/20 23:14 linux-6.1.y 0bc96de781b4 0b9605c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/20 19:15 linux-6.1.y 0bc96de781b4 0b9605c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/20 19:12 linux-6.1.y 0bc96de781b4 0b9605c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/20 06:35 linux-6.1.y 0bc96de781b4 79512909 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/19 17:07 linux-6.1.y 0bc96de781b4 254a27c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/19 09:26 linux-6.1.y 0bc96de781b4 523f460e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/19 06:42 linux-6.1.y 0bc96de781b4 523f460e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/19 06:37 linux-6.1.y 0bc96de781b4 523f460e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/18 22:02 linux-6.1.y 0bc96de781b4 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/18 16:44 linux-6.1.y 0bc96de781b4 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/18 07:57 linux-6.1.y 0bc96de781b4 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2025/08/18 05:57 linux-6.1.y 0bc96de781b4 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/04/28 01:25 linux-6.1.y f2295faba5e8 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
* Struck through repros no longer work on HEAD.