====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc6-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/9393 is trying to acquire lock: ffff888078dcf510 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x40/0x6c0 fs/ntfs/mft.c:154 but task is already holding lock: ffff888078dcf480 (&rl->lock){++++}-{3:3}, at: ntfs_map_runlist+0x24/0xb0 fs/ntfs/attrib.c:288 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&rl->lock){++++}-{3:3}: down_read+0x9c/0x450 kernel/locking/rwsem.c:1509 ntfs_read_block fs/ntfs/aops.c:248 [inline] ntfs_read_folio+0x1bd7/0x2e10 fs/ntfs/aops.c:436 filemap_read_folio+0xdb/0x2c0 mm/filemap.c:2407 do_read_cache_folio+0x1df/0x510 mm/filemap.c:3534 do_read_cache_page mm/filemap.c:3576 [inline] read_cache_page+0x5d/0x170 mm/filemap.c:3585 read_mapping_page include/linux/pagemap.h:756 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x24f/0x1ea0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x198e/0x1cc0 fs/ntfs/mft.c:787 write_mft_record+0x14e/0x3b0 fs/ntfs/mft.h:95 __ntfs_write_inode+0x915/0xc40 fs/ntfs/inode.c:3050 write_inode fs/fs-writeback.c:1440 [inline] __writeback_single_inode+0xcfc/0x1440 fs/fs-writeback.c:1652 writeback_sb_inodes+0x54d/0xf90 fs/fs-writeback.c:1870 __writeback_inodes_wb+0xc6/0x280 fs/fs-writeback.c:1941 wb_writeback+0x8d6/0xd70 fs/fs-writeback.c:2046 wb_check_start_all fs/fs-writeback.c:2168 [inline] wb_do_writeback fs/fs-writeback.c:2194 [inline] wb_workfn+0xb3e/0x12f0 fs/fs-writeback.c:2227 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 -> #0 (&ni->mrec_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1360 kernel/locking/mutex.c:747 map_mft_record+0x40/0x6c0 fs/ntfs/mft.c:154 ntfs_map_runlist_nolock+0xb5e/0x1700 fs/ntfs/attrib.c:91 ntfs_map_runlist+0x7b/0xb0 fs/ntfs/attrib.c:292 ntfs_read_block fs/ntfs/aops.c:283 [inline] ntfs_read_folio+0x1c31/0x2e10 fs/ntfs/aops.c:436 read_pages+0xa16/0xd60 mm/readahead.c:181 page_cache_ra_unbounded+0x477/0x5e0 mm/readahead.c:270 do_page_cache_ra mm/readahead.c:300 [inline] page_cache_ra_order+0x6ec/0xa00 mm/readahead.c:560 ondemand_readahead+0x6b3/0x1000 mm/readahead.c:682 page_cache_sync_ra+0x1c9/0x200 mm/readahead.c:709 page_cache_sync_readahead include/linux/pagemap.h:1213 [inline] filemap_get_pages+0x2ca/0x16b0 mm/filemap.c:2581 filemap_read+0x315/0xc00 mm/filemap.c:2675 generic_file_read_iter+0x3b4/0x5a0 mm/filemap.c:2821 __kernel_read+0x2ca/0x7c0 fs/read_write.c:428 integrity_kernel_read+0x7f/0xb0 security/integrity/iint.c:199 ima_calc_file_hash_tfm+0x2aa/0x3b0 security/integrity/ima/ima_crypto.c:485 ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0x195/0x4a0 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x642/0x7b0 security/integrity/ima/ima_api.c:292 process_measurement+0xd1e/0x18b0 security/integrity/ima/ima_main.c:337 ima_file_check+0xb0/0x100 security/integrity/ima/ima_main.c:517 do_open fs/namei.c:3559 [inline] path_openat+0x1611/0x2860 fs/namei.c:3713 do_filp_open+0x1ba/0x410 fs/namei.c:3740 do_sys_openat2+0x16d/0x4c0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_compat_sys_openat fs/open.c:1386 [inline] __se_compat_sys_openat fs/open.c:1384 [inline] __ia32_compat_sys_openat+0x143/0x1f0 fs/open.c:1384 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 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.1/9393: #0: ffff8880244e2bc0 (&iint->mutex){+.+.}-{3:3}, at: process_measurement+0x3b9/0x18b0 security/integrity/ima/ima_main.c:260 #1: ffff888078dcf990 (mapping.invalidate_lock#4){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:811 [inline] #1: ffff888078dcf990 (mapping.invalidate_lock#4){.+.+}-{3:3}, at: page_cache_ra_unbounded+0x153/0x5e0 mm/readahead.c:226 #2: ffff888078dcf480 (&rl->lock){++++}-{3:3}, at: ntfs_map_runlist+0x24/0xb0 fs/ntfs/attrib.c:288 stack backtrace: CPU: 2 PID: 9393 Comm: syz-executor.1 Not tainted 6.1.0-rc6-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1360 kernel/locking/mutex.c:747 map_mft_record+0x40/0x6c0 fs/ntfs/mft.c:154 ntfs_map_runlist_nolock+0xb5e/0x1700 fs/ntfs/attrib.c:91 ntfs_map_runlist+0x7b/0xb0 fs/ntfs/attrib.c:292 ntfs_read_block fs/ntfs/aops.c:283 [inline] ntfs_read_folio+0x1c31/0x2e10 fs/ntfs/aops.c:436 read_pages+0xa16/0xd60 mm/readahead.c:181 page_cache_ra_unbounded+0x477/0x5e0 mm/readahead.c:270 do_page_cache_ra mm/readahead.c:300 [inline] page_cache_ra_order+0x6ec/0xa00 mm/readahead.c:560 ondemand_readahead+0x6b3/0x1000 mm/readahead.c:682 page_cache_sync_ra+0x1c9/0x200 mm/readahead.c:709 page_cache_sync_readahead include/linux/pagemap.h:1213 [inline] filemap_get_pages+0x2ca/0x16b0 mm/filemap.c:2581 filemap_read+0x315/0xc00 mm/filemap.c:2675 generic_file_read_iter+0x3b4/0x5a0 mm/filemap.c:2821 __kernel_read+0x2ca/0x7c0 fs/read_write.c:428 integrity_kernel_read+0x7f/0xb0 security/integrity/iint.c:199 ima_calc_file_hash_tfm+0x2aa/0x3b0 security/integrity/ima/ima_crypto.c:485 ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0x195/0x4a0 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x642/0x7b0 security/integrity/ima/ima_api.c:292 process_measurement+0xd1e/0x18b0 security/integrity/ima/ima_main.c:337 ima_file_check+0xb0/0x100 security/integrity/ima/ima_main.c:517 do_open fs/namei.c:3559 [inline] path_openat+0x1611/0x2860 fs/namei.c:3713 do_filp_open+0x1ba/0x410 fs/namei.c:3740 do_sys_openat2+0x16d/0x4c0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_compat_sys_openat fs/open.c:1386 [inline] __se_compat_sys_openat fs/open.c:1384 [inline] __ia32_compat_sys_openat+0x143/0x1f0 fs/open.c:1384 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7f08549 Code: 03 74 c0 01 10 05 03 74 b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f7ee25cc EFLAGS: 00000296 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000020000240 RDX: 0000000000028002 RSI: 00000000000000a1 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ntfs: (device loop1): ntfs_mapping_pairs_decompress(): Corrupt attribute. ntfs: (device loop1): ntfs_read_block(): Failed to read from inode 0x41, attribute type 0x80, vcn 0x0, offset 0x0 because its location on disk could not be determined even after retrying (error code -5). ntfs: (device loop1): ntfs_mapping_pairs_decompress(): Corrupt attribute. ntfs: (device loop1): ntfs_read_block(): Failed to read from inode 0x41, attribute type 0x80, vcn 0x0, offset 0x200 because its location on disk could not be determined even after retrying (error code -5). ntfs: (device loop1): ntfs_mapping_pairs_decompress(): Corrupt attribute. ntfs: (device loop1): ntfs_read_block(): Failed to read from inode 0x41, attribute type 0x80, vcn 0x1, offset 0x0 because its location on disk could not be determined even after retrying (error code -5). ntfs: (device loop1): ntfs_mapping_pairs_decompress(): Corrupt attribute. ntfs: (device loop1): ntfs_read_block(): Failed to read from inode 0x41, attribute type 0x80, vcn 0x1, offset 0x200 because its location on disk could not be determined even after retrying (error code -5). ntfs: (device loop1): ntfs_mapping_pairs_decompress(): Corrupt attribute. ntfs: (device loop1): ntfs_read_block(): Failed to read from inode 0x41, attribute type 0x80, vcn 0x0, offset 0x0 because its location on disk could not be determined even after retrying (error code -5). ---------------- Code disassembly (best guess): 0: 03 74 c0 01 add 0x1(%rax,%rax,8),%esi 4: 10 05 03 74 b8 01 adc %al,0x1b87403(%rip) # 0x1b8740d a: 10 06 adc %al,(%rsi) c: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 10: 10 07 adc %al,(%rdi) 12: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi 16: 10 08 adc %cl,(%rax) 18: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1c: 00 00 add %al,(%rax) 1e: 00 00 add %al,(%rax) 20: 00 51 52 add %dl,0x52(%rcx) 23: 55 push %rbp 24: 89 e5 mov %esp,%ebp 26: 0f 34 sysenter 28: cd 80 int $0x80 * 2a: 5d pop %rbp <-- trapping instruction 2b: 5a pop %rdx 2c: 59 pop %rcx 2d: c3 retq 2e: 90 nop 2f: 90 nop 30: 90 nop 31: 90 nop 32: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 39: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi