loop0: detected capacity change from 0 to 4096 ntfs3(loop0): Different NTFS sector size (1024) and media sector size (512). ntfs3(loop0): Mark volume as dirty due to NTFS errors ================================================================== BUG: KFENCE: use-after-free read in ntfs_read_mft fs/ntfs3/inode.c:80 [inline] BUG: KFENCE: use-after-free read in ntfs_iget5+0x64f/0x38e0 fs/ntfs3/inode.c:542 Use-after-free read at 0xffff88805b35223e (in kfence-#168): ntfs_read_mft fs/ntfs3/inode.c:80 [inline] ntfs_iget5+0x64f/0x38e0 fs/ntfs3/inode.c:542 ntfs_dir_emit fs/ntfs3/dir.c:337 [inline] ntfs_read_hdr+0x7c3/0xc80 fs/ntfs3/dir.c:385 ntfs_readdir+0x6f4/0xe40 fs/ntfs3/dir.c:504 iterate_dir+0x399/0x570 fs/readdir.c:110 __do_sys_getdents fs/readdir.c:319 [inline] __se_sys_getdents+0xf1/0x270 fs/readdir.c:304 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0x560 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f kfence-#168: 0xffff88805b352000-0xffff88805b3523ff, size=1024, cache=kmalloc-1k allocated by task 5324 on cpu 0 at 85.331463s (0.061679s ago): kmalloc_noprof include/linux/slab.h:954 [inline] mi_init+0x76/0xe0 fs/ntfs3/record.c:105 ntfs_read_mft fs/ntfs3/inode.c:55 [inline] ntfs_iget5+0x36a/0x38e0 fs/ntfs3/inode.c:542 dir_search_u+0x1fd/0x2e0 fs/ntfs3/dir.c:265 ntfs_lookup+0x100/0x1d0 fs/ntfs3/namei.c:85 __lookup_slow+0x2b7/0x410 fs/namei.c:1915 lookup_slow+0x53/0x70 fs/namei.c:1932 walk_component fs/namei.c:2278 [inline] lookup_last fs/namei.c:2785 [inline] path_lookupat+0x3f5/0x8c0 fs/namei.c:2809 filename_lookup+0x256/0x5d0 fs/namei.c:2838 do_fchownat+0xfa/0x250 fs/open.c:800 __do_sys_chown fs/open.c:824 [inline] __se_sys_chown fs/open.c:822 [inline] __x64_sys_chown+0x82/0xa0 fs/open.c:822 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0x560 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f freed by task 1155 on cpu 0 at 85.362744s (0.058108s ago): ni_try_remove_attr_list+0xd78/0xf30 fs/ntfs3/frecord.c:-1 ni_write_inode+0xa27/0xff0 fs/ntfs3/frecord.c:3191 write_inode fs/fs-writeback.c:1584 [inline] __writeback_single_inode+0x75a/0x10e0 fs/fs-writeback.c:1827 writeback_sb_inodes+0x979/0x19d0 fs/fs-writeback.c:2056 __writeback_inodes_wb+0x111/0x240 fs/fs-writeback.c:2132 wb_writeback+0x459/0xb00 fs/fs-writeback.c:2243 wb_check_start_all fs/fs-writeback.c:2369 [inline] wb_do_writeback fs/fs-writeback.c:2395 [inline] wb_workfn+0x921/0xf10 fs/fs-writeback.c:2428 process_one_work kernel/workqueue.c:3314 [inline] process_scheduled_works+0xb5d/0x1860 kernel/workqueue.c:3397 worker_thread+0xa53/0xfc0 kernel/workqueue.c:3478 kthread+0x389/0x470 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 CPU: 0 UID: 0 PID: 5324 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:ntfs_read_mft fs/ntfs3/inode.c:80 [inline] RIP: 0010:ntfs_iget5+0x64f/0x38e0 fs/ntfs3/inode.c:542 Code: 08 31 ff e8 a3 f2 9b fe 48 83 e3 08 0f 85 2d 02 00 00 49 83 c7 06 4c 89 f8 48 c1 e8 03 42 0f b6 04 28 84 c0 0f 85 8b 2f 00 00 <45> 0f b7 3f 48 8b 44 24 58 48 8d 58 10 48 89 d8 48 c1 e8 03 42 0f RSP: 0018:ffffc9000e50f8e0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff888000bea500 RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc9000e50fb38 R08: ffff888000bea500 R09: 0000000000000003 R10: 00000000fffffffe R11: 0000000000000002 R12: ffff88800e51a000 R13: dffffc0000000000 R14: 1ffff92001ca1f4c R15: ffff88805b35223e FS: 00007f66818fb6c0(0000) GS:ffff88808c87b000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff88805b35223e CR3: 000000000e455000 CR4: 0000000000352ef0 Call Trace: ntfs_dir_emit fs/ntfs3/dir.c:337 [inline] ntfs_read_hdr+0x7c3/0xc80 fs/ntfs3/dir.c:385 ntfs_readdir+0x6f4/0xe40 fs/ntfs3/dir.c:504 iterate_dir+0x399/0x570 fs/readdir.c:110 __do_sys_getdents fs/readdir.c:319 [inline] __se_sys_getdents+0xf1/0x270 fs/readdir.c:304 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0x560 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f668099ce59 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f66818fafe8 EFLAGS: 00000246 ORIG_RAX: 000000000000004e RAX: ffffffffffffffda RBX: 00007f6680c15fa0 RCX: 00007f668099ce59 RDX: 00000000000000b8 RSI: 0000200000001fc0 RDI: 0000000000000005 RBP: 00007f6680a32d6f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f6680c16038 R14: 00007f6680c15fa0 R15: 00007ffefa1d61a8 ================================================================== ---------------- Code disassembly (best guess): 0: 08 31 or %dh,(%rcx) 2: ff ljmp (bad) 3: e8 a3 f2 9b fe call 0xfe9bf2ab 8: 48 83 e3 08 and $0x8,%rbx c: 0f 85 2d 02 00 00 jne 0x23f 12: 49 83 c7 06 add $0x6,%r15 16: 4c 89 f8 mov %r15,%rax 19: 48 c1 e8 03 shr $0x3,%rax 1d: 42 0f b6 04 28 movzbl (%rax,%r13,1),%eax 22: 84 c0 test %al,%al 24: 0f 85 8b 2f 00 00 jne 0x2fb5 * 2a: 45 0f b7 3f movzwl (%r15),%r15d <-- trapping instruction 2e: 48 8b 44 24 58 mov 0x58(%rsp),%rax 33: 48 8d 58 10 lea 0x10(%rax),%rbx 37: 48 89 d8 mov %rbx,%rax 3a: 48 c1 e8 03 shr $0x3,%rax 3e: 42 rex.X 3f: 0f .byte 0xf