ntfs: volume version 3.1. ====================================================== WARNING: possible circular locking dependency detected 5.15.147-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/12898 is trying to acquire lock: ffff00010f820190 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x6c/0x738 fs/ntfs/mft.c:154 but task is already holding lock: ffff00010f820100 (&rl->lock){++++}-{3:3}, at: ntfs_truncate+0x178/0x224c fs/ntfs/inode.c:2378 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&rl->lock){++++}-{3:3}: down_read+0xc0/0x398 kernel/locking/rwsem.c:1488 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_readpage+0xf3c/0x1e04 fs/ntfs/aops.c:435 do_read_cache_page+0x60c/0x950 read_cache_page+0x68/0x84 mm/filemap.c:3574 read_mapping_page include/linux/pagemap.h:515 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x1e4/0x18f0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x104c/0x16ec fs/ntfs/mft.c:787 write_mft_record fs/ntfs/mft.h:95 [inline] __ntfs_write_inode+0x720/0xdc8 fs/ntfs/inode.c:3050 ntfs_write_inode+0x68/0x90 fs/ntfs/super.c:2656 write_inode fs/fs-writeback.c:1495 [inline] __writeback_single_inode+0x584/0x13a4 fs/fs-writeback.c:1705 writeback_sb_inodes+0x94c/0x1654 fs/fs-writeback.c:1930 wb_writeback+0x3fc/0xfc8 fs/fs-writeback.c:2104 wb_do_writeback fs/fs-writeback.c:2247 [inline] wb_workfn+0x3a4/0x1070 fs/fs-writeback.c:2288 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:319 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 -> #0 (&ni->mrec_lock){+.+.}-{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 __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 map_mft_record+0x6c/0x738 fs/ntfs/mft.c:154 ntfs_truncate+0x1e8/0x224c fs/ntfs/inode.c:2383 ntfs_truncate_vfs fs/ntfs/inode.c:2862 [inline] ntfs_setattr+0x260/0x320 fs/ntfs/inode.c:2914 notify_change+0xa34/0xcf8 fs/attr.c:505 do_truncate+0x1c0/0x28c fs/open.c:65 handle_truncate fs/namei.c:3271 [inline] do_open fs/namei.c:3618 [inline] path_openat+0x20e8/0x26f0 fs/namei.c:3748 do_filp_open+0x1a8/0x3b4 fs/namei.c:3775 do_sys_openat2+0x128/0x3d8 fs/open.c:1211 do_sys_open fs/open.c:1227 [inline] __do_sys_openat fs/open.c:1243 [inline] __se_sys_openat fs/open.c:1238 [inline] __arm64_sys_openat+0x1f0/0x240 fs/open.c:1238 __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: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rl->lock); lock(&ni->mrec_lock); lock(&rl->lock); lock(&ni->mrec_lock); *** DEADLOCK *** 3 locks held by syz-executor.5/12898: #0: ffff0000d2bb8460 (sb_writers#32){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:377 #1: ffff00010f820470 (&sb->s_type->i_mutex_key#35){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #1: ffff00010f820470 (&sb->s_type->i_mutex_key#35){+.+.}-{3:3}, at: do_truncate+0x1ac/0x28c fs/open.c:63 #2: ffff00010f820100 (&rl->lock){++++}-{3:3}, at: ntfs_truncate+0x178/0x224c fs/ntfs/inode.c:2378 stack backtrace: CPU: 1 PID: 12898 Comm: syz-executor.5 Not tainted 5.15.147-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 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 __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 map_mft_record+0x6c/0x738 fs/ntfs/mft.c:154 ntfs_truncate+0x1e8/0x224c fs/ntfs/inode.c:2383 ntfs_truncate_vfs fs/ntfs/inode.c:2862 [inline] ntfs_setattr+0x260/0x320 fs/ntfs/inode.c:2914 notify_change+0xa34/0xcf8 fs/attr.c:505 do_truncate+0x1c0/0x28c fs/open.c:65 handle_truncate fs/namei.c:3271 [inline] do_open fs/namei.c:3618 [inline] path_openat+0x20e8/0x26f0 fs/namei.c:3748 do_filp_open+0x1a8/0x3b4 fs/namei.c:3775 do_sys_openat2+0x128/0x3d8 fs/open.c:1211 do_sys_open fs/open.c:1227 [inline] __do_sys_openat fs/open.c:1243 [inline] __se_sys_openat fs/open.c:1238 [inline] __arm64_sys_openat+0x1f0/0x240 fs/open.c:1238 __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