Hello,
syzbot found the following issue on:
HEAD commit: cc5ec8769306 Linux 5.15.196
git tree: linux-5.15.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=1473cf42580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=e1bb6d24ef2164eb
dashboard link:
https://syzkaller.appspot.com/bug?extid=b6e6a2ef620b522176e7
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/c71c660545b2/disk-cc5ec876.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/4f011826cca6/vmlinux-cc5ec876.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/8ccd1a2c3f8c/bzImage-cc5ec876.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+b6e6a2...@syzkaller.appspotmail.com
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.1.99/4836 is trying to acquire lock:
ffff888057c3ed88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
ffff888057c3ed88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_del_inode_from_orphan+0x131/0x730 fs/ocfs2/namei.c:2713
but task is already holding lock:
ffff88805f3094a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io_write fs/ocfs2/aops.c:2325 [inline]
ffff88805f3094a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io+0x386/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+0x38/0x60 kernel/locking/rwsem.c:1551
ocfs2_create_local_dquot+0x194/0x1750 fs/ocfs2/quota_local.c:1224
ocfs2_acquire_dquot+0x7cb/0xaf0 fs/ocfs2/quota_global.c:871
dqget+0x778/0xeb0 fs/quota/dquot.c:988
ocfs2_setattr+0xe87/0x1a10 fs/ocfs2/file.c:1246
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
-> #2 (&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_initialize+0x3b6/0xcb0 fs/quota/dquot.c:1517
ocfs2_get_init_inode+0x138/0x1b0 fs/ocfs2/namei.c:202
ocfs2_mknod+0x8aa/0x22b0 fs/ocfs2/namei.c:310
ocfs2_mkdir+0x192/0x410 fs/ocfs2/namei.c:657
vfs_mkdir+0x387/0x570 fs/namei.c:4073
do_mkdirat+0x1d7/0x5a0 fs/namei.c:4098
__do_sys_mkdirat fs/namei.c:4113 [inline]
__se_sys_mkdirat fs/namei.c:4111 [inline]
__x64_sys_mkdirat+0x85/0x90 fs/namei.c:4111
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_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{3:3}:
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:787 [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+0x130f/0x3e40 fs/ocfs2/inode.c:1216
evict+0x485/0x870 fs/inode.c:647
d_delete_notify include/linux/fsnotify.h:267 [inline]
vfs_rmdir+0x3b4/0x430 fs/namei.c:4170
do_rmdir+0x295/0x710 fs/namei.c:4218
__do_sys_unlinkat fs/namei.c:4398 [inline]
__se_sys_unlinkat fs/namei.c:4392 [inline]
__x64_sys_unlinkat+0xc0/0xe0 fs/namei.c:4392
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 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{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+0x2c33/0x7c60 kernel/locking/lockdep.c:5012
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:787 [inline]
ocfs2_del_inode_from_orphan+0x131/0x730 fs/ocfs2/namei.c:2713
ocfs2_dio_end_io_write fs/ocfs2/aops.c:2333 [inline]
ocfs2_dio_end_io+0x475/0x10f0 fs/ocfs2/aops.c:2431
dio_complete+0x249/0x720 fs/direct-io.c:272
do_blockdev_direct_IO fs/direct-io.c:1336 [inline]
__blockdev_direct_IO+0x30a7/0x3c90 fs/direct-io.c:1368
ocfs2_direct_IO+0x23e/0x2b0 fs/ocfs2/aops.c:2468
generic_file_direct_write+0x22c/0x490 mm/filemap.c:3687
__generic_file_write_iter+0x2b1/0x4e0 mm/filemap.c:3869
ocfs2_file_write_iter+0x1578/0x1cf0 fs/ocfs2/file.c:2472
do_iter_readv_writev+0x497/0x600 fs/read_write.c:-1
do_iter_write+0x205/0x7b0 fs/read_write.c:855
iter_file_splice_write+0x665/0xc50 fs/splice.c:689
do_splice_from fs/splice.c:767 [inline]
direct_splice_actor+0xe1/0x130 fs/splice.c:956
splice_direct_to_actor+0x4de/0xbd0 fs/splice.c:902
do_splice_direct+0x1b6/0x2c0 fs/splice.c:1008
do_sendfile+0x5d5/0xec0 fs/read_write.c:1249
__do_sys_sendfile64 fs/read_write.c:1317 [inline]
__se_sys_sendfile64+0x13b/0x190 fs/read_write.c:1303
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:
&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.99/4836:
#0: ffff888061668460 (
sb_writers#18){.+.+}-{0:0}, at: do_sendfile+0x5b2/0xec0 fs/read_write.c:1248
#1: ffff88805f309808 (&sb->s_type->i_mutex_key#31){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
#1: ffff88805f309808 (&sb->s_type->i_mutex_key#31){+.+.}-{3:3}, at: ocfs2_file_write_iter+0x401/0x1cf0 fs/ocfs2/file.c:2402
#2: ffff88805f3094a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io_write fs/ocfs2/aops.c:2325 [inline]
#2: ffff88805f3094a0 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_dio_end_io+0x386/0x10f0 fs/ocfs2/aops.c:2431
stack backtrace:
CPU: 1 PID: 4836 Comm: syz.1.99 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:787 [inline]
ocfs2_del_inode_from_orphan+0x131/0x730 fs/ocfs2/namei.c:2713
ocfs2_dio_end_io_write fs/ocfs2/aops.c:2333 [inline]
ocfs2_dio_end_io+0x475/0x10f0 fs/ocfs2/aops.c:2431
dio_complete+0x249/0x720 fs/direct-io.c:272
do_blockdev_direct_IO fs/direct-io.c:1336 [inline]
__blockdev_direct_IO+0x30a7/0x3c90 fs/direct-io.c:1368
ocfs2_direct_IO+0x23e/0x2b0 fs/ocfs2/aops.c:2468
generic_file_direct_write+0x22c/0x490 mm/filemap.c:3687
__generic_file_write_iter+0x2b1/0x4e0 mm/filemap.c:3869
ocfs2_file_write_iter+0x1578/0x1cf0 fs/ocfs2/file.c:2472
do_iter_readv_writev+0x497/0x600 fs/read_write.c:-1
do_iter_write+0x205/0x7b0 fs/read_write.c:855
iter_file_splice_write+0x665/0xc50 fs/splice.c:689
do_splice_from fs/splice.c:767 [inline]
direct_splice_actor+0xe1/0x130 fs/splice.c:956
splice_direct_to_actor+0x4de/0xbd0 fs/splice.c:902
do_splice_direct+0x1b6/0x2c0 fs/splice.c:1008
do_sendfile+0x5d5/0xec0 fs/read_write.c:1249
__do_sys_sendfile64 fs/read_write.c:1317 [inline]
__se_sys_sendfile64+0x13b/0x190 fs/read_write.c:1303
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:0x7fd55a742749
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:00007fd5589a9038 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007fd55a998fa0 RCX: 00007fd55a742749
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000004
RBP: 00007fd55a7c6f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000020fffe82 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd55a999038 R14: 00007fd55a998fa0 R15: 00007fffbcc533e8
</TASK>
syz.1.99 (4836) used greatest stack depth: 18408 bytes left
---
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