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=10cde7a8580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=d302c69e93fb6774
dashboard link:
https://syzkaller.appspot.com/bug?extid=3ed15bdbe4f8bfda409a
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/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
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+3ed15b...@syzkaller.appspotmail.com
loop4: detected capacity change from 0 to 32768
ocfs2: Mounting device (7,4) on (node local, slot 0) with ordered data mode.
======================================================
WARNING: possible circular locking dependency detected
5.15.178-syzkaller #0 Not tainted
------------------------------------------------------
syz.4.30/4487 is trying to acquire lock:
ffff88805587df48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#8){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
ffff88805587df48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#8){+.+.}-{3:3}, at: ocfs2_move_extent fs/ocfs2/move_extents.c:640 [inline]
ffff88805587df48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#8){+.+.}-{3:3}, at: __ocfs2_move_extents_range+0x1ecb/0x43f0 fs/ocfs2/move_extents.c:860
but task is already holding lock:
ffff8880558789c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
ffff8880558789c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}, at: ocfs2_move_extent fs/ocfs2/move_extents.c:632 [inline]
ffff8880558789c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}, at: __ocfs2_move_extents_range+0x1674/0x43f0 fs/ocfs2/move_extents.c:860
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}:
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_flush_truncate_log+0x36e/0x11c0 fs/ocfs2/alloc.c:6037
ocfs2_flush_truncate_log fs/ocfs2/alloc.c:6067 [inline]
ocfs2_try_to_free_truncate_log+0x1b3/0x410 fs/ocfs2/alloc.c:6126
ocfs2_reserve_clusters_with_limit+0x4e6/0xb50 fs/ocfs2/suballoc.c:1180
ocfs2_reserve_clusters fs/ocfs2/suballoc.c:1223 [inline]
ocfs2_lock_allocators+0x306/0x620 fs/ocfs2/suballoc.c:2669
ocfs2_write_begin_nolock+0x28e5/0x4d20 fs/ocfs2/aops.c:1741
ocfs2_write_begin+0x1fd/0x390 fs/ocfs2/aops.c:1905
generic_perform_write+0x2bf/0x5b0 mm/filemap.c:3785
__generic_file_write_iter+0x243/0x4f0 mm/filemap.c:3912
ocfs2_file_write_iter+0x1980/0x2120 fs/ocfs2/file.c:2472
call_write_iter include/linux/fs.h:2174 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xacd/0xe50 fs/read_write.c:594
ksys_write+0x1a2/0x2c0 fs/read_write.c:647
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]#8){+.+.}-{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_move_extent fs/ocfs2/move_extents.c:640 [inline]
__ocfs2_move_extents_range+0x1ecb/0x43f0 fs/ocfs2/move_extents.c:860
ocfs2_move_extents+0x3ea/0xaa0 fs/ocfs2/move_extents.c:927
ocfs2_ioctl_move_extents+0x5d2/0x800 fs/ocfs2/move_extents.c:1053
ocfs2_ioctl+0x2eb/0x7d0 fs/ocfs2/ioctl.c:931
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
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:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#8);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7);
lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#8);
*** DEADLOCK ***
5 locks held by syz.4.30/4487:
#0: ffff88806069c460 (sb_writers#17){.+.+}-{0:0}, at: mnt_want_write_file+0x5a/0x1f0 fs/namespace.c:421
#1: ffff888061412648 (&sb->s_type->i_mutex_key#25){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
#1: ffff888061412648 (&sb->s_type->i_mutex_key#25){+.+.}-{3:3}, at: ocfs2_move_extents+0x1c1/0xaa0 fs/ocfs2/move_extents.c:905
#2: ffff8880614122e0 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_move_extents+0x3c7/0xaa0 fs/ocfs2/move_extents.c:925
#3: ffff88805587a648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
#3: ffff88805587a648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x18e/0x4c70 fs/ocfs2/suballoc.c:782
#4: ffff8880558789c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
#4: ffff8880558789c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}, at: ocfs2_move_extent fs/ocfs2/move_extents.c:632 [inline]
#4: ffff8880558789c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#7){+.+.}-{3:3}, at: __ocfs2_move_extents_range+0x1674/0x43f0 fs/ocfs2/move_extents.c:860
stack backtrace:
CPU: 1 PID: 4487 Comm: syz.4.30 Not tainted 5.15.178-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
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_move_extent fs/ocfs2/move_extents.c:640 [inline]
__ocfs2_move_extents_range+0x1ecb/0x43f0 fs/ocfs2/move_extents.c:860
ocfs2_move_extents+0x3ea/0xaa0 fs/ocfs2/move_extents.c:927
ocfs2_ioctl_move_extents+0x5d2/0x800 fs/ocfs2/move_extents.c:1053
ocfs2_ioctl+0x2eb/0x7d0 fs/ocfs2/ioctl.c:931
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
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:0x7f5e6e7fb169
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:00007f5e6c664038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f5e6ea13fa0 RCX: 00007f5e6e7fb169
RDX: 00004000000000c0 RSI: 0000000040406f06 RDI: 0000000000000004
RBP: 00007f5e6e87c2a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f5e6ea13fa0 R15: 00007fff07157b88
</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