ntfs3: loop5: Different NTFS sector size (4096) and media sector size (512). ================================================================== BUG: KASAN: slab-use-after-free in ntfs_iget5+0x120/0x2bbc fs/ntfs3/inode.c:535 Read of size 8 at addr ffff0000de8d7f60 by task syz-executor181/8372 CPU: 1 PID: 8372 Comm: syz-executor181 Not tainted 6.7.0-rc8-syzkaller-g0802e17d9aca #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:291 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:298 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x174/0x514 mm/kasan/report.c:475 kasan_report+0xd8/0x138 mm/kasan/report.c:588 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 ntfs_iget5+0x120/0x2bbc fs/ntfs3/inode.c:535 ntfs_fill_super+0x2180/0x3acc fs/ntfs3/super.c:1259 get_tree_bdev+0x33c/0x4a8 fs/super.c:1598 ntfs_fs_get_tree+0x28/0x38 fs/ntfs3/super.c:1685 vfs_get_tree+0x90/0x288 fs/super.c:1771 do_new_mount+0x25c/0x8c8 fs/namespace.c:3337 path_mount+0x590/0xe04 fs/namespace.c:3664 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount fs/namespace.c:3863 [inline] __arm64_sys_mount+0x45c/0x594 fs/namespace.c:3863 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x54/0x158 arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 Allocated by task 8354: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:511 __kasan_slab_alloc+0x74/0x8c mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x90/0x498 mm/slab.h:763 slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x288/0x410 mm/slub.c:3502 wnd_add_free_ext+0x75c/0xc00 fs/ntfs3/bitmap.c:338 wnd_rescan+0xa94/0xd60 fs/ntfs3/bitmap.c:622 wnd_init+0x1bc/0x2b4 fs/ntfs3/bitmap.c:668 ntfs_fill_super+0x2750/0x3acc fs/ntfs3/super.c:1340 get_tree_bdev+0x33c/0x4a8 fs/super.c:1598 ntfs_fs_get_tree+0x28/0x38 fs/ntfs3/super.c:1685 vfs_get_tree+0x90/0x288 fs/super.c:1771 do_new_mount+0x25c/0x8c8 fs/namespace.c:3337 path_mount+0x590/0xe04 fs/namespace.c:3664 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount fs/namespace.c:3863 [inline] __arm64_sys_mount+0x45c/0x594 fs/namespace.c:3863 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x54/0x158 arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 Freed by task 6117: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:522 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] kmem_cache_free+0x2e4/0x56c mm/slub.c:3831 wnd_close+0xc4/0xf4 fs/ntfs3/bitmap.c:136 ntfs3_put_sbi+0x38/0x1f0 fs/ntfs3/super.c:589 ntfs_put_super+0xd8/0xf0 fs/ntfs3/super.c:653 generic_shutdown_super+0x130/0x2b8 fs/super.c:696 kill_block_super+0x44/0x90 fs/super.c:1667 ntfs3_kill_sb+0x44/0x17c fs/ntfs3/super.c:1775 deactivate_locked_super+0xc4/0x144 fs/super.c:484 deactivate_super+0xe0/0x100 fs/super.c:517 cleanup_mnt+0x34c/0x3dc fs/namespace.c:1256 __cleanup_mnt+0x20/0x30 fs/namespace.c:1263 task_work_run+0x230/0x2e0 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x214c/0x393c arch/arm64/kernel/signal.c:1305 exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:144 [inline] el0_svc+0x9c/0x158 arch/arm64/kernel/entry-common.c:679 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 The buggy address belongs to the object at ffff0000de8d7f60 which belongs to the cache ntfs3_enode_cache of size 64 The buggy address is located 0 bytes inside of freed 64-byte region [ffff0000de8d7f60, ffff0000de8d7fa0) The buggy address belongs to the physical page: page:000000008ce13711 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11e8d7 flags: 0x5ffc00000000800(slab|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000800 ffff0000c2dfdb40 fffffc00037a0640 dead000000000002 raw: 0000000000000000 00000000002a002a 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000de8d7e00: fb fb fb fb fc fc fc fc fa fb fb fb fb fb fb fb ffff0000de8d7e80: fc fc fc fc fa fb fb fb fb fb fb fb fc fc fc fc >ffff0000de8d7f00: fa fb fb fb fb fb fb fb fc fc fc fc fa fb fb fb ^ ffff0000de8d7f80: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc ffff0000de8d8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ntfs3: loop5: ino=2, "/" ntfs_iget5 ntfs3: loop5: Mark volume as dirty due to NTFS errors Unable to handle kernel paging request at virtual address dfff800000000000 KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] Mem abort info: ESR = 0x0000000096000005 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x05: level 1 translation fault Data abort info: ISV = 0, ISS = 0x00000005, ISS2 = 0x00000000 CM = 0, WnR = 0, TnD = 0, TagAccess = 0 GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [dfff800000000000] address between user and kernel address ranges Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP Modules linked in: CPU: 1 PID: 8372 Comm: syz-executor181 Tainted: G B 6.7.0-rc8-syzkaller-g0802e17d9aca #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : log_replay+0x290/0x9440 fs/ntfs3/fslog.c:3756 lr : log_replay+0x14c/0x9440 fs/ntfs3/fslog.c:3723 sp : ffff800099517200 x29: ffff8000995175c0 x28: ffff800099517660 x27: ffff0000de8d7f40 x26: ffff800099517440 x25: ffff8000995174a0 x24: ffff800099517400 x23: dfff800000000000 x22: 0000000000000000 x21: ffff7000132a2e78 x20: ffff0000de8d81e0 x19: 0000000000000030 x18: 1fffe000368261ce x17: ffff80008e4ed000 x16: ffff80008a77ce00 x15: 0000000000000003 x14: 1ffff000132a2e88 x13: 0000000000000000 x12: 0000000000000000 x11: ffff8000995173c0 x10: ffff800099517530 x9 : 0000000000000003 x8 : 0000000000000000 x7 : 0000000000000000 x6 : ffff800080b2619c x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000010 x2 : 0000000000000008 x1 : 0000000000000000 x0 : ffff800099517540 Call trace: log_replay+0x290/0x9440 ntfs_loadlog_and_replay+0x23c/0x448 fs/ntfs3/fsntfs.c:324 ntfs_fill_super+0x21a8/0x3acc fs/ntfs3/super.c:1268 get_tree_bdev+0x33c/0x4a8 fs/super.c:1598 ntfs_fs_get_tree+0x28/0x38 fs/ntfs3/super.c:1685 vfs_get_tree+0x90/0x288 fs/super.c:1771 do_new_mount+0x25c/0x8c8 fs/namespace.c:3337 path_mount+0x590/0xe04 fs/namespace.c:3664 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount fs/namespace.c:3863 [inline] __arm64_sys_mount+0x45c/0x594 fs/namespace.c:3863 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x54/0x158 arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595 Code: 97ca4ce3 d343fec8 b9400293 f900b3e8 (38776908) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: 97ca4ce3 bl 0xffffffffff29338c 4: d343fec8 lsr x8, x22, #3 8: b9400293 ldr w19, [x20] c: f900b3e8 str x8, [sp, #352] * 10: 38776908 ldrb w8, [x8, x23] <-- trapping instruction