[v5.15] possible deadlock in ocfs2_evict_inode

2 views
Skip to first unread message

syzbot

unread,
Mar 12, 2025, 8:58:25 PM3/12/25
to syzkaller...@googlegroups.com
Hello,

syzbot found 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=1775e060580000
kernel config: https://syzkaller.appspot.com/x/.config?x=3ca28fba9b2e5c5
dashboard link: https://syzkaller.appspot.com/bug?extid=36dbcd0899bcc5fe5a5e
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/3f2947e5e4dc/disk-c16c81c8.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7034800fdaa8/vmlinux-c16c81c8.xz
kernel image: https://storage.googleapis.com/syzbot-assets/42337be7c213/Image-c16c81c8.gz.xz

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

Quota error (device loop4): qtree_read_dquot: Can't read quota structure for id 0
(syz-executor,4033,1):ocfs2_acquire_dquot:873 ERROR: status = -5
======================================================
WARNING: possible circular locking dependency detected
5.15.178-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor/4033 is trying to acquire lock:
ffff0000d85f3488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
ffff0000d85f3488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_remove_inode fs/ocfs2/inode.c:655 [inline]
ffff0000d85f3488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_wipe_inode fs/ocfs2/inode.c:818 [inline]
ffff0000d85f3488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_delete_inode fs/ocfs2/inode.c:1079 [inline]
ffff0000d85f3488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_evict_inode+0x1e18/0x45ec fs/ocfs2/inode.c:1216

but task is already holding lock:
ffff0000d85f5108 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
ffff0000d85f5108 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_wipe_inode fs/ocfs2/inode.c:776 [inline]
ffff0000d85f5108 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_delete_inode fs/ocfs2/inode.c:1079 [inline]
ffff0000d85f5108 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_evict_inode+0x2cec/0x45ec fs/ocfs2/inode.c:1216

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #4 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}:
down_write+0xbc/0x12c kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:789 [inline]
ocfs2_del_inode_from_orphan+0x134/0x74c fs/ocfs2/namei.c:2713
ocfs2_dio_end_io_write fs/ocfs2/aops.c:2333 [inline]
ocfs2_dio_end_io+0x49c/0x10cc fs/ocfs2/aops.c:2431
dio_complete+0x208/0x68c fs/direct-io.c:272
do_blockdev_direct_IO fs/direct-io.c:1336 [inline]
__blockdev_direct_IO+0x30e4/0x3824 fs/direct-io.c:1368
ocfs2_direct_IO+0x208/0x280 fs/ocfs2/aops.c:2468
generic_file_direct_write+0x234/0x538 mm/filemap.c:3687
__generic_file_write_iter+0x280/0x454 mm/filemap.c:3869
ocfs2_file_write_iter+0x1540/0x1e60 fs/ocfs2/file.c:2472
call_write_iter include/linux/fs.h:2174 [inline]
aio_write+0x604/0x8dc fs/aio.c:1594
io_submit_one+0x878/0x161c fs/aio.c:2013
__do_sys_io_submit fs/aio.c:2072 [inline]
__se_sys_io_submit fs/aio.c:2042 [inline]
__arm64_sys_io_submit+0x26c/0x3ec fs/aio.c:2042
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #3 (&ocfs2_quota_ip_alloc_sem_key){++++}-{3:3}:
down_write+0xbc/0x12c kernel/locking/rwsem.c:1551
ocfs2_lock_global_qf+0x1d4/0x260 fs/ocfs2/quota_global.c:314
ocfs2_acquire_dquot+0x258/0xa90 fs/ocfs2/quota_global.c:811
dqget+0x664/0xd0c fs/quota/dquot.c:988
__dquot_initialize+0x344/0xc04 fs/quota/dquot.c:1517
dquot_initialize+0x24/0x34 fs/quota/dquot.c:1579
ocfs2_get_init_inode+0x14c/0x1c0 fs/ocfs2/namei.c:202
ocfs2_mknod+0x89c/0x24f8 fs/ocfs2/namei.c:310
ocfs2_create+0x184/0x4c8 fs/ocfs2/namei.c:674
lookup_open fs/namei.c:3462 [inline]
open_last_lookups fs/namei.c:3532 [inline]
path_openat+0xf18/0x26cc fs/namei.c:3739
do_filp_open+0x1a8/0x3b4 fs/namei.c:3769
do_sys_openat2+0x128/0x3e0 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]
__arm64_sys_openat+0x1f0/0x240 fs/open.c:1280
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #2 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}:
down_write+0xbc/0x12c kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:789 [inline]
ocfs2_lock_global_qf+0x1b8/0x260 fs/ocfs2/quota_global.c:313
ocfs2_acquire_dquot+0x258/0xa90 fs/ocfs2/quota_global.c:811
dqget+0x664/0xd0c fs/quota/dquot.c:988
__dquot_initialize+0x344/0xc04 fs/quota/dquot.c:1517
dquot_initialize+0x24/0x34 fs/quota/dquot.c:1579
ocfs2_get_init_inode+0x14c/0x1c0 fs/ocfs2/namei.c:202
ocfs2_mknod+0x89c/0x24f8 fs/ocfs2/namei.c:310
ocfs2_create+0x184/0x4c8 fs/ocfs2/namei.c:674
lookup_open fs/namei.c:3462 [inline]
open_last_lookups fs/namei.c:3532 [inline]
path_openat+0xf18/0x26cc fs/namei.c:3739
do_filp_open+0x1a8/0x3b4 fs/namei.c:3769
do_sys_openat2+0x128/0x3e0 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]
__arm64_sys_openat+0x1f0/0x240 fs/open.c:1280
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #1 (&dquot->dq_lock){+.+.}-{3:3}:
__mutex_lock_common+0x194/0x2154 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0xa4/0xf8 kernel/locking/mutex.c:743
wait_on_dquot fs/quota/dquot.c:356 [inline]
dqget+0x5f4/0xd0c fs/quota/dquot.c:983
__dquot_initialize+0x344/0xc04 fs/quota/dquot.c:1517
dquot_initialize+0x24/0x34 fs/quota/dquot.c:1579
ocfs2_get_init_inode+0x14c/0x1c0 fs/ocfs2/namei.c:202
ocfs2_mknod+0x89c/0x24f8 fs/ocfs2/namei.c:310
ocfs2_create+0x184/0x4c8 fs/ocfs2/namei.c:674
lookup_open fs/namei.c:3462 [inline]
open_last_lookups fs/namei.c:3532 [inline]
path_openat+0xf18/0x26cc fs/namei.c:3739
do_filp_open+0x1a8/0x3b4 fs/namei.c:3769
do_sys_openat2+0x128/0x3e0 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]
__arm64_sys_openat+0x1f0/0x240 fs/open.c:1280
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #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 kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x32d4/0x7638 kernel/locking/lockdep.c:5012
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623
down_write+0xbc/0x12c kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:789 [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+0x1e18/0x45ec fs/ocfs2/inode.c:1216
evict+0x418/0x894 fs/inode.c:622
iput_final fs/inode.c:1744 [inline]
iput+0x744/0x824 fs/inode.c:1770
d_delete_notify include/linux/fsnotify.h:267 [inline]
vfs_rmdir+0x2f8/0x3f0 fs/namei.c:4162
do_rmdir+0x2e8/0x84c fs/namei.c:4210
__do_sys_unlinkat fs/namei.c:4390 [inline]
__se_sys_unlinkat fs/namei.c:4384 [inline]
__arm64_sys_unlinkat+0xe0/0xfc fs/namei.c:4384
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

other info that might help us debug this:

Chain exists of:
&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2 --> &ocfs2_quota_ip_alloc_sem_key --> &ocfs2_sysfile_lock_key[args->fi_sysfile_type]

Possible unsafe locking scenario:

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

*** DEADLOCK ***

4 locks held by syz-executor/4033:
#0: ffff0000d801c460 (sb_writers#15){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:377
#1: ffff0000dbf7a648 (&type->i_mutex_dir_key#9/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:824 [inline]
#1: ffff0000dbf7a648 (&type->i_mutex_dir_key#9/1){+.+.}-{3:3}, at: do_rmdir+0x1e0/0x84c fs/namei.c:4197
#2: ffff0000f5324ab0 (&osb->nfs_sync_rwlock){.+.+}-{3:3}, at: ocfs2_nfs_sync_lock+0x100/0x31c fs/ocfs2/dlmglue.c:2874
#3: ffff0000d85f5108 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
#3: ffff0000d85f5108 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_wipe_inode fs/ocfs2/inode.c:776 [inline]
#3: ffff0000d85f5108 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_delete_inode fs/ocfs2/inode.c:1079 [inline]
#3: ffff0000d85f5108 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_evict_inode+0x2cec/0x45ec fs/ocfs2/inode.c:1216

stack backtrace:
CPU: 0 PID: 4033 Comm: syz-executor Not tainted 5.15.178-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x58 lib/dump_stack.c:113
print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2011
check_noncircular+0x2cc/0x378 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+0x32d4/0x7638 kernel/locking/lockdep.c:5012
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623
down_write+0xbc/0x12c kernel/locking/rwsem.c:1551
inode_lock include/linux/fs.h:789 [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+0x1e18/0x45ec fs/ocfs2/inode.c:1216
evict+0x418/0x894 fs/inode.c:622
iput_final fs/inode.c:1744 [inline]
iput+0x744/0x824 fs/inode.c:1770
d_delete_notify include/linux/fsnotify.h:267 [inline]
vfs_rmdir+0x2f8/0x3f0 fs/namei.c:4162
do_rmdir+0x2e8/0x84c fs/namei.c:4210
__do_sys_unlinkat fs/namei.c:4390 [inline]
__se_sys_unlinkat fs/namei.c:4384 [inline]
__arm64_sys_unlinkat+0xe0/0xfc fs/namei.c:4384
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
ocfs2: Unmounting device (7,4) on (node local)


---
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 20, 2025, 8:58:18 PM6/20/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 30, 2025, 3:52:31 AM6/30/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f5b4c104b7d Linux 6.6.95
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=101ea770580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b80883c3ded77c16
dashboard link: https://syzkaller.appspot.com/bug?extid=6392dfabb8ba3dbf7e27
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/0efd4e01816e/disk-3f5b4c10.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f7c9d20858cc/vmlinux-3f5b4c10.xz
kernel image: https://storage.googleapis.com/syzbot-assets/18f8dc74ef68/bzImage-3f5b4c10.xz

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

loop0: detected capacity change from 0 to 32768
ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode.
======================================================
WARNING: possible circular locking dependency detected
6.6.95-syzkaller #0 Not tainted
------------------------------------------------------
syz.0.3017/22326 is trying to acquire lock:
ffff888059709818 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
ffff888059709818 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_remove_inode fs/ocfs2/inode.c:655 [inline]
ffff888059709818 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_wipe_inode fs/ocfs2/inode.c:818 [inline]
ffff888059709818 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_delete_inode fs/ocfs2/inode.c:1079 [inline]
ffff888059709818 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_evict_inode+0x1313/0x3e60 fs/ocfs2/inode.c:1216

but task is already holding lock:
ffff8880597242d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
ffff8880597242d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_wipe_inode fs/ocfs2/inode.c:776 [inline]
ffff8880597242d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_delete_inode fs/ocfs2/inode.c:1079 [inline]
ffff8880597242d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_evict_inode+0x20ab/0x3e60 fs/ocfs2/inode.c:1216

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}:
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
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

-> #2 (&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

-> #1 (&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

-> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{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_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
do_unlinkat+0x37b/0x570 fs/namei.c:4398
__do_sys_unlink fs/namei.c:4439 [inline]
__se_sys_unlink fs/namei.c:4437 [inline]
__x64_sys_unlink+0x49/0x50 fs/namei.c:4437
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]#2 --> &ocfs2_quota_ip_alloc_sem_key --> &ocfs2_sysfile_lock_key[args->fi_sysfile_type]

Possible unsafe locking scenario:

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

*** DEADLOCK ***

3 locks held by syz.0.3017/22326:
#0: ffff88802b396418 (sb_writers#32){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:403
#1: ffff888025ed0bd0 (&osb->nfs_sync_rwlock){.+.+}-{3:3}, at: ocfs2_nfs_sync_lock+0x107/0x250 fs/ocfs2/dlmglue.c:2876
#2: ffff8880597242d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
#2: ffff8880597242d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_wipe_inode fs/ocfs2/inode.c:776 [inline]
#2: ffff8880597242d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_delete_inode fs/ocfs2/inode.c:1079 [inline]
#2: ffff8880597242d8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_evict_inode+0x20ab/0x3e60 fs/ocfs2/inode.c:1216

stack backtrace:
CPU: 1 PID: 22326 Comm: syz.0.3017 Not tainted 6.6.95-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_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
do_unlinkat+0x37b/0x570 fs/namei.c:4398
__do_sys_unlink fs/namei.c:4439 [inline]
__se_sys_unlink fs/namei.c:4437 [inline]
__x64_sys_unlink+0x49/0x50 fs/namei.c:4437
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:0x7f9054b8e929
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:00007f9055a6d038 EFLAGS: 00000246 ORIG_RAX: 0000000000000057
RAX: ffffffffffffffda RBX: 00007f9054db5fa0 RCX: 00007f9054b8e929
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000d00
RBP: 00007f9054c10b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f9054db5fa0 R15: 00007ffd253d4ad8
</TASK>
Reply all
Reply to author
Forward
0 new messages