Hello,
syzbot found the following issue on:
HEAD commit: 6449a0ba6843 Linux 6.1.19
git tree: linux-6.1.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=1150e7b2c80000
kernel config:
https://syzkaller.appspot.com/x/.config?x=9ed8b3ec03e8c126
dashboard link:
https://syzkaller.appspot.com/bug?extid=784ba1c5dff60f10674b
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/0ad616da3180/disk-6449a0ba.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/42677a30acb3/vmlinux-6449a0ba.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/2e21fe35d03d/bzImage-6449a0ba.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+784ba1...@syzkaller.appspotmail.com
======================================================
WARNING: possible circular locking dependency detected
6.1.19-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.1/8281 is trying to acquire lock:
ffff8880706c0940 (&rl->lock){++++}-{3:3}, at: ntfs_read_block fs/ntfs/aops.c:248 [inline]
ffff8880706c0940 (&rl->lock){++++}-{3:3}, at: ntfs_read_folio+0x14c9/0x29d0 fs/ntfs/aops.c:436
but task is already holding lock:
ffff8880706c3310 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x48/0x630 fs/ntfs/mft.c:154
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&ni->mrec_lock){+.+.}-{3:3}:
lock_acquire+0x23a/0x630 kernel/locking/lockdep.c:5669
__mutex_lock_common+0x1d4/0x2520 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
map_mft_record+0x48/0x630 fs/ntfs/mft.c:154
ntfs_map_runlist_nolock+0x4b4/0x1790 fs/ntfs/attrib.c:91
ntfs_prepare_pages_for_non_resident_write fs/ntfs/file.c:882 [inline]
ntfs_perform_write+0x2273/0x7510 fs/ntfs/file.c:1844
ntfs_file_write_iter+0x10e9/0x19f0 fs/ntfs/file.c:1917
call_write_iter include/linux/fs.h:2205 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x7ae/0xba0 fs/read_write.c:584
ksys_write+0x19c/0x2c0 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #0 (&rl->lock){++++}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3098 [inline]
check_prevs_add kernel/locking/lockdep.c:3217 [inline]
validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3832
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056
lock_acquire+0x23a/0x630 kernel/locking/lockdep.c:5669
down_read+0x39/0x50 kernel/locking/rwsem.c:1520
ntfs_read_block fs/ntfs/aops.c:248 [inline]
ntfs_read_folio+0x14c9/0x29d0 fs/ntfs/aops.c:436
filemap_read_folio+0x199/0x780 mm/filemap.c:2407
do_read_cache_folio+0x2ee/0x810 mm/filemap.c:3535
do_read_cache_page+0x32/0x220 mm/filemap.c:3577
read_mapping_page include/linux/pagemap.h:756 [inline]
ntfs_map_page fs/ntfs/aops.h:75 [inline]
ntfs_sync_mft_mirror+0x25b/0x1ad0 fs/ntfs/mft.c:480
write_mft_record_nolock+0x13f6/0x18d0 fs/ntfs/mft.c:805
write_mft_record+0x149/0x310 fs/ntfs/mft.h:95
__ntfs_write_inode+0x6ff/0xbb0 fs/ntfs/inode.c:3050
ntfs_commit_inode fs/ntfs/inode.h:300 [inline]
ntfs_put_super+0x676/0xf80 fs/ntfs/super.c:2307
generic_shutdown_super+0x130/0x340 fs/super.c:492
kill_block_super+0x7a/0xe0 fs/super.c:1441
deactivate_locked_super+0xa0/0x110 fs/super.c:332
cleanup_mnt+0x490/0x520 fs/namespace.c:1186
task_work_run+0x246/0x300 kernel/task_work.c:179
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0x6fb/0x2300 kernel/exit.c:869
do_group_exit+0x202/0x2b0 kernel/exit.c:1019
get_signal+0x16f7/0x17d0 kernel/signal.c:2858
arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:869
exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x60/0x2d0 kernel/entry/common.c:296
ret_from_fork+0x15/0x30 arch/x86/entry/entry_64.S:299
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&ni->mrec_lock);
lock(&rl->lock);
lock(&ni->mrec_lock);
lock(&rl->lock);
*** DEADLOCK ***
2 locks held by syz-executor.1/8281:
#0: ffff88804016c0e0 (&type->s_umount_key#94){++++}-{3:3}, at: deactivate_super+0xa9/0xe0 fs/super.c:362
#1: ffff8880706c3310 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x48/0x630 fs/ntfs/mft.c:154
stack backtrace:
CPU: 1 PID: 8281 Comm: syz-executor.1 Not tainted 6.1.19-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
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:2178
check_prev_add kernel/locking/lockdep.c:3098 [inline]
check_prevs_add kernel/locking/lockdep.c:3217 [inline]
validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3832
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056
lock_acquire+0x23a/0x630 kernel/locking/lockdep.c:5669
down_read+0x39/0x50 kernel/locking/rwsem.c:1520
ntfs_read_block fs/ntfs/aops.c:248 [inline]
ntfs_read_folio+0x14c9/0x29d0 fs/ntfs/aops.c:436
filemap_read_folio+0x199/0x780 mm/filemap.c:2407
do_read_cache_folio+0x2ee/0x810 mm/filemap.c:3535
do_read_cache_page+0x32/0x220 mm/filemap.c:3577
read_mapping_page include/linux/pagemap.h:756 [inline]
ntfs_map_page fs/ntfs/aops.h:75 [inline]
ntfs_sync_mft_mirror+0x25b/0x1ad0 fs/ntfs/mft.c:480
write_mft_record_nolock+0x13f6/0x18d0 fs/ntfs/mft.c:805
write_mft_record+0x149/0x310 fs/ntfs/mft.h:95
__ntfs_write_inode+0x6ff/0xbb0 fs/ntfs/inode.c:3050
ntfs_commit_inode fs/ntfs/inode.h:300 [inline]
ntfs_put_super+0x676/0xf80 fs/ntfs/super.c:2307
generic_shutdown_super+0x130/0x340 fs/super.c:492
kill_block_super+0x7a/0xe0 fs/super.c:1441
deactivate_locked_super+0xa0/0x110 fs/super.c:332
cleanup_mnt+0x490/0x520 fs/namespace.c:1186
task_work_run+0x246/0x300 kernel/task_work.c:179
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0x6fb/0x2300 kernel/exit.c:869
do_group_exit+0x202/0x2b0 kernel/exit.c:1019
get_signal+0x16f7/0x17d0 kernel/signal.c:2858
arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:869
exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x60/0x2d0 kernel/entry/common.c:296
ret_from_fork+0x15/0x30 arch/x86/entry/entry_64.S:299
RIP: 0033:0x7f503ce8c0f9
Code: Unable to access opcode bytes at 0x7f503ce8c0cf.
RSP: 002b:00007f503db6d118 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: 0000000000000000 RBX: 00007f503cfabf80 RCX: 00007f503ce8c0f9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007f503cee7b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffe992934ef R14: 00007f503db6d300 R15: 0000000000022000
</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.