loop0: detected capacity change from 0 to 4096 ntfs: volume version 3.1. ====================================================== WARNING: possible circular locking dependency detected 5.15.107-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/5258 is trying to acquire lock: ffff00011cf0aad0 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x6c/0x738 fs/ntfs/mft.c:154 but task is already holding lock: ffff00011cf0aa40 (&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+0xbc/0x11c 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:3565 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:1475 [inline] __writeback_single_inode+0x584/0x13a4 fs/fs-writeback.c:1680 writeback_sb_inodes+0x94c/0x1620 fs/fs-writeback.c:1905 wb_writeback+0x3fc/0xfc8 fs/fs-writeback.c:2079 wb_do_writeback fs/fs-writeback.c:2222 [inline] wb_workfn+0x3a4/0x1070 fs/fs-writeback.c:2263 process_one_work+0x790/0x11b8 kernel/workqueue.c:2306 worker_thread+0x910/0x1034 kernel/workqueue.c:2453 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:3787 [inline] __lock_acquire+0x32cc/0x7620 kernel/locking/lockdep.c:5011 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622 __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+0xac4/0xd60 fs/attr.c:488 do_truncate+0x1c0/0x28c fs/open.c:65 vfs_truncate+0x2e0/0x388 fs/open.c:111 do_sys_truncate+0xec/0x1b4 fs/open.c:134 __do_sys_truncate fs/open.c:146 [inline] __se_sys_truncate fs/open.c:144 [inline] __arm64_sys_truncate+0x5c/0x70 fs/open.c:144 __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:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 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.0/5258: #0: ffff00011af64460 (sb_writers#19){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:377 #1: ffff00011cf0adb0 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #1: ffff00011cf0adb0 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: do_truncate+0x1ac/0x28c fs/open.c:63 #2: ffff00011cf0aa40 (&rl->lock){++++}-{3:3}, at: ntfs_truncate+0x178/0x224c fs/ntfs/inode.c:2378 stack backtrace: CPU: 0 PID: 5258 Comm: syz-executor.0 Not tainted 5.15.107-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/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:3787 [inline] __lock_acquire+0x32cc/0x7620 kernel/locking/lockdep.c:5011 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622 __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+0xac4/0xd60 fs/attr.c:488 do_truncate+0x1c0/0x28c fs/open.c:65 vfs_truncate+0x2e0/0x388 fs/open.c:111 do_sys_truncate+0xec/0x1b4 fs/open.c:134 __do_sys_truncate fs/open.c:146 [inline] __se_sys_truncate fs/open.c:144 [inline] __arm64_sys_truncate+0x5c/0x70 fs/open.c:144 __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:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584