[v6.1] possible deadlock in ocfs2_del_inode_from_orphan

1 view
Skip to first unread message

syzbot

unread,
Dec 11, 2024, 1:58:25 PM12/11/24
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: e4d90d63d385 Linux 6.1.119
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=121a73e8580000
kernel config: https://syzkaller.appspot.com/x/.config?x=5516a02be29a5649
dashboard link: https://syzkaller.appspot.com/bug?extid=9160da0ca779c1f03228
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/19f991f20183/disk-e4d90d63.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/61eb5f055f38/vmlinux-e4d90d63.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0ddd97416681/bzImage-e4d90d63.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+9160da...@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
6.1.119-syzkaller #0 Not tainted
------------------------------------------------------
syz.1.63/4649 is trying to acquire lock:
ffff88807013df48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
ffff88807013df48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_del_inode_from_orphan+0x155/0x7f0 fs/ocfs2/namei.c:2711

but task is already holding lock:
ffff8880701394a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io_write fs/ocfs2/aops.c:2325 [inline]
ffff8880701394a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io+0x446/0x1250 fs/ocfs2/aops.c:2431

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&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_create_local_dquot+0x1dc/0x1b50 fs/ocfs2/quota_local.c:1231
ocfs2_acquire_dquot+0x7df/0xb60 fs/ocfs2/quota_global.c:866
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+0xe32/0x2e20 fs/ocfs2/namei.c:308
ocfs2_mkdir+0x1c0/0x4e0 fs/ocfs2/namei.c:655
vfs_mkdir+0x3b6/0x590 fs/namei.c:4106
do_mkdirat+0x225/0x360 fs/namei.c:4131
__do_sys_mkdir fs/namei.c:4151 [inline]
__se_sys_mkdir fs/namei.c:4149 [inline]
__x64_sys_mkdir+0x6a/0x80 fs/namei.c:4149
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 (&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
wait_on_dquot fs/quota/dquot.c:356 [inline]
dqget+0x6dc/0xe90 fs/quota/dquot.c:981
__dquot_initialize+0x2d9/0xea0 fs/quota/dquot.c:1515
ocfs2_get_init_inode+0x154/0x1c0 fs/ocfs2/namei.c:202
ocfs2_mknod+0xe32/0x2e20 fs/ocfs2/namei.c:308
ocfs2_mkdir+0x1c0/0x4e0 fs/ocfs2/namei.c:655
vfs_mkdir+0x3b6/0x590 fs/namei.c:4106
do_mkdirat+0x225/0x360 fs/namei.c:4131
__do_sys_mkdir fs/namei.c:4151 [inline]
__se_sys_mkdir fs/namei.c:4149 [inline]
__x64_sys_mkdir+0x6a/0x80 fs/namei.c:4149
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_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}:
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_remove_inode fs/ocfs2/inode.c:655 [inline]
ocfs2_wipe_inode fs/ocfs2/inode.c:818 [inline]
ocfs2_delete_inode fs/ocfs2/inode.c:1079 [inline]
ocfs2_evict_inode+0x17ce/0x4c30 fs/ocfs2/inode.c:1216
evict+0x529/0x930 fs/inode.c:701
ocfs2_dentry_iput+0x22e/0x380 fs/ocfs2/dcache.c:418
__dentry_kill+0x436/0x650 fs/dcache.c:611
dentry_kill+0xbb/0x290
dput+0xfb/0x1d0 fs/dcache.c:918
do_renameat2+0xded/0x1440 fs/namei.c:5029
__do_sys_rename fs/namei.c:5073 [inline]
__se_sys_rename fs/namei.c:5071 [inline]
__x64_sys_rename+0x82/0x90 fs/namei.c:5071
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]){+.+.}-{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_del_inode_from_orphan+0x155/0x7f0 fs/ocfs2/namei.c:2711
ocfs2_dio_end_io_write fs/ocfs2/aops.c:2333 [inline]
ocfs2_dio_end_io+0x556/0x1250 fs/ocfs2/aops.c:2431
dio_complete+0x24a/0x7b0 fs/direct-io.c:271
__blockdev_direct_IO+0x3ffb/0x4810 fs/direct-io.c:1326
ocfs2_direct_IO+0x250/0x2c0 fs/ocfs2/aops.c:2468
generic_file_direct_write+0x204/0x460 mm/filemap.c:3769
__generic_file_write_iter+0x1c4/0x400 mm/filemap.c:3929
ocfs2_file_write_iter+0x17c6/0x2020 fs/ocfs2/file.c:2467
do_iter_write+0x6e6/0xc40 fs/read_write.c:861
vfs_writev fs/read_write.c:934 [inline]
do_pwritev+0x216/0x360 fs/read_write.c:1031
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] --> &dquot->dq_lock --> &ocfs2_quota_ip_alloc_sem_key

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&ocfs2_quota_ip_alloc_sem_key);
lock(&dquot->dq_lock);
lock(&ocfs2_quota_ip_alloc_sem_key);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]);

*** DEADLOCK ***

3 locks held by syz.1.63/4649:
#0: ffff88807b17c460 (sb_writers#17){.+.+}-{0:0}, at: vfs_writev fs/read_write.c:933 [inline]
#0: ffff88807b17c460 (sb_writers#17){.+.+}-{0:0}, at: do_pwritev+0x1fa/0x360 fs/read_write.c:1031
#1: ffff888070139808 (&sb->s_type->i_mutex_key#27){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
#1: ffff888070139808 (&sb->s_type->i_mutex_key#27){+.+.}-{3:3}, at: ocfs2_file_write_iter+0x476/0x2020 fs/ocfs2/file.c:2399
#2: ffff8880701394a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io_write fs/ocfs2/aops.c:2325 [inline]
#2: ffff8880701394a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io+0x446/0x1250 fs/ocfs2/aops.c:2431

stack backtrace:
CPU: 0 PID: 4649 Comm: syz.1.63 Not tainted 6.1.119-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_del_inode_from_orphan+0x155/0x7f0 fs/ocfs2/namei.c:2711
ocfs2_dio_end_io_write fs/ocfs2/aops.c:2333 [inline]
ocfs2_dio_end_io+0x556/0x1250 fs/ocfs2/aops.c:2431
dio_complete+0x24a/0x7b0 fs/direct-io.c:271
__blockdev_direct_IO+0x3ffb/0x4810 fs/direct-io.c:1326
ocfs2_direct_IO+0x250/0x2c0 fs/ocfs2/aops.c:2468
generic_file_direct_write+0x204/0x460 mm/filemap.c:3769
__generic_file_write_iter+0x1c4/0x400 mm/filemap.c:3929
ocfs2_file_write_iter+0x17c6/0x2020 fs/ocfs2/file.c:2467
do_iter_write+0x6e6/0xc40 fs/read_write.c:861
vfs_writev fs/read_write.c:934 [inline]
do_pwritev+0x216/0x360 fs/read_write.c:1031
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:0x7f223497ff19
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:00007f22356a6058 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 00007f2234b45fa0 RCX: 00007f223497ff19
RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000004
RBP: 00007f22349f3cc8 R08: 0000000000000000 R09: 0000000000000003
R10: 0000000000007800 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f2234b45fa0 R15: 00007ffe17519708
</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 syzk...@googlegroups.com.

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,
Jun 25, 2025, 12:24:16 AMJun 25
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.

syzbot

unread,
Jun 26, 2025, 4:15:27 PMJun 26
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 6282921b6825 Linux 6.6.94
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14ebdb70580000
kernel config: https://syzkaller.appspot.com/x/.config?x=96da6b2210cda427
dashboard link: https://syzkaller.appspot.com/bug?extid=d1067b95322604c5067a
compiler: Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/a3bf0d8e22b2/disk-6282921b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d1d442f782d0/vmlinux-6282921b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a8378f4b7e1b/bzImage-6282921b.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d1067b...@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
6.6.94-syzkaller #0 Not tainted
------------------------------------------------------
syz.5.1999/18116 is trying to acquire lock:
ffff88805a7c5f58 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
ffff88805a7c5f58 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_del_inode_from_orphan+0x135/0x740 fs/ocfs2/namei.c:2716

but task is already holding lock:
ffff88805a425be0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io_write fs/ocfs2/aops.c:2325 [inline]
ffff88805a425be0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io+0x38c/0x10f0 fs/ocfs2/aops.c:2431

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}:
down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
ocfs2_create_local_dquot+0x1a4/0x1790 fs/ocfs2/quota_local.c:1224
ocfs2_acquire_dquot+0x7cf/0xaf0 fs/ocfs2/quota_global.c:871
dqget+0x77c/0xeb0 fs/quota/dquot.c:988
__dquot_initialize+0x3ba/0xcb0 fs/quota/dquot.c:1516
ocfs2_get_init_inode+0x13c/0x1b0 fs/ocfs2/namei.c:202
ocfs2_mknod+0x867/0x20f0 fs/ocfs2/namei.c:310
ocfs2_create+0x196/0x410 fs/ocfs2/namei.c:674
lookup_open fs/namei.c:3488 [inline]
open_last_lookups fs/namei.c:3556 [inline]
path_openat+0x1277/0x3190 fs/namei.c:3786
do_filp_open+0x1c5/0x3d0 fs/namei.c:3816
do_sys_openat2+0x12c/0x1c0 fs/open.c:1419
do_sys_open fs/open.c:1434 [inline]
__do_sys_openat fs/open.c:1450 [inline]
__se_sys_openat fs/open.c:1445 [inline]
__x64_sys_openat+0x139/0x160 fs/open.c:1445
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #2 (&dquot->dq_lock){+.+.}-{3:3}:
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x129/0xcc0 kernel/locking/mutex.c:747
wait_on_dquot fs/quota/dquot.c:356 [inline]
dqget+0x6fc/0xeb0 fs/quota/dquot.c:983
__dquot_initialize+0x3ba/0xcb0 fs/quota/dquot.c:1516
ocfs2_get_init_inode+0x13c/0x1b0 fs/ocfs2/namei.c:202
ocfs2_mknod+0x867/0x20f0 fs/ocfs2/namei.c:310
ocfs2_create+0x196/0x410 fs/ocfs2/namei.c:674
lookup_open fs/namei.c:3488 [inline]
open_last_lookups fs/namei.c:3556 [inline]
path_openat+0x1277/0x3190 fs/namei.c:3786
do_filp_open+0x1c5/0x3d0 fs/namei.c:3816
do_sys_openat2+0x12c/0x1c0 fs/open.c:1419
do_sys_open fs/open.c:1434 [inline]
__do_sys_openat fs/open.c:1450 [inline]
__se_sys_openat fs/open.c:1445 [inline]
__x64_sys_openat+0x139/0x160 fs/open.c:1445
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #1 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}:
down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:804 [inline]
ocfs2_remove_inode fs/ocfs2/inode.c:655 [inline]
ocfs2_wipe_inode fs/ocfs2/inode.c:818 [inline]
ocfs2_delete_inode fs/ocfs2/inode.c:1079 [inline]
ocfs2_evict_inode+0x1313/0x3e60 fs/ocfs2/inode.c:1216
evict+0x486/0x870 fs/inode.c:705
ocfs2_dentry_iput+0x248/0x370 fs/ocfs2/dcache.c:418
__dentry_kill+0x431/0x650 fs/dcache.c:611
dentry_kill+0xb8/0x290 fs/dcache.c:-1
dput+0xfe/0x1e0 fs/dcache.c:918
do_renameat2+0x8b1/0xc70 fs/namei.c:5027
__do_sys_renameat2 fs/namei.c:5058 [inline]
__se_sys_renameat2 fs/namei.c:5055 [inline]
__x64_sys_renameat2+0xd2/0xe0 fs/namei.c:5055
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:804 [inline]
ocfs2_del_inode_from_orphan+0x135/0x740 fs/ocfs2/namei.c:2716
ocfs2_dio_end_io_write fs/ocfs2/aops.c:2333 [inline]
ocfs2_dio_end_io+0x47b/0x10f0 fs/ocfs2/aops.c:2431
dio_complete+0x254/0x710 fs/direct-io.c:282
__blockdev_direct_IO+0x2dc8/0x3420 fs/direct-io.c:1308
ocfs2_direct_IO+0x240/0x2b0 fs/ocfs2/aops.c:2468
generic_file_direct_write+0x1d4/0x3e0 mm/filemap.c:3941
__generic_file_write_iter+0x11b/0x230 mm/filemap.c:4097
ocfs2_file_write_iter+0x1582/0x1d00 fs/ocfs2/file.c:2468
do_iter_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x79a/0xc70 fs/read_write.c:860
vfs_writev fs/read_write.c:933 [inline]
do_writev+0x252/0x410 fs/read_write.c:976
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/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] --> &dquot->dq_lock --> &ocfs2_quota_ip_alloc_sem_key

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&ocfs2_quota_ip_alloc_sem_key);
lock(&dquot->dq_lock);
lock(&ocfs2_quota_ip_alloc_sem_key);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]);

*** DEADLOCK ***

4 locks held by syz.5.1999/18116:
#0: ffff88807e05a5c8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2a3/0x330 fs/file.c:1042
#1: ffff888031946418 (sb_writers#19){.+.+}-{0:0}, at: vfs_writev fs/read_write.c:932 [inline]
#1: ffff888031946418 (sb_writers#19){.+.+}-{0:0}, at: do_writev+0x236/0x410 fs/read_write.c:976
#2: ffff88805a425f58 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
#2: ffff88805a425f58 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: ocfs2_file_write_iter+0x40b/0x1d00 fs/ocfs2/file.c:2398
#3: ffff88805a425be0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io_write fs/ocfs2/aops.c:2325 [inline]
#3: ffff88805a425be0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io+0x38c/0x10f0 fs/ocfs2/aops.c:2431

stack backtrace:
CPU: 1 PID: 18116 Comm: syz.5.1999 Not tainted 6.6.94-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
<TASK>
dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
check_noncircular+0x2bd/0x3c0 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:804 [inline]
ocfs2_del_inode_from_orphan+0x135/0x740 fs/ocfs2/namei.c:2716
ocfs2_dio_end_io_write fs/ocfs2/aops.c:2333 [inline]
ocfs2_dio_end_io+0x47b/0x10f0 fs/ocfs2/aops.c:2431
dio_complete+0x254/0x710 fs/direct-io.c:282
__blockdev_direct_IO+0x2dc8/0x3420 fs/direct-io.c:1308
ocfs2_direct_IO+0x240/0x2b0 fs/ocfs2/aops.c:2468
generic_file_direct_write+0x1d4/0x3e0 mm/filemap.c:3941
__generic_file_write_iter+0x11b/0x230 mm/filemap.c:4097
ocfs2_file_write_iter+0x1582/0x1d00 fs/ocfs2/file.c:2468
do_iter_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x79a/0xc70 fs/read_write.c:860
vfs_writev fs/read_write.c:933 [inline]
do_writev+0x252/0x410 fs/read_write.c:976
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7ff44df8e929
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:00007ff44ed82038 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 00007ff44e1b5fa0 RCX: 00007ff44df8e929
RDX: 0000000000000001 RSI: 0000200000000140 RDI: 0000000000000004
RBP: 00007ff44e010b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ff44e1b5fa0 R15: 00007ffdd3530fc8

syzbot

unread,
12:45 PM (11 hours ago) 12:45 PM
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 1e89a1be4fe9 Linux 6.6.117
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15b93e12580000
kernel config: https://syzkaller.appspot.com/x/.config?x=12606d4b8832c7e4
dashboard link: https://syzkaller.appspot.com/bug?extid=d1067b95322604c5067a
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=137aef42580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10d3ee12580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ad3647e47b66/disk-1e89a1be.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d6f7ba94aea7/vmlinux-1e89a1be.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e08af2290355/bzImage-1e89a1be.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/fef5987fab33/mount_0.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=157aef42580000)

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d1067b...@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.40/6089 is trying to acquire lock:
ffff8880582ac2d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
ffff8880582ac2d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_del_inode_from_orphan+0x135/0x740 fs/ocfs2/namei.c:2716

but task is already holding lock:
ffff8880582b22e0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io_write fs/ocfs2/aops.c:2325 [inline]
ffff8880582b22e0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io+0x38c/0x10f0 fs/ocfs2/aops.c:2431

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}:
down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
ocfs2_create_local_dquot+0x1a4/0x1790 fs/ocfs2/quota_local.c:1224
ocfs2_acquire_dquot+0x7cf/0xaf0 fs/ocfs2/quota_global.c:871
dqget+0x77c/0xeb0 fs/quota/dquot.c:990
__dquot_initialize+0x3ba/0xcb0 fs/quota/dquot.c:1518
ocfs2_get_init_inode+0x13c/0x1b0 fs/ocfs2/namei.c:202
ocfs2_mknod+0x867/0x20f0 fs/ocfs2/namei.c:310
ocfs2_create+0x196/0x410 fs/ocfs2/namei.c:674
lookup_open fs/namei.c:3496 [inline]
open_last_lookups fs/namei.c:3564 [inline]
path_openat+0x1277/0x3190 fs/namei.c:3794
do_filp_open+0x1c5/0x3d0 fs/namei.c:3824
do_sys_openat2+0x12c/0x1c0 fs/open.c:1421
do_sys_open fs/open.c:1436 [inline]
__do_sys_openat fs/open.c:1452 [inline]
__se_sys_openat fs/open.c:1447 [inline]
__x64_sys_openat+0x139/0x160 fs/open.c:1447
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #2 (&dquot->dq_lock){+.+.}-{3:3}:
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x129/0xcc0 kernel/locking/mutex.c:747
wait_on_dquot fs/quota/dquot.c:358 [inline]
dqget+0x6fc/0xeb0 fs/quota/dquot.c:985
__dquot_initialize+0x3ba/0xcb0 fs/quota/dquot.c:1518
ocfs2_get_init_inode+0x13c/0x1b0 fs/ocfs2/namei.c:202
ocfs2_mknod+0x867/0x20f0 fs/ocfs2/namei.c:310
ocfs2_create+0x196/0x410 fs/ocfs2/namei.c:674
lookup_open fs/namei.c:3496 [inline]
open_last_lookups fs/namei.c:3564 [inline]
path_openat+0x1277/0x3190 fs/namei.c:3794
do_filp_open+0x1c5/0x3d0 fs/namei.c:3824
do_sys_openat2+0x12c/0x1c0 fs/open.c:1421
do_sys_open fs/open.c:1436 [inline]
__do_sys_openat fs/open.c:1452 [inline]
__se_sys_openat fs/open.c:1447 [inline]
__x64_sys_openat+0x139/0x160 fs/open.c:1447
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #1 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}:
down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:804 [inline]
ocfs2_remove_inode fs/ocfs2/inode.c:655 [inline]
ocfs2_wipe_inode fs/ocfs2/inode.c:818 [inline]
ocfs2_delete_inode fs/ocfs2/inode.c:1079 [inline]
ocfs2_evict_inode+0x1313/0x3e70 fs/ocfs2/inode.c:1219
evict+0x486/0x870 fs/inode.c:705
do_unlinkat+0x37b/0x570 fs/namei.c:4406
__do_sys_unlinkat fs/namei.c:4442 [inline]
__se_sys_unlinkat fs/namei.c:4435 [inline]
__x64_sys_unlinkat+0xd5/0xe0 fs/namei.c:4435
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:804 [inline]
ocfs2_del_inode_from_orphan+0x135/0x740 fs/ocfs2/namei.c:2716
ocfs2_dio_end_io_write fs/ocfs2/aops.c:2333 [inline]
ocfs2_dio_end_io+0x47b/0x10f0 fs/ocfs2/aops.c:2431
dio_complete+0x254/0x710 fs/direct-io.c:282
__blockdev_direct_IO+0x2dc8/0x3420 fs/direct-io.c:1308
ocfs2_direct_IO+0x240/0x2b0 fs/ocfs2/aops.c:2468
generic_file_direct_write+0x1d4/0x3e0 mm/filemap.c:3956
__generic_file_write_iter+0x11b/0x230 mm/filemap.c:4112
ocfs2_file_write_iter+0x1582/0x1d00 fs/ocfs2/file.c:2468
do_iter_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x79a/0xc70 fs/read_write.c:860
iter_file_splice_write+0x66f/0xc50 fs/splice.c:736
do_splice_from fs/splice.c:933 [inline]
direct_splice_actor+0xe8/0x130 fs/splice.c:1142
splice_direct_to_actor+0x2f0/0x870 fs/splice.c:1088
do_splice_direct+0x1b7/0x2c0 fs/splice.c:1194
do_sendfile+0x5dc/0xf70 fs/read_write.c:1254
__do_sys_sendfile64 fs/read_write.c:1322 [inline]
__se_sys_sendfile64+0x13f/0x190 fs/read_write.c:1308
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/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] --> &dquot->dq_lock --> &ocfs2_quota_ip_alloc_sem_key

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&ocfs2_quota_ip_alloc_sem_key);
lock(&dquot->dq_lock);
lock(&ocfs2_quota_ip_alloc_sem_key);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]);

*** DEADLOCK ***

3 locks held by syz.0.40/6089:
#0: ffff88801efc8418 (sb_writers#13){.+.+}-{0:0}, at: do_sendfile+0x5b9/0xf70 fs/read_write.c:1253
#1: ffff8880582b2658 (&sb->s_type->i_mutex_key#20){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
#1: ffff8880582b2658 (&sb->s_type->i_mutex_key#20){+.+.}-{3:3}, at: ocfs2_file_write_iter+0x40b/0x1d00 fs/ocfs2/file.c:2398
#2: ffff8880582b22e0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io_write fs/ocfs2/aops.c:2325 [inline]
#2: ffff8880582b22e0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io+0x38c/0x10f0 fs/ocfs2/aops.c:2431

stack backtrace:
CPU: 0 PID: 6089 Comm: syz.0.40 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
<TASK>
dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
check_noncircular+0x2bd/0x3c0 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:804 [inline]
ocfs2_del_inode_from_orphan+0x135/0x740 fs/ocfs2/namei.c:2716
ocfs2_dio_end_io_write fs/ocfs2/aops.c:2333 [inline]
ocfs2_dio_end_io+0x47b/0x10f0 fs/ocfs2/aops.c:2431
dio_complete+0x254/0x710 fs/direct-io.c:282
__blockdev_direct_IO+0x2dc8/0x3420 fs/direct-io.c:1308
ocfs2_direct_IO+0x240/0x2b0 fs/ocfs2/aops.c:2468
generic_file_direct_write+0x1d4/0x3e0 mm/filemap.c:3956
__generic_file_write_iter+0x11b/0x230 mm/filemap.c:4112
ocfs2_file_write_iter+0x1582/0x1d00 fs/ocfs2/file.c:2468
do_iter_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x79a/0xc70 fs/read_write.c:860
iter_file_splice_write+0x66f/0xc50 fs/splice.c:736
do_splice_from fs/splice.c:933 [inline]
direct_splice_actor+0xe8/0x130 fs/splice.c:1142
splice_direct_to_actor+0x2f0/0x870 fs/splice.c:1088
do_splice_direct+0x1b7/0x2c0 fs/splice.c:1194
do_sendfile+0x5dc/0xf70 fs/read_write.c:1254
__do_sys_sendfile64 fs/read_write.c:1322 [inline]
__se_sys_sendfile64+0x13f/0x190 fs/read_write.c:1308
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f12f458f749
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:00007f12f5394038 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f12f47e5fa0 RCX: 00007f12f458f749
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000004
RBP: 00007f12f4613f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000020fffe82 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f12f47e6038 R14: 00007f12f47e5fa0 R15: 00007ffc73510278
</TASK>


---
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.
Reply all
Reply to author
Forward
0 new messages