ntfs: volume version 3.1. ====================================================== WARNING: possible circular locking dependency detected 5.15.126-syzkaller-00092-g24c4de4069cb #0 Not tainted ------------------------------------------------------ syz-executor.3/7590 is trying to acquire lock: ffff00011f6a6cd0 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x6c/0x738 fs/ntfs/mft.c:154 but task is already holding lock: ffff00011f6a6c40 (&rl->lock){++++}-{3:3}, at: ntfs_attr_extend_allocation+0x450/0x34b8 fs/ntfs/attrib.c:2001 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: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:1478 [inline] __writeback_single_inode+0x584/0x13a4 fs/fs-writeback.c:1683 writeback_sb_inodes+0x94c/0x1620 fs/fs-writeback.c:1908 wb_writeback+0x3fc/0xfc8 fs/fs-writeback.c:2082 wb_do_writeback fs/fs-writeback.c:2225 [inline] wb_workfn+0x3a4/0x1070 fs/fs-writeback.c:2266 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: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_attr_extend_allocation+0x458/0x34b8 fs/ntfs/attrib.c:2002 ntfs_prepare_file_for_write fs/ntfs/file.c:395 [inline] ntfs_file_write_iter+0x380/0x170c fs/ntfs/file.c:1919 call_write_iter include/linux/fs.h:2103 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x87c/0xb3c fs/read_write.c:594 ksys_write+0x15c/0x26c fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:656 __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 *** 4 locks held by syz-executor.3/7590: #0: ffff0000c860dc70 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x128/0x170 fs/file.c:1088 #1: ffff0000c5db2460 (sb_writers#19){.+.+}-{0:0}, at: vfs_write+0x228/0xb3c fs/read_write.c:590 #2: ffff00011f6a6fb0 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #2: ffff00011f6a6fb0 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: ntfs_file_write_iter+0x7c/0x170c fs/ntfs/file.c:1916 #3: ffff00011f6a6c40 (&rl->lock){++++}-{3:3}, at: ntfs_attr_extend_allocation+0x450/0x34b8 fs/ntfs/attrib.c:2001 stack backtrace: CPU: 0 PID: 7590 Comm: syz-executor.3 Not tainted 5.15.126-syzkaller-00092-g24c4de4069cb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/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_attr_extend_allocation+0x458/0x34b8 fs/ntfs/attrib.c:2002 ntfs_prepare_file_for_write fs/ntfs/file.c:395 [inline] ntfs_file_write_iter+0x380/0x170c fs/ntfs/file.c:1919 call_write_iter include/linux/fs.h:2103 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x87c/0xb3c fs/read_write.c:594 ksys_write+0x15c/0x26c fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:656 __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 ntfs: (device loop3): ntfs_read_block(): Failed to read from inode 0x6, attribute type 0x80, vcn 0x0, offset 0x0 because its location on disk could not be determined even after retrying (error code -5). ntfs: (device loop3): ntfs_read_block(): Failed to read from inode 0x6, attribute type 0x80, vcn 0x0, offset 0x800 because its location on disk could not be determined even after retrying (error code -5). ntfs: (device loop3): ntfs_cluster_alloc(): Failed to map page. ntfs: (device loop3): ntfs_cluster_alloc(): Failed to allocate clusters, aborting (error -5).