[v5.15] possible deadlock in ocfs2_lock_global_qf

0 views
Skip to first unread message

syzbot

unread,
Sep 30, 2024, 1:07:25 AM9/30/24
Hello,

syzbot found the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1603f507980000
kernel config: https://syzkaller.appspot.com/x/.config?x=4d3fd5cca89ae935
dashboard link: https://syzkaller.appspot.com/bug?extid=592f061b512950f637fa
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ef5025f3d708/disk-3a592870.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/776fbdad3aa8/vmlinux-3a592870.xz
kernel image: https://storage.googleapis.com/syzbot-assets/79541db5bd16/bzImage-3a592870.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

ocfs2: Mounting device (7,3) on (node local, slot 0) with ordered data mode.
======================================================
WARNING: possible circular locking dependency detected
5.15.167-syzkaller #0 Not tainted
------------------------------------------------------
syz.3.116/4723 is trying to acquire lock:
ffff88807eb9df48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
ffff88807eb9df48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}, at: ocfs2_lock_global_qf+0x202/0x2a0 fs/ocfs2/quota_global.c:313

but task is already holding lock:
ffff88805a2040a8 (&dquot->dq_lock){+.+.}-{3:3}, at: ocfs2_acquire_dquot+0x28c/0xb40 fs/ocfs2/quota_global.c:806

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #6 (&dquot->dq_lock){+.+.}-{3:3}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
dquot_commit+0x57/0x510 fs/quota/dquot.c:507
ext4_write_dquot+0x1fd/0x360 fs/ext4/super.c:6172
mark_dquot_dirty fs/quota/dquot.c:372 [inline]
mark_all_dquot_dirty+0xf7/0x400 fs/quota/dquot.c:412
__dquot_alloc_space+0xdd8/0x1090 fs/quota/dquot.c:1750
dquot_alloc_space_nodirty include/linux/quotaops.h:297 [inline]
dquot_alloc_space include/linux/quotaops.h:310 [inline]
dquot_alloc_block include/linux/quotaops.h:334 [inline]
ext4_mb_new_blocks+0x12d8/0x4d60 fs/ext4/mballoc.c:5742
ext4_ext_map_blocks+0x1b01/0x7630 fs/ext4/extents.c:4318
ext4_map_blocks+0xa66/0x1c70 fs/ext4/inode.c:672
ext4_getblk+0x19f/0x710 fs/ext4/inode.c:869
ext4_bread+0x2a/0x170 fs/ext4/inode.c:922
ext4_append+0x31f/0x5c0 fs/ext4/namei.c:83
ext4_init_new_dir+0x33a/0xa20 fs/ext4/namei.c:3028
ext4_mkdir+0x4f2/0xce0 fs/ext4/namei.c:3074
vfs_mkdir+0x3b6/0x590 fs/namei.c:4065
do_mkdirat+0x260/0x520 fs/namei.c:4090
__do_sys_mkdirat fs/namei.c:4105 [inline]
__se_sys_mkdirat fs/namei.c:4103 [inline]
__x64_sys_mkdirat+0x85/0x90 fs/namei.c:4103
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #5 (&ei->i_data_sem){++++}-{3:3}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
ext4_map_blocks+0x9a2/0x1c70 fs/ext4/inode.c:665
mpage_map_one_extent fs/ext4/inode.c:2407 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2460 [inline]
ext4_writepages+0x160e/0x3d10 fs/ext4/inode.c:2828
do_writepages+0x481/0x730 mm/page-writeback.c:2386
__writeback_single_inode+0x15b/0xe30 fs/fs-writeback.c:1647
writeback_sb_inodes+0xbce/0x1a40 fs/fs-writeback.c:1930
__writeback_inodes_wb+0x114/0x400 fs/fs-writeback.c:2001
wb_writeback+0x465/0xc50 fs/fs-writeback.c:2106
wb_check_background_flush fs/fs-writeback.c:2172 [inline]
wb_do_writeback fs/fs-writeback.c:2260 [inline]
wb_workfn+0xd07/0x1130 fs/fs-writeback.c:2288
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
kthread+0x3f6/0x4f0 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #4 (jbd2_handle){++++}-{0:0}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
start_this_handle+0x12e1/0x1570 fs/jbd2/transaction.c:464
jbd2__journal_start+0x2d1/0x5c0 fs/jbd2/transaction.c:521
jbd2_journal_start+0x25/0x30 fs/jbd2/transaction.c:560
ocfs2_start_trans+0x3c2/0x6f0 fs/ocfs2/journal.c:354
ocfs2_shutdown_local_alloc+0x214/0xa90 fs/ocfs2/localalloc.c:416
ocfs2_dismount_volume+0x1db/0x8b0 fs/ocfs2/super.c:1882
generic_shutdown_super+0x136/0x2c0 fs/super.c:475
kill_block_super+0x7a/0xe0 fs/super.c:1425
deactivate_locked_super+0xa0/0x110 fs/super.c:335
cleanup_mnt+0x44e/0x500 fs/namespace.c:1143
task_work_run+0x129/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307
do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #3 (&journal->j_trans_barrier){.+.+}-{3:3}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
down_read+0x45/0x2e0 kernel/locking/rwsem.c:1498
ocfs2_start_trans+0x3b7/0x6f0 fs/ocfs2/journal.c:352
ocfs2_shutdown_local_alloc+0x214/0xa90 fs/ocfs2/localalloc.c:416
ocfs2_dismount_volume+0x1db/0x8b0 fs/ocfs2/super.c:1882
generic_shutdown_super+0x136/0x2c0 fs/super.c:475
kill_block_super+0x7a/0xe0 fs/super.c:1425
deactivate_locked_super+0xa0/0x110 fs/super.c:335
cleanup_mnt+0x44e/0x500 fs/namespace.c:1143
task_work_run+0x129/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307
do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #2 (sb_internal#3){.+.+}-{0:0}:
lock_acquire+0x1db/0x4f0 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+0x2b2/0x6f0 fs/ocfs2/journal.c:350
ocfs2_write_info+0x124/0x3a0 fs/ocfs2/quota_global.c:977
dquot_set_dqinfo+0x488/0x6f0 fs/quota/dquot.c:2902
quota_setinfo+0x3d6/0x4f0 fs/quota/quota.c:173
__do_sys_quotactl fs/quota/quota.c:959 [inline]
__se_sys_quotactl+0x2b1/0x770 fs/quota/quota.c:915
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #1 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
ocfs2_lock_global_qf+0x221/0x2a0 fs/ocfs2/quota_global.c:314
ocfs2_write_info+0xd2/0x3a0 fs/ocfs2/quota_global.c:974
dquot_set_dqinfo+0x488/0x6f0 fs/quota/dquot.c:2902
quota_setinfo+0x3d6/0x4f0 fs/quota/quota.c:173
__do_sys_quotactl fs/quota/quota.c:959 [inline]
__se_sys_quotactl+0x2b1/0x770 fs/quota/quota.c:915
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:789 [inline]
ocfs2_lock_global_qf+0x202/0x2a0 fs/ocfs2/quota_global.c:313
ocfs2_acquire_dquot+0x299/0xb40 fs/ocfs2/quota_global.c:811
dqget+0x762/0xe90 fs/quota/dquot.c:986
__dquot_initialize+0x2d9/0xea0 fs/quota/dquot.c:1515
ocfs2_get_init_inode+0x154/0x1c0 fs/ocfs2/namei.c:202
ocfs2_mknod+0xdcb/0x2cd0 fs/ocfs2/namei.c:308
ocfs2_mkdir+0x194/0x430 fs/ocfs2/namei.c:655
vfs_mkdir+0x3b6/0x590 fs/namei.c:4065
do_mkdirat+0x260/0x520 fs/namei.c:4090
__do_sys_mkdirat fs/namei.c:4105 [inline]
__se_sys_mkdirat fs/namei.c:4103 [inline]
__x64_sys_mkdirat+0x85/0x90 fs/namei.c:4103
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Chain exists of:
&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4 --> &ei->i_data_sem --> &dquot->dq_lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&dquot->dq_lock);
lock(&ei->i_data_sem);
lock(&dquot->dq_lock);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4);

*** DEADLOCK ***

4 locks held by syz.3.116/4723:
#0: ffff888025088460 (sb_writers#19){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:377
#1: ffff888073a62648 (&type->i_mutex_dir_key#15/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:824 [inline]
#1: ffff888073a62648 (&type->i_mutex_dir_key#15/1){+.+.}-{3:3}, at: filename_create+0x25c/0x530 fs/namei.c:3835
#2: ffff88807eb9a648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
#2: ffff88807eb9a648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x18e/0x4c70 fs/ocfs2/suballoc.c:782
#3: ffff88805a2040a8 (&dquot->dq_lock){+.+.}-{3:3}, at: ocfs2_acquire_dquot+0x28c/0xb40 fs/ocfs2/quota_global.c:806

stack backtrace:
CPU: 0 PID: 4723 Comm: syz.3.116 Not tainted 5.15.167-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/0x2d0 lib/dump_stack.c:106
check_noncircular+0x2f8/0x3b0 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+0x1649/0x5930 kernel/locking/lockdep.c:3788
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:789 [inline]
ocfs2_lock_global_qf+0x202/0x2a0 fs/ocfs2/quota_global.c:313
ocfs2_acquire_dquot+0x299/0xb40 fs/ocfs2/quota_global.c:811
dqget+0x762/0xe90 fs/quota/dquot.c:986
__dquot_initialize+0x2d9/0xea0 fs/quota/dquot.c:1515
ocfs2_get_init_inode+0x154/0x1c0 fs/ocfs2/namei.c:202
ocfs2_mknod+0xdcb/0x2cd0 fs/ocfs2/namei.c:308
ocfs2_mkdir+0x194/0x430 fs/ocfs2/namei.c:655
vfs_mkdir+0x3b6/0x590 fs/namei.c:4065
do_mkdirat+0x260/0x520 fs/namei.c:4090
__do_sys_mkdirat fs/namei.c:4105 [inline]
__se_sys_mkdirat fs/namei.c:4103 [inline]
__x64_sys_mkdirat+0x85/0x90 fs/namei.c:4103
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fcb7c6b8897
Code: 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 02 01 00 00 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:00007fcb7ab31e68 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007fcb7ab31ef0 RCX: 00007fcb7c6b8897
RDX: 00000000000001ff RSI: 0000000020000f00 RDI: 00000000ffffff9c
RBP: 0000000000000000 R08: 0000000020000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000f00
R13: 00007fcb7ab31eb0 R14: 0000000000000000 R15: 0000000000000000
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at [email protected].

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Oct 1, 2024, 2:31:31 PM10/1/24
Hello,

syzbot found the following issue on:

HEAD commit: aa4cd140bba5 Linux 6.1.112
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17623dd0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=33931c04473f8585
dashboard link: https://syzkaller.appspot.com/bug?extid=b90c04eefce88898e5b7
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2a9778339706/disk-aa4cd140.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b568a6da8a9b/vmlinux-aa4cd140.xz
kernel image: https://storage.googleapis.com/syzbot-assets/3c56af7eb2c4/bzImage-aa4cd140.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

JBD2: Ignoring recovery information on journal
ocfs2: Mounting device (7,4) on (node local, slot 0) with ordered data mode.
======================================================
WARNING: possible circular locking dependency detected
6.1.112-syzkaller #0 Not tainted
------------------------------------------------------
syz.4.5870/17354 is trying to acquire lock:
ffff88807531df48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
ffff88807531df48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}, at: ocfs2_lock_global_qf+0x202/0x2a0 fs/ocfs2/quota_global.c:313

but task is already holding lock:
ffff888059bf60a8 (&dquot->dq_lock){+.+.}-{3:3}, at: ocfs2_acquire_dquot+0x2a0/0xb60 fs/ocfs2/quota_global.c:806

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #6 (&dquot->dq_lock){+.+.}-{3:3}:
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
dquot_commit+0x57/0x510 fs/quota/dquot.c:507
ext4_write_dquot+0x1fd/0x360 fs/ext4/super.c:6776
mark_dquot_dirty fs/quota/dquot.c:372 [inline]
mark_all_dquot_dirty+0xf7/0x400 fs/quota/dquot.c:412
__dquot_free_space+0x956/0xe70 fs/quota/dquot.c:1940
dquot_free_space_nodirty include/linux/quotaops.h:379 [inline]
dquot_free_space include/linux/quotaops.h:384 [inline]
dquot_free_block include/linux/quotaops.h:395 [inline]
ext4_mb_clear_bb fs/ext4/mballoc.c:6145 [inline]
ext4_free_blocks+0x1fb8/0x3020 fs/ext4/mballoc.c:6275
ext4_remove_blocks fs/ext4/extents.c:2521 [inline]
ext4_ext_rm_leaf fs/ext4/extents.c:2687 [inline]
ext4_ext_remove_space+0x22bb/0x4f30 fs/ext4/extents.c:2935
ext4_ext_truncate+0x201/0x360 fs/ext4/extents.c:4448
ext4_truncate+0xa1d/0x1290 fs/ext4/inode.c:4288
ext4_process_orphan+0x1aa/0x2d0 fs/ext4/orphan.c:339
ext4_orphan_cleanup+0xb70/0x1400 fs/ext4/orphan.c:474
__ext4_fill_super fs/ext4/super.c:5533 [inline]
ext4_fill_super+0x83ff/0x8b50 fs/ext4/super.c:5664
get_tree_bdev+0x3fe/0x620 fs/super.c:1366
vfs_get_tree+0x88/0x270 fs/super.c:1573
do_new_mount+0x2ba/0xb40 fs/namespace.c:3051
do_mount fs/namespace.c:3394 [inline]
__do_sys_mount fs/namespace.c:3602 [inline]
__se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3579
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

-> #5 (&ei->i_data_sem){++++}-{3:3}:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
down_write+0x36/0x60 kernel/locking/rwsem.c:1573
ext4_map_blocks+0x955/0x1cb0 fs/ext4/inode.c:671
mpage_map_one_extent fs/ext4/inode.c:2433 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2486 [inline]
ext4_writepages+0x1643/0x3de0 fs/ext4/inode.c:2854
do_writepages+0x3a2/0x670 mm/page-writeback.c:2491
__writeback_single_inode+0x15d/0x11e0 fs/fs-writeback.c:1612
writeback_sb_inodes+0xc2b/0x1b20 fs/fs-writeback.c:1903
__writeback_inodes_wb+0x114/0x400 fs/fs-writeback.c:1974
wb_writeback+0x4b1/0xe10 fs/fs-writeback.c:2079
wb_check_background_flush fs/fs-writeback.c:2145 [inline]
wb_do_writeback fs/fs-writeback.c:2233 [inline]
wb_workfn+0xc9e/0x1020 fs/fs-writeback.c:2260
process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

-> #4 (jbd2_handle){++++}-{0:0}:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
start_this_handle+0x1f71/0x21b0 fs/jbd2/transaction.c:463
jbd2__journal_start+0x2d1/0x5c0 fs/jbd2/transaction.c:520
jbd2_journal_start+0x25/0x30 fs/jbd2/transaction.c:559
ocfs2_start_trans+0x3c0/0x6f0 fs/ocfs2/journal.c:354
ocfs2_local_alloc_slide_window fs/ocfs2/localalloc.c:1258 [inline]
ocfs2_reserve_local_alloc_bits+0xc4c/0x29d0 fs/ocfs2/localalloc.c:668
ocfs2_reserve_clusters_with_limit+0x1b4/0xb50 fs/ocfs2/suballoc.c:1162
ocfs2_symlink+0x14e9/0x2f00 fs/ocfs2/namei.c:1906
vfs_symlink+0x247/0x3d0 fs/namei.c:4473
do_symlinkat+0x21e/0x390 fs/namei.c:4502
__do_sys_symlinkat fs/namei.c:4519 [inline]
__se_sys_symlinkat fs/namei.c:4516 [inline]
__x64_sys_symlinkat+0x95/0xa0 fs/namei.c:4516
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

-> #3 (&journal->j_trans_barrier){.+.+}-{3:3}:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
down_read+0xad/0xa30 kernel/locking/rwsem.c:1520
ocfs2_start_trans+0x3b5/0x6f0 fs/ocfs2/journal.c:352
ocfs2_local_alloc_slide_window fs/ocfs2/localalloc.c:1258 [inline]
ocfs2_reserve_local_alloc_bits+0xc4c/0x29d0 fs/ocfs2/localalloc.c:668
ocfs2_reserve_clusters_with_limit+0x1b4/0xb50 fs/ocfs2/suballoc.c:1162
ocfs2_symlink+0x14e9/0x2f00 fs/ocfs2/namei.c:1906
vfs_symlink+0x247/0x3d0 fs/namei.c:4473
do_symlinkat+0x21e/0x390 fs/namei.c:4502
__do_sys_symlinkat fs/namei.c:4519 [inline]
__se_sys_symlinkat fs/namei.c:4516 [inline]
__x64_sys_symlinkat+0x95/0xa0 fs/namei.c:4516
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

-> #2 (sb_internal#6){.+.+}-{0:0}:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
__sb_start_write include/linux/fs.h:1891 [inline]
sb_start_intwrite include/linux/fs.h:2013 [inline]
ocfs2_start_trans+0x2b0/0x6f0 fs/ocfs2/journal.c:350
ocfs2_write_info+0x124/0x3a0 fs/ocfs2/quota_global.c:977
dquot_set_dqinfo+0x488/0x6f0 fs/quota/dquot.c:2909
quota_setinfo+0x3d6/0x4f0 fs/quota/quota.c:174
__do_sys_quotactl fs/quota/quota.c:960 [inline]
__se_sys_quotactl+0x2b1/0x770 fs/quota/quota.c:916
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

-> #1 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
down_write+0x36/0x60 kernel/locking/rwsem.c:1573
ocfs2_lock_global_qf+0x221/0x2a0 fs/ocfs2/quota_global.c:314
ocfs2_write_info+0xd2/0x3a0 fs/ocfs2/quota_global.c:974
dquot_set_dqinfo+0x488/0x6f0 fs/quota/dquot.c:2909
quota_setinfo+0x3d6/0x4f0 fs/quota/quota.c:174
__do_sys_quotactl fs/quota/quota.c:960 [inline]
__se_sys_quotactl+0x2b1/0x770 fs/quota/quota.c:916
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 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{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
down_write+0x36/0x60 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:758 [inline]
ocfs2_lock_global_qf+0x202/0x2a0 fs/ocfs2/quota_global.c:313
ocfs2_acquire_dquot+0x2ad/0xb60 fs/ocfs2/quota_global.c:811
dqget+0x762/0xe90 fs/quota/dquot.c:986
dquot_get_next_dqblk+0xb6/0x3a0 fs/quota/dquot.c:2718
quota_getnextquota+0x2bc/0x6b0 fs/quota/quota.c:250
__do_sys_quotactl fs/quota/quota.c:960 [inline]
__se_sys_quotactl+0x2b1/0x770 fs/quota/quota.c:916
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:

Chain exists of:
&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7 --> &ei->i_data_sem --> &dquot->dq_lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&dquot->dq_lock);
lock(&ei->i_data_sem);
lock(&dquot->dq_lock);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7);

*** DEADLOCK ***

2 locks held by syz.4.5870/17354:
#0: ffff888079dda0e0 (&type->s_umount_key#85){++++}-{3:3}, at: user_get_super+0x11a/0x250 fs/super.c:889
#1: ffff888059bf60a8 (&dquot->dq_lock){+.+.}-{3:3}, at: ocfs2_acquire_dquot+0x2a0/0xb60 fs/ocfs2/quota_global.c:806

stack backtrace:
CPU: 0 PID: 17354 Comm: syz.4.5870 Not tainted 6.1.112-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
down_write+0x36/0x60 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:758 [inline]
ocfs2_lock_global_qf+0x202/0x2a0 fs/ocfs2/quota_global.c:313
ocfs2_acquire_dquot+0x2ad/0xb60 fs/ocfs2/quota_global.c:811
dqget+0x762/0xe90 fs/quota/dquot.c:986
dquot_get_next_dqblk+0xb6/0x3a0 fs/quota/dquot.c:2718
quota_getnextquota+0x2bc/0x6b0 fs/quota/quota.c:250
__do_sys_quotactl fs/quota/quota.c:960 [inline]
__se_sys_quotactl+0x2b1/0x770 fs/quota/quota.c:916
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:0x7f4ddaf7dff9
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:00007f4ddbc9a038 EFLAGS: 00000246 ORIG_RAX: 00000000000000b3
RAX: ffffffffffffffda RBX: 00007f4ddb135f80 RCX: 00007f4ddaf7dff9
RDX: 0000000000000000 RSI: 0000000020000c80 RDI: ffffffff80000900
RBP: 00007f4ddaff0296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f4ddb135f80 R15: 00007ffcb0c794c8

syzbot

unread,
Feb 23, 2025, 2:47:20 PMFeb 23
syzbot has found a reproducer for the following issue on:

HEAD commit: c16c81c81336 Linux 5.15.178
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1785c7a4580000
kernel config: https://syzkaller.appspot.com/x/.config?x=d302c69e93fb6774
dashboard link: https://syzkaller.appspot.com/bug?extid=592f061b512950f637fa
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=178ccdb0580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12efa7a4580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/267e46ee7273/disk-c16c81c8.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/944e289206cf/vmlinux-c16c81c8.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f8cadf62458e/bzImage-c16c81c8.xz
mounted in repro #1: https://storage.googleapis.com/syzbot-assets/bec1b4cd6746/mount_0.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=161357f8580000)
mounted in repro #2: https://storage.googleapis.com/syzbot-assets/a7cb73fbf086/mount_2.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=10f75fdf980000)

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

ocfs2: Mounting device (7,1) on (node local, slot 0) with ordered data mode.
======================================================
WARNING: possible circular locking dependency detected
5.15.178-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor309/4731 is trying to acquire lock:
ffff88806c8d42c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
ffff88806c8d42c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_lock_global_qf+0x202/0x2a0 fs/ocfs2/quota_global.c:313

but task is already holding lock:
ffff88806c9740a8 (&dquot->dq_lock){+.+.}-{3:3}, at: ocfs2_acquire_dquot+0x28c/0xb40 fs/ocfs2/quota_global.c:806

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #6 (&dquot->dq_lock){+.+.}-{3:3}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
dquot_commit+0x57/0x510 fs/quota/dquot.c:507
ext4_write_dquot+0x1fd/0x360 fs/ext4/super.c:6173
mark_dquot_dirty fs/quota/dquot.c:372 [inline]
mark_all_dquot_dirty+0xf7/0x400 fs/quota/dquot.c:412
__dquot_free_space+0x932/0xe40 fs/quota/dquot.c:1942
dquot_free_space_nodirty include/linux/quotaops.h:376 [inline]
dquot_free_space include/linux/quotaops.h:381 [inline]
dquot_free_block include/linux/quotaops.h:392 [inline]
ext4_mb_clear_bb fs/ext4/mballoc.c:6156 [inline]
ext4_free_blocks+0x1f5c/0x2e90 fs/ext4/mballoc.c:6286
ext4_remove_blocks fs/ext4/extents.c:2523 [inline]
ext4_ext_rm_leaf fs/ext4/extents.c:2689 [inline]
ext4_ext_remove_space+0x24da/0x4db0 fs/ext4/extents.c:2937
ext4_ext_truncate+0x191/0x250 fs/ext4/extents.c:4471
ext4_truncate+0x9fd/0x1130 fs/ext4/inode.c:4249
ext4_evict_inode+0xba1/0x1100 fs/ext4/inode.c:289
evict+0x529/0x930 fs/inode.c:622
d_delete_notify include/linux/fsnotify.h:267 [inline]
vfs_rmdir+0x33c/0x460 fs/namei.c:4162
do_rmdir+0x368/0x670 fs/namei.c:4210
__do_sys_rmdir fs/namei.c:4229 [inline]
__se_sys_rmdir fs/namei.c:4227 [inline]
__x64_sys_rmdir+0x45/0x50 fs/namei.c:4227
ocfs2_modify_bh+0xe9/0x4c0 fs/ocfs2/quota_local.c:101
ocfs2_local_read_info+0x1587/0x19e0 fs/ocfs2/quota_local.c:768
dquot_load_quota_sb+0x754/0xb90 fs/quota/dquot.c:2463
dquot_load_quota_inode+0x318/0x600 fs/quota/dquot.c:2500
ocfs2_enable_quotas+0x165/0x440 fs/ocfs2/super.c:927
ocfs2_fill_super+0x4423/0x5890 fs/ocfs2/super.c:1140
mount_bdev+0x2c9/0x3f0 fs/super.c:1400
legacy_get_tree+0xeb/0x180 fs/fs_context.c:611
vfs_get_tree+0x88/0x270 fs/super.c:1530
do_new_mount+0x2ba/0xb40 fs/namespace.c:3012
do_mount fs/namespace.c:3355 [inline]
__do_sys_mount fs/namespace.c:3563 [inline]
__se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3540
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #3 (&journal->j_trans_barrier){.+.+}-{3:3}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
down_read+0x45/0x2e0 kernel/locking/rwsem.c:1498
ocfs2_start_trans+0x3b7/0x6f0 fs/ocfs2/journal.c:352
ocfs2_modify_bh+0xe9/0x4c0 fs/ocfs2/quota_local.c:101
ocfs2_local_read_info+0x1587/0x19e0 fs/ocfs2/quota_local.c:768
dquot_load_quota_sb+0x754/0xb90 fs/quota/dquot.c:2463
dquot_load_quota_inode+0x318/0x600 fs/quota/dquot.c:2500
ocfs2_enable_quotas+0x165/0x440 fs/ocfs2/super.c:927
ocfs2_fill_super+0x4423/0x5890 fs/ocfs2/super.c:1140
mount_bdev+0x2c9/0x3f0 fs/super.c:1400
legacy_get_tree+0xeb/0x180 fs/fs_context.c:611
vfs_get_tree+0x88/0x270 fs/super.c:1530
do_new_mount+0x2ba/0xb40 fs/namespace.c:3012
do_mount fs/namespace.c:3355 [inline]
__do_sys_mount fs/namespace.c:3563 [inline]
__se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3540
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #2 (sb_internal#2){.+.+}-{0:0}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
__sb_start_write include/linux/fs.h:1813 [inline]
sb_start_intwrite include/linux/fs.h:1930 [inline]
ocfs2_start_trans+0x2b2/0x6f0 fs/ocfs2/journal.c:350
ocfs2_write_info+0x124/0x3a0 fs/ocfs2/quota_global.c:977
dquot_set_dqinfo+0x488/0x6f0 fs/quota/dquot.c:2904
quota_setinfo+0x3d6/0x4f0 fs/quota/quota.c:173
__do_sys_quotactl fs/quota/quota.c:959 [inline]
__se_sys_quotactl+0x2b1/0x770 fs/quota/quota.c:915
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #1 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
ocfs2_lock_global_qf+0x221/0x2a0 fs/ocfs2/quota_global.c:314
ocfs2_write_info+0xd2/0x3a0 fs/ocfs2/quota_global.c:974
dquot_set_dqinfo+0x488/0x6f0 fs/quota/dquot.c:2904
quota_setinfo+0x3d6/0x4f0 fs/quota/quota.c:173
__do_sys_quotactl fs/quota/quota.c:959 [inline]
__se_sys_quotactl+0x2b1/0x770 fs/quota/quota.c:915
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:789 [inline]
ocfs2_lock_global_qf+0x202/0x2a0 fs/ocfs2/quota_global.c:313
ocfs2_acquire_dquot+0x299/0xb40 fs/ocfs2/quota_global.c:811
dqget+0x762/0xe90 fs/quota/dquot.c:988
__dquot_initialize+0x2d9/0xea0 fs/quota/dquot.c:1517
ocfs2_get_init_inode+0x154/0x1c0 fs/ocfs2/namei.c:202
ocfs2_mknod+0xdcb/0x2cd0 fs/ocfs2/namei.c:310
ocfs2_create+0x194/0x430 fs/ocfs2/namei.c:674
lookup_open fs/namei.c:3462 [inline]
open_last_lookups fs/namei.c:3532 [inline]
path_openat+0x130a/0x2f20 fs/namei.c:3739
do_filp_open+0x21c/0x460 fs/namei.c:3769
do_sys_openat2+0x13b/0x4f0 fs/open.c:1253
do_sys_open fs/open.c:1269 [inline]
__do_sys_openat fs/open.c:1285 [inline]
__se_sys_openat fs/open.c:1280 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1280
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Chain exists of:
&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2 --> &ei->i_data_sem --> &dquot->dq_lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&dquot->dq_lock);
lock(&ei->i_data_sem);
lock(&dquot->dq_lock);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2);

*** DEADLOCK ***

4 locks held by syz-executor309/4731:
#0: ffff888074ada460 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:377
#1: ffff88806ca189c8 (&type->i_mutex_dir_key#6){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
#1: ffff88806ca189c8 (&type->i_mutex_dir_key#6){+.+.}-{3:3}, at: open_last_lookups fs/namei.c:3529 [inline]
#1: ffff88806ca189c8 (&type->i_mutex_dir_key#6){+.+.}-{3:3}, at: path_openat+0x824/0x2f20 fs/namei.c:3739
#2: ffff88806c9689c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
#2: ffff88806c9689c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x18e/0x4c70 fs/ocfs2/suballoc.c:782
#3: ffff88806c9740a8 (&dquot->dq_lock){+.+.}-{3:3}, at: ocfs2_acquire_dquot+0x28c/0xb40 fs/ocfs2/quota_global.c:806

stack backtrace:
CPU: 0 PID: 4731 Comm: syz-executor309 Not tainted 5.15.178-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
check_noncircular+0x2f8/0x3b0 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+0x1649/0x5930 kernel/locking/lockdep.c:3788
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:789 [inline]
ocfs2_lock_global_qf+0x202/0x2a0 fs/ocfs2/quota_global.c:313
ocfs2_acquire_dquot+0x299/0xb40 fs/ocfs2/quota_global.c:811
dqget+0x762/0xe90 fs/quota/dquot.c:988
__dquot_initialize+0x2d9/0xea0 fs/quota/dquot.c:1517
ocfs2_get_init_inode+0x154/0x1c0 fs/ocfs2/namei.c:202
ocfs2_mknod+0xdcb/0x2cd0 fs/ocfs2/namei.c:310
ocfs2_create+0x194/0x430 fs/ocfs2/namei.c:674
lookup_open fs/namei.c:3462 [inline]
open_last_lookups fs/namei.c:3532 [inline]
path_openat+0x130a/0x2f20 fs/namei.c:3739
do_filp_open+0x21c/0x460 fs/namei.c:3769
do_sys_openat2+0x13b/0x4f0 fs/open.c:1253
do_sys_open fs/open.c:1269 [inline]
__do_sys_openat fs/open.c:1285 [inline]
__se_sys_openat fs/open.c:1280 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1280
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f66505cf4d9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 18 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:00007ffeb71c3e28 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00004000000000c0 RCX: 00007f66505cf4d9
RDX: 000000000000275a RSI: 00004000000000c0 RDI: 00000000ffffff9c
RBP: 0000400000004780 R08: 0000400000008f40 R09: 0000400000008f40
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffeb71c3e5c
R13: 0000000000000026 R14: 431bde82d7b634db R15: 00007ffeb71c3e90
</TASK>
(syz-executor309,4731,0):ocfs2_block_check_validate:402 ERROR: CRC32 failed: stored: 0x2c7b5077, computed 0x28030c75. Applying ECC.
(syz-executor309,4731,0):ocfs2_block_check_validate:416 ERROR: Fixed CRC32 failed: stored: 0x2c7b5077, computed 0x28d1d8ae
(syz-executor309,4731,0):ocfs2_read_quota_phys_block:160 ERROR: status = -5
(syz-executor309,4731,0):ocfs2_quota_read:201 ERROR: status = -5
Quota error (device loop1): find_tree_dqentry: Can't read quota tree block 5
Quota error (device loop1): qtree_read_dquot: Can't read quota structure for id 0
(syz-executor309,4731,0):ocfs2_acquire_dquot:873 ERROR: status = -5
(syz-executor309,4731,0):ocfs2_mknod:314 ERROR: status = -5
(syz-executor309,4731,0):ocfs2_mknod:502 ERROR: status = -5
(syz-executor309,4731,0):ocfs2_create:676 ERROR: status = -5


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

syzbot

unread,
May 12, 2025, 9:32:03 AMMay 12
syzbot suspects this issue could be fixed by backporting the following commit:

commit 965b5dd1894f4525f38c1b5f99b0106a07dbb5db
git tree: upstream
Author: Tetsuo Handa <[email protected]>
Date: Sat Nov 23 13:28:34 2024 +0000

ocfs2: free inode when ocfs2_get_init_inode() fails

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=12844cd4580000
Please keep in mind that other backports might be required as well.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
May 15, 2025, 8:39:06 PMMay 15
The commit that was suspected to fix the issue was backported to the fuzzed
kernel trees.

commit c5327720a4655303ffa3f632d86ee205dd783f32
Author: <[email protected]>
Date: Sat Nov 23 13:28:34 2024 +0000

ocfs2: free inode when ocfs2_get_init_inode() fails

If you believe this is correct, please reply with
#syz fix: ocfs2: free inode when ocfs2_get_init_inode() fails

The commit was initially detected here:
Reply all
Reply to author
Forward
0 new messages