syzbot


possible deadlock in do_qc

Status: upstream: reported on 2024/04/28 01:25
Reported-by: syzbot+bdc96b32d35cce7a6064@syzkaller.appspotmail.com
First crash: 242d, last: 6h43m
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in do_qc gfs2 785 135d 263d 0/28 auto-obsoleted due to no activity on 2024/10/22 09:11
linux-5.15 possible deadlock in do_qc 410 4d09h 242d 0/3 upstream: reported on 2024/04/27 22:18

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.1.121-syzkaller #0 Tainted: G        W         
------------------------------------------------------
syz.4.618/6410 is trying to acquire lock:
ffff8880787acae0 (&sdp->sd_quota_mutex){+.+.}-{3:3}, at: do_qc+0xc8/0x720 fs/gfs2/quota.c:682

but task is already holding lock:
ffff888055339a10 (&ip->i_rw_mutex){++++}-{3:3}, at: sweep_bh_for_rgrps fs/gfs2/bmap.c:1512 [inline]
ffff888055339a10 (&ip->i_rw_mutex){++++}-{3:3}, at: punch_hole+0x27e9/0x3ab0 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}:
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
       down_read+0xad/0xa30 kernel/locking/rwsem.c:1520
       __gfs2_iomap_get+0x178/0x1480 fs/gfs2/bmap.c:856
       gfs2_iomap_get+0xdb/0x150 fs/gfs2/bmap.c:1396
       bh_get+0x286/0x800 fs/gfs2/quota.c:385
       qdsb_get+0x209/0x3b0 fs/gfs2/quota.c:522
       gfs2_quota_hold+0x19d/0x5c0 fs/gfs2/quota.c:608
       punch_hole+0xebd/0x3ab0 fs/gfs2/bmap.c:1798
       do_shrink+0x844/0x9b0 fs/gfs2/bmap.c:2018
       gfs2_setattr_size+0x151/0x8d0 fs/gfs2/bmap.c:2142
       gfs2_setattr+0x258/0x410 fs/gfs2/inode.c:2002
       notify_change+0xce3/0xfc0 fs/attr.c:499
       do_truncate+0x21c/0x300 fs/open.c:65
       handle_truncate fs/namei.c:3285 [inline]
       do_open fs/namei.c:3630 [inline]
       path_openat+0x27e2/0x2e60 fs/namei.c:3783
       do_filp_open+0x230/0x480 fs/namei.c:3810
       do_sys_openat2+0x13b/0x4f0 fs/open.c:1318
       do_sys_open fs/open.c:1334 [inline]
       __do_sys_openat fs/open.c:1350 [inline]
       __se_sys_openat fs/open.c:1345 [inline]
       __x64_sys_openat+0x243/0x290 fs/open.c:1345
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x3b/0xb0 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+0x1661/0x5950 kernel/locking/lockdep.c:3825
       __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747
       do_qc+0xc8/0x720 fs/gfs2/quota.c:682
       gfs2_quota_change+0x2db/0x8c0 fs/gfs2/quota.c:1295
       punch_hole+0x344a/0x3ab0 fs/gfs2/bmap.c:1938
       do_shrink+0x844/0x9b0 fs/gfs2/bmap.c:2018
       gfs2_setattr_size+0x151/0x8d0 fs/gfs2/bmap.c:2142
       gfs2_setattr+0x258/0x410 fs/gfs2/inode.c:2002
       notify_change+0xce3/0xfc0 fs/attr.c:499
       do_truncate+0x21c/0x300 fs/open.c:65
       handle_truncate fs/namei.c:3285 [inline]
       do_open fs/namei.c:3630 [inline]
       path_openat+0x27e2/0x2e60 fs/namei.c:3783
       do_filp_open+0x230/0x480 fs/namei.c:3810
       do_sys_openat2+0x13b/0x4f0 fs/open.c:1318
       do_sys_open fs/open.c:1334 [inline]
       __do_sys_openat fs/open.c:1350 [inline]
       __se_sys_openat fs/open.c:1345 [inline]
       __x64_sys_openat+0x243/0x290 fs/open.c:1345
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x3b/0xb0 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 ***

5 locks held by syz.4.618/6410:
 #0: ffff888056af8460 (sb_writers#27){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393
 #1: ffff888055339578 (&sb->s_type->i_mutex_key#34){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
 #1: ffff888055339578 (&sb->s_type->i_mutex_key#34){+.+.}-{3:3}, at: do_truncate+0x208/0x300 fs/open.c:63
 #2: ffff888056af8650 (sb_internal#6){.+.+}-{0:0}, at: gfs2_trans_begin+0x6d/0xe0 fs/gfs2/trans.c:118
 #3: ffff8880787ad058 (&sdp->sd_log_flush_lock){.+.+}-{3:3}, at: __gfs2_trans_begin+0x558/0x940 fs/gfs2/trans.c:87
 #4: ffff888055339a10 (&ip->i_rw_mutex){++++}-{3:3}, at: sweep_bh_for_rgrps fs/gfs2/bmap.c:1512 [inline]
 #4: ffff888055339a10 (&ip->i_rw_mutex){++++}-{3:3}, at: punch_hole+0x27e9/0x3ab0 fs/gfs2/bmap.c:1837

stack backtrace:
CPU: 1 PID: 6410 Comm: syz.4.618 Tainted: G        W          6.1.121-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 check_noncircular+0x2fa/0x3b0 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+0x1661/0x5950 kernel/locking/lockdep.c:3825
 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747
 do_qc+0xc8/0x720 fs/gfs2/quota.c:682
 gfs2_quota_change+0x2db/0x8c0 fs/gfs2/quota.c:1295
 punch_hole+0x344a/0x3ab0 fs/gfs2/bmap.c:1938
 do_shrink+0x844/0x9b0 fs/gfs2/bmap.c:2018
 gfs2_setattr_size+0x151/0x8d0 fs/gfs2/bmap.c:2142
 gfs2_setattr+0x258/0x410 fs/gfs2/inode.c:2002
 notify_change+0xce3/0xfc0 fs/attr.c:499
 do_truncate+0x21c/0x300 fs/open.c:65
 handle_truncate fs/namei.c:3285 [inline]
 do_open fs/namei.c:3630 [inline]
 path_openat+0x27e2/0x2e60 fs/namei.c:3783
 do_filp_open+0x230/0x480 fs/namei.c:3810
 do_sys_openat2+0x13b/0x4f0 fs/open.c:1318
 do_sys_open fs/open.c:1334 [inline]
 __do_sys_openat fs/open.c:1350 [inline]
 __se_sys_openat fs/open.c:1345 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1345
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f3b93b85d29
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:00007f3b949da038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f3b93d76080 RCX: 00007f3b93b85d29
RDX: 0000000000000700 RSI: 0000000020000100 RDI: ffffffffffffff9c
RBP: 00007f3b93c01aa8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f3b93d76080 R15: 00007fffc4aa90b8
 </TASK>

Crashes (236):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/26 03:05 linux-6.1.y 29f02ec58a94 444551c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2024/12/24 22:52 linux-6.1.y 29f02ec58a94 444551c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2024/12/04 04:20 linux-6.1.y e4d90d63d385 b50eb251 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2024/11/28 18:38 linux-6.1.y e4d90d63d385 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2024/11/22 14:52 linux-6.1.y b67dc5c9ade9 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2024/11/22 00:55 linux-6.1.y b67dc5c9ade9 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2024/11/20 22:35 linux-6.1.y b67dc5c9ade9 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2024/11/01 15:32 linux-6.1.y 7c15117f9468 96eb609f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2024/10/23 12:07 linux-6.1.y 7ec6f9fa3d97 15fa2979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2024/10/18 05:46 linux-6.1.y 54d90d17e8ce 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in do_qc
2024/12/25 19:47 linux-6.1.y 29f02ec58a94 444551c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/12/25 15:14 linux-6.1.y 29f02ec58a94 444551c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/12/25 10:41 linux-6.1.y 29f02ec58a94 444551c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/12/24 20:32 linux-6.1.y 29f02ec58a94 444551c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/12/23 07:11 linux-6.1.y 29f02ec58a94 b4fbdbd4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/12/14 18:30 linux-6.1.y e4d90d63d385 7cbfbb3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/12/14 01:16 linux-6.1.y e4d90d63d385 7cbfbb3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/12/11 01:58 linux-6.1.y e4d90d63d385 cfc402b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/12/09 05:22 linux-6.1.y e4d90d63d385 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/12/08 12:37 linux-6.1.y e4d90d63d385 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/12/07 08:35 linux-6.1.y e4d90d63d385 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/12/03 00:01 linux-6.1.y e4d90d63d385 b499ea68 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/28 10:42 linux-6.1.y e4d90d63d385 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/26 18:45 linux-6.1.y e4d90d63d385 e9a9a9f2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/25 03:28 linux-6.1.y e4d90d63d385 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/24 14:56 linux-6.1.y e4d90d63d385 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/23 06:29 linux-6.1.y e4d90d63d385 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/23 06:27 linux-6.1.y e4d90d63d385 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/22 10:16 linux-6.1.y b67dc5c9ade9 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/21 21:37 linux-6.1.y b67dc5c9ade9 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/19 12:06 linux-6.1.y b67dc5c9ade9 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/18 07:04 linux-6.1.y b67dc5c9ade9 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/18 02:13 linux-6.1.y b67dc5c9ade9 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/17 14:37 linux-6.1.y 59d7b1a7104a cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/15 15:03 linux-6.1.y 59d7b1a7104a f6ede3a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/14 03:35 linux-6.1.y d7039b844a1c bb3f8425 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/10 06:35 linux-6.1.y d7039b844a1c 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/07 09:33 linux-6.1.y 7c15117f9468 df3dc63b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/04 21:37 linux-6.1.y 7c15117f9468 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/11/03 15:14 linux-6.1.y 7c15117f9468 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/10/31 21:39 linux-6.1.y 7ec6f9fa3d97 96eb609f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/10/28 02:28 linux-6.1.y 7ec6f9fa3d97 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/10/28 01:00 linux-6.1.y 7ec6f9fa3d97 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/10/27 14:53 linux-6.1.y 7ec6f9fa3d97 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in do_qc
2024/10/25 22:12 linux-6.1.y 7ec6f9fa3d97 045e728d .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.