syzbot


possible deadlock in ocfs2_extend_allocation

Status: upstream: reported syz repro on 2025/07/17 00:00
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+85970ea43f222f9d33e4@syzkaller.appspotmail.com
First crash: 35d, last: 2d17h
Bug presence (1)
Date Name Commit Repro Result
2025/08/10 upstream (ToT) 561c80369df0 syz [report] possible deadlock in ocfs2_extend_allocation
Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in ocfs2_extend_allocation ocfs2 4 C 8 2d13h 32d 0/29 upstream: reported C repro on 2025/07/20 14:32
linux-6.1 possible deadlock in ocfs2_extend_allocation 4 syz 13 2d03h 36d 0/3 upstream: reported syz repro on 2025/07/16 17:32
Last patch testing requests (1)
Created Duration User Patch Repo Result
2025/08/01 07:02 13m retest repro linux-5.15.y report log

Sample crash report:
(syz.4.37,4477,0):ocfs2_block_check_validate:402 ERROR: CRC32 failed: stored: 0x3c8d1ba1, computed 0xb76e9bd7. Applying ECC.
(syz.4.37,4477,1):ocfs2_block_check_validate:402 ERROR: CRC32 failed: stored: 0x98842a5e, computed 0xe74db1cd. Applying ECC.
======================================================
WARNING: possible circular locking dependency detected
5.15.189-syzkaller #0 Not tainted
------------------------------------------------------
syz.4.37/4477 is trying to acquire lock:
ffff888023a2a650 (sb_internal#2){.+.+}-{0:0}, at: ocfs2_extend_allocation+0x6cb/0x1760 fs/ocfs2/file.c:596

but task is already holding lock:
ffff88806ffad108 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
ffff88806ffad108 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x161/0x4350 fs/ocfs2/suballoc.c:782

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #7 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}:
       down_write+0x38/0x60 kernel/locking/rwsem.c:1551
       inode_lock include/linux/fs.h:787 [inline]
       ocfs2_reserve_suballoc_bits+0x161/0x4350 fs/ocfs2/suballoc.c:782
       ocfs2_reserve_cluster_bitmap_bits fs/ocfs2/suballoc.c:1128 [inline]
       ocfs2_reserve_clusters_with_limit+0x2f8/0xba0 fs/ocfs2/suballoc.c:1173
       ocfs2_reserve_clusters fs/ocfs2/suballoc.c:1223 [inline]
       ocfs2_lock_allocators+0x2f7/0x5b0 fs/ocfs2/suballoc.c:2669
       ocfs2_extend_allocation+0x397/0x1760 fs/ocfs2/file.c:588
       ocfs2_extend_no_holes+0x20b/0x490 fs/ocfs2/file.c:1030
       ocfs2_acquire_dquot+0x5fe/0xaf0 fs/ocfs2/quota_global.c:841
       dqget+0x778/0xeb0 fs/quota/dquot.c:988
       ocfs2_setattr+0xc93/0x1a10 fs/ocfs2/file.c:1236
       notify_change+0xbcd/0xee0 fs/attr.c:505
       chown_common+0x483/0x610 fs/open.c:680
       vfs_fchown fs/open.c:748 [inline]
       ksys_fchown+0xe2/0x150 fs/open.c:759
       __do_sys_fchown fs/open.c:767 [inline]
       __se_sys_fchown fs/open.c:765 [inline]
       __x64_sys_fchown+0x76/0x80 fs/open.c:765
       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

-> #6 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}:
       down_write+0x38/0x60 kernel/locking/rwsem.c:1551
       ocfs2_lock_global_qf+0x1e5/0x270 fs/ocfs2/quota_global.c:314
       ocfs2_acquire_dquot+0x29d/0xaf0 fs/ocfs2/quota_global.c:816
       dqget+0x778/0xeb0 fs/quota/dquot.c:988
       ocfs2_setattr+0xc93/0x1a10 fs/ocfs2/file.c:1236
       notify_change+0xbcd/0xee0 fs/attr.c:505
       chown_common+0x483/0x610 fs/open.c:680
       vfs_fchown fs/open.c:748 [inline]
       ksys_fchown+0xe2/0x150 fs/open.c:759
       __do_sys_fchown fs/open.c:767 [inline]
       __se_sys_fchown fs/open.c:765 [inline]
       __x64_sys_fchown+0x76/0x80 fs/open.c:765
       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

-> #5 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}:
       down_write+0x38/0x60 kernel/locking/rwsem.c:1551
       inode_lock include/linux/fs.h:787 [inline]
       ocfs2_lock_global_qf+0x1c7/0x270 fs/ocfs2/quota_global.c:313
       ocfs2_acquire_dquot+0x29d/0xaf0 fs/ocfs2/quota_global.c:816
       dqget+0x778/0xeb0 fs/quota/dquot.c:988
       ocfs2_setattr+0xc93/0x1a10 fs/ocfs2/file.c:1236
       notify_change+0xbcd/0xee0 fs/attr.c:505
       chown_common+0x483/0x610 fs/open.c:680
       vfs_fchown fs/open.c:748 [inline]
       ksys_fchown+0xe2/0x150 fs/open.c:759
       __do_sys_fchown fs/open.c:767 [inline]
       __se_sys_fchown fs/open.c:765 [inline]
       __x64_sys_fchown+0x76/0x80 fs/open.c:765
       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 (&dquot->dq_lock){+.+.}-{3:3}:
       __mutex_lock_common+0x1eb/0x2390 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+0x1e1/0x480 fs/quota/dquot.c:2146
       ext4_setattr+0x72a/0x19e0 fs/ext4/inode.c:5452
       notify_change+0xbcd/0xee0 fs/attr.c:505
       chown_common+0x483/0x610 fs/open.c:680
       vfs_fchown fs/open.c:748 [inline]
       ksys_fchown+0xe2/0x150 fs/open.c:759
       __do_sys_fchown fs/open.c:767 [inline]
       __se_sys_fchown fs/open.c:765 [inline]
       __x64_sys_fchown+0x76/0x80 fs/open.c:765
       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

-> #3 (&ei->xattr_sem){++++}-{3:3}:
       down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498
       ext4_setattr+0x71d/0x19e0 fs/ext4/inode.c:5451
       notify_change+0xbcd/0xee0 fs/attr.c:505
       chown_common+0x483/0x610 fs/open.c:680
       do_fchownat+0x164/0x270 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

-> #2 (jbd2_handle){++++}-{0:0}:
       start_this_handle+0x1338/0x15a0 fs/jbd2/transaction.c:464
       jbd2__journal_start+0x2b7/0x5a0 fs/jbd2/transaction.c:521
       jbd2_journal_start+0x26/0x30 fs/jbd2/transaction.c:560
       ocfs2_start_trans+0x374/0x6c0 fs/ocfs2/journal.c:376
       ocfs2_modify_bh+0xe5/0x470 fs/ocfs2/quota_local.c:101
       ocfs2_local_read_info+0x13b1/0x16e0 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+0x1c3/0x440 fs/ocfs2/super.c:927
       ocfs2_fill_super+0x3a1f/0x4d80 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:3014
       do_mount fs/namespace.c:3357 [inline]
       __do_sys_mount fs/namespace.c:3565 [inline]
       __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3542
       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 (&journal->j_trans_barrier){.+.+}-{3:3}:
       down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498
       ocfs2_start_trans+0x368/0x6c0 fs/ocfs2/journal.c:374
       ocfs2_modify_bh+0xe5/0x470 fs/ocfs2/quota_local.c:101
       ocfs2_local_read_info+0x13b1/0x16e0 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+0x1c3/0x440 fs/ocfs2/super.c:927
       ocfs2_fill_super+0x3a1f/0x4d80 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:3014
       do_mount fs/namespace.c:3357 [inline]
       __do_sys_mount fs/namespace.c:3565 [inline]
       __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3542
       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 (sb_internal#2){.+.+}-{0:0}:
       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+0x2c33/0x7c60 kernel/locking/lockdep.c:5012
       lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
       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+0x269/0x6c0 fs/ocfs2/journal.c:372
       ocfs2_extend_allocation+0x6cb/0x1760 fs/ocfs2/file.c:596
       ocfs2_extend_no_holes+0x20b/0x490 fs/ocfs2/file.c:1030
       ocfs2_acquire_dquot+0x5fe/0xaf0 fs/ocfs2/quota_global.c:841
       dqget+0x778/0xeb0 fs/quota/dquot.c:988
       ocfs2_setattr+0xc93/0x1a10 fs/ocfs2/file.c:1236
       notify_change+0xbcd/0xee0 fs/attr.c:505
       chown_common+0x483/0x610 fs/open.c:680
       vfs_fchown fs/open.c:748 [inline]
       ksys_fchown+0xe2/0x150 fs/open.c:759
       __do_sys_fchown fs/open.c:767 [inline]
       __se_sys_fchown fs/open.c:765 [inline]
       __x64_sys_fchown+0x76/0x80 fs/open.c:765
       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:
  sb_internal#2 --> &ocfs2_quota_ip_alloc_sem_key --> &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3);
                               lock(&ocfs2_quota_ip_alloc_sem_key);
                               lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3);
  lock(sb_internal#2);

 *** DEADLOCK ***

6 locks held by syz.4.37/4477:
 #0: ffff888023a2a460 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write_file+0x5c/0x200 fs/namespace.c:421
 #1: ffff88806ffa89c8 (&type->i_mutex_dir_key#8){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #1: ffff88806ffa89c8 (&type->i_mutex_dir_key#8){+.+.}-{3:3}, at: chown_common+0x3c6/0x610 fs/open.c:674
 #2: ffff88806fda60a8 (&dquot->dq_lock){+.+.}-{3:3}, at: ocfs2_acquire_dquot+0x290/0xaf0 fs/ocfs2/quota_global.c:811
 #3: ffff88806ffadf48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #3: ffff88806ffadf48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_lock_global_qf+0x1c7/0x270 fs/ocfs2/quota_global.c:313
 #4: ffff88806ffadbe0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_lock_global_qf+0x1e5/0x270 fs/ocfs2/quota_global.c:314
 #5: ffff88806ffad108 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #5: ffff88806ffad108 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x161/0x4350 fs/ocfs2/suballoc.c:782

stack backtrace:
CPU: 1 PID: 4477 Comm: syz.4.37 Not tainted 5.15.189-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 check_noncircular+0x274/0x310 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+0x2c33/0x7c60 kernel/locking/lockdep.c:5012
 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
 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+0x269/0x6c0 fs/ocfs2/journal.c:372
 ocfs2_extend_allocation+0x6cb/0x1760 fs/ocfs2/file.c:596
 ocfs2_extend_no_holes+0x20b/0x490 fs/ocfs2/file.c:1030
 ocfs2_acquire_dquot+0x5fe/0xaf0 fs/ocfs2/quota_global.c:841
 dqget+0x778/0xeb0 fs/quota/dquot.c:988
 ocfs2_setattr+0xc93/0x1a10 fs/ocfs2/file.c:1236
 notify_change+0xbcd/0xee0 fs/attr.c:505
 chown_common+0x483/0x610 fs/open.c:680
 vfs_fchown fs/open.c:748 [inline]
 ksys_fchown+0xe2/0x150 fs/open.c:759
 __do_sys_fchown fs/open.c:767 [inline]
 __se_sys_fchown fs/open.c:765 [inline]
 __x64_sys_fchown+0x76/0x80 fs/open.c:765
 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:0x7f695a474be9
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:00007f6959ae4038 EFLAGS: 00000246 ORIG_RAX: 000000000000005d
RAX: ffffffffffffffda RBX: 00007f695a69bfa0 RCX: 00007f695a474be9
RDX: 000000003d657a0a RSI: 000000003a736e6f RDI: 0000000000000004
RBP: 00007f695a4f7e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f695a69c038 R14: 00007f695a69bfa0 R15: 00007ffc9f4f7308
 </TASK>
(syz.4.37,4477,0):ocfs2_block_check_validate:402 ERROR: CRC32 failed: stored: 0xdf8356d3, computed 0x135eb329. Applying ECC.
(syz.4.37,4477,0):ocfs2_block_check_validate:416 ERROR: Fixed CRC32 failed: stored: 0xdf8356d3, computed 0x8e0ad45b
(syz.4.37,4477,0):ocfs2_read_quota_phys_block:160 ERROR: status = -5
(syz.4.37,4477,0):ocfs2_quota_read:201 ERROR: status = -5
Quota error (device loop4): qtree_write_dquot: Error -5 occurred while creating quota
(syz.4.37,4477,1):ocfs2_acquire_dquot:878 ERROR: status = -5

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/09 05:39 linux-5.15.y c79648372d02 32a0e5ed .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro #1 (clean fs)] [mounted in repro #2 (clean fs)] ci2-linux-5-15-kasan possible deadlock in ocfs2_extend_allocation
2025/07/17 09:49 linux-5.15.y 89950c454265 44f8051e .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro #1 (clean fs)] [mounted in repro #2 (clean fs)] ci2-linux-5-15-kasan-arm64 possible deadlock in ocfs2_extend_allocation
2025/08/19 03:43 linux-5.15.y c79648372d02 523f460e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ocfs2_extend_allocation
2025/08/09 04:21 linux-5.15.y c79648372d02 32a0e5ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ocfs2_extend_allocation
2025/07/17 01:25 linux-5.15.y 89950c454265 44f8051e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ocfs2_extend_allocation
2025/08/15 09:29 linux-5.15.y c79648372d02 1804e95e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ocfs2_extend_allocation
2025/08/14 17:26 linux-5.15.y c79648372d02 5d8c2ac2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ocfs2_extend_allocation
2025/08/11 21:54 linux-5.15.y c79648372d02 c06e8995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ocfs2_extend_allocation
2025/07/17 01:21 linux-5.15.y 89950c454265 44f8051e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ocfs2_extend_allocation
2025/07/17 00:00 linux-5.15.y 89950c454265 44f8051e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ocfs2_extend_allocation
2025/07/16 23:59 linux-5.15.y 89950c454265 44f8051e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ocfs2_extend_allocation
* Struck through repros no longer work on HEAD.