syzbot


possible deadlock in dqget

Status: upstream: reported on 2026/01/23 21:59
Reported-by: syzbot+979992e1fff5cc2b1a55@syzkaller.appspotmail.com
First crash: 2d17h, last: 2d17h
Similar bugs (5)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.6 possible deadlock in dqget 4 26 18d 220d 0/2 upstream: reported on 2025/06/20 12:37
linux-6.1 possible deadlock in dqget 4 1 363d 363d 0/3 auto-obsoleted due to no activity on 2025/05/07 22:20
upstream possible deadlock in dqget ocfs2 ext4 4 C error 100357 28d 482d 29/29 fixed on 2026/01/07 12:29
upstream possible deadlock in dqget (2) fs 4 1 6d14h 2d14h 0/29 upstream: reported on 2026/01/24 00:53
linux-6.1 possible deadlock in dqget (2) 4 11 95d 209d 0/3 upstream: reported on 2025/06/30 17:34

Sample crash report:
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue. Quota mode: writeback.
ext4 filesystem being mounted at /1938/file0 supports timestamps until 2038-01-19 (0x7fffffff)
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.9913/29427 is trying to acquire lock:
ffff88805e1153e8 (&dquot->dq_lock){+.+.}-{3:3}, at: wait_on_dquot fs/quota/dquot.c:356 [inline]
ffff88805e1153e8 (&dquot->dq_lock){+.+.}-{3:3}, at: dqget+0x6f8/0xeb0 fs/quota/dquot.c:983

but task is already holding lock:
ffff88805e2914b8 (&ei->xattr_sem){++++}-{3:3}
, at: ext4_setattr+0x71d/0x19e0 fs/ext4/inode.c:5469

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #5 (&ei->xattr_sem){++++}-{3:3}:
       down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498
       ext4_setattr+0x71d/0x19e0 fs/ext4/inode.c:5469
       notify_change+0xbcd/0xee0 fs/attr.c:505
       chown_common+0x4a7/0x660 fs/open.c:680
       do_fchownat+0x147/0x240 fs/open.c:711
       __do_sys_chown fs/open.c:731 [inline]
       __se_sys_chown fs/open.c:729 [inline]
       __x64_sys_chown+0x7e/0x90 fs/open.c:729
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #4 (jbd2_handle){++++}-{0:0}:
       jbd2_log_wait_commit+0x168/0x4c0 fs/jbd2/journal.c:697
       jbd2_journal_stop+0x818/0xd20 fs/jbd2/transaction.c:1974
       ocfs2_commit_trans+0xc2/0x240 fs/ocfs2/journal.c:404
       ocfs2_complete_local_alloc_recovery+0x2d4/0x580 fs/ocfs2/localalloc.c:587
       ocfs2_complete_recovery+0x6f5/0x2120 fs/ocfs2/journal.c:1294
       process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
       worker_thread+0xaa6/0x1290 kernel/workqueue.c:2457
       kthread+0x436/0x520 kernel/kthread.c:334
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #3 (&journal->j_trans_barrier){.+.+}-{3:3}:
       down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498
       ocfs2_start_trans+0x3a6/0x6f0 fs/ocfs2/journal.c:374
       ocfs2_modify_bh+0xe0/0x4c0 fs/ocfs2/quota_local.c:101
       ocfs2_local_read_info+0x13c8/0x1750 fs/ocfs2/quota_local.c:764
       dquot_load_quota_sb+0x756/0xac0 fs/quota/dquot.c:2463
       dquot_load_quota_inode+0x2d8/0x5d0 fs/quota/dquot.c:2500
       ocfs2_enable_quotas+0x1c5/0x490 fs/ocfs2/super.c:927
       ocfs2_fill_super+0x3cd2/0x50f0 fs/ocfs2/super.c:1140
       mount_bdev+0x287/0x3c0 fs/super.c:1400
       legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
       vfs_get_tree+0x88/0x270 fs/super.c:1530
       do_new_mount+0x24a/0xa40 fs/namespace.c:3034
       do_mount fs/namespace.c:3377 [inline]
       __do_sys_mount fs/namespace.c:3585 [inline]
       __se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #2 (sb_internal#2){.+.+}-{0:0}:
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1811 [inline]
       sb_start_intwrite include/linux/fs.h:1928 [inline]
       ocfs2_start_trans+0x2a7/0x6f0 fs/ocfs2/journal.c:372
       ocfs2_write_info+0x112/0x360 fs/ocfs2/quota_global.c:982
       dquot_set_dqinfo+0x459/0x6c0 fs/quota/dquot.c:2904
       quota_setinfo+0x2cf/0x2e0 fs/quota/quota.c:173
       __do_sys_quotactl fs/quota/quota.c:959 [inline]
       __se_sys_quotactl+0x28b/0x6f0 fs/quota/quota.c:915
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #1 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}:
       down_write+0x38/0x60 kernel/locking/rwsem.c:1551
       ocfs2_create_local_dquot+0x199/0x1850 fs/ocfs2/quota_local.c:1224
       ocfs2_acquire_dquot+0x7ed/0xb10 fs/ocfs2/quota_global.c:871
       dqget+0x778/0xeb0 fs/quota/dquot.c:988
       dquot_set_dqblk+0x27/0xf90 fs/quota/dquot.c:2826
       quota_setquota+0x4d6/0x590 fs/quota/quota.c:309
       __do_sys_quotactl fs/quota/quota.c:959 [inline]
       __se_sys_quotactl+0x28b/0x6f0 fs/quota/quota.c:915
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (&dquot->dq_lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain kernel/locking/lockdep.c:3788 [inline]
       __lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
       lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       wait_on_dquot fs/quota/dquot.c:356 [inline]
       dqget+0x6f8/0xeb0 fs/quota/dquot.c:983
       dquot_transfer+0x2b8/0x460 fs/quota/dquot.c:2157
       ext4_setattr+0x72a/0x19e0 fs/ext4/inode.c:5470
       notify_change+0xbcd/0xee0 fs/attr.c:505
       chown_common+0x4a7/0x660 fs/open.c:680
       do_fchownat+0x147/0x240 fs/open.c:711
       __do_sys_fchownat fs/open.c:726 [inline]
       __se_sys_fchownat fs/open.c:723 [inline]
       __x64_sys_fchownat+0xb1/0xc0 fs/open.c:723
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Chain exists of:
  
&dquot->dq_lock --> jbd2_handle --> &ei->xattr_sem

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&ei->xattr_sem);
                               lock(jbd2_handle);
                               lock(&ei->xattr_sem);
  lock(
&dquot->dq_lock);

 *** DEADLOCK ***

3 locks held by syz.0.9913/29427:
 #0: 
ffff888078f88460 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:386
 #1: ffff88805e2917e0 (&type->i_mutex_dir_key#4
){++++}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
){++++}-{3:3}, at: chown_common+0x3ea/0x660 fs/open.c:674
 #2: ffff88805e2914b8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_setattr+0x71d/0x19e0 fs/ext4/inode.c:5469

stack backtrace:
CPU: 1 PID: 29427 Comm: syz.0.9913 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain kernel/locking/lockdep.c:3788 [inline]
 __lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
 __mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 wait_on_dquot fs/quota/dquot.c:356 [inline]
 dqget+0x6f8/0xeb0 fs/quota/dquot.c:983
 dquot_transfer+0x2b8/0x460 fs/quota/dquot.c:2157
 ext4_setattr+0x72a/0x19e0 fs/ext4/inode.c:5470
 notify_change+0xbcd/0xee0 fs/attr.c:505
 chown_common+0x4a7/0x660 fs/open.c:680
 do_fchownat+0x147/0x240 fs/open.c:711
 __do_sys_fchownat fs/open.c:726 [inline]
 __se_sys_fchownat fs/open.c:723 [inline]
 __x64_sys_fchownat+0xb1/0xc0 fs/open.c:723
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fbeee265cb9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fbeec4c1028 EFLAGS: 00000246 ORIG_RAX: 0000000000000104
RAX: ffffffffffffffda RBX: 00007fbeee4e0fa0 RCX: 00007fbeee265cb9
RDX: ffffffffffffffff RSI: 0000200000000040 RDI: ffffffffffffff9c
RBP: 00007fbeee2d3bf7 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fbeee4e1038 R14: 00007fbeee4e0fa0 R15: 00007ffeec409478
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/23 21:59 linux-5.15.y 9eec9a14ee10 4f25b9b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in dqget
* Struck through repros no longer work on HEAD.