ntfs3: loop2: Different NTFS sector size (4096) and media sector size (512). ntfs3: loop2: Failed to initialize $Extend/$Reparse. ================================================================== BUG: KASAN: slab-use-after-free in __list_add_valid_or_report+0x4c/0xf0 lib/list_debug.c:29 Read of size 8 at addr ffff88807ab87c20 by task syz.2.70/5984 CPU: 0 UID: 0 PID: 5984 Comm: syz.2.70 Not tainted 6.11.0-rc4-syzkaller-00019-gb311c1b497e5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 __list_add_valid_or_report+0x4c/0xf0 lib/list_debug.c:29 __list_add_valid include/linux/list.h:88 [inline] __list_add include/linux/list.h:150 [inline] list_add include/linux/list.h:169 [inline] chrdev_open+0x2a9/0x630 fs/char_dev.c:396 do_dentry_open+0x970/0x1440 fs/open.c:959 vfs_open+0x3e/0x330 fs/open.c:1089 do_open fs/namei.c:3727 [inline] path_openat+0x2b3e/0x3470 fs/namei.c:3886 do_filp_open+0x235/0x490 fs/namei.c:3913 do_sys_openat2+0x13e/0x1d0 fs/open.c:1416 do_sys_open fs/open.c:1431 [inline] __do_sys_openat fs/open.c:1447 [inline] __se_sys_openat fs/open.c:1442 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1442 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0ae1179e79 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0ae1fe2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f0ae1315f80 RCX: 00007f0ae1179e79 RDX: 0000000000000040 RSI: 0000000020000080 RDI: ffffffffffffff9c RBP: 00007f0ae11e7916 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f0ae1315f80 R15: 00007ffe715c33f8 Allocated by task 5839: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_lru_noprof+0x139/0x2b0 mm/slub.c:4056 ntfs_alloc_inode+0x28/0x80 fs/ntfs3/super.c:559 alloc_inode fs/inode.c:263 [inline] new_inode_pseudo fs/inode.c:1073 [inline] new_inode+0x6e/0x310 fs/inode.c:1092 ntfs_new_inode+0x45/0x100 fs/ntfs3/fsntfs.c:1688 ntfs_create_inode+0x681/0x3880 fs/ntfs3/inode.c:1345 ntfs_mknod+0x3c/0x50 fs/ntfs3/namei.c:120 vfs_mknod+0x36d/0x3b0 fs/namei.c:4088 do_mknodat+0x3ec/0x5b0 __do_sys_mknodat fs/namei.c:4166 [inline] __se_sys_mknodat fs/namei.c:4163 [inline] __x64_sys_mknodat+0xa7/0xc0 fs/namei.c:4163 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5386: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kmem_cache_free+0x145/0x350 mm/slub.c:4548 rcu_do_batch kernel/rcu/tree.c:2569 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2843 handle_softirqs+0x2c4/0x970 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 __call_rcu_common kernel/rcu/tree.c:3106 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:3210 destroy_inode fs/inode.c:318 [inline] evict+0x88b/0x950 fs/inode.c:729 __dentry_kill+0x20d/0x630 fs/dcache.c:610 shrink_kill+0xa9/0x2c0 fs/dcache.c:1055 shrink_dentry_list+0x2c0/0x5b0 fs/dcache.c:1082 shrink_dcache_parent+0xcb/0x3b0 do_one_tree+0x23/0xe0 fs/dcache.c:1545 shrink_dcache_for_umount+0xb4/0x180 fs/dcache.c:1562 generic_shutdown_super+0x6a/0x2d0 fs/super.c:620 kill_block_super+0x44/0x90 fs/super.c:1696 ntfs3_kill_sb+0x44/0x1b0 fs/ntfs3/super.c:1780 deactivate_locked_super+0xc4/0x130 fs/super.c:473 cleanup_mnt+0x41f/0x4b0 fs/namespace.c:1373 task_work_run+0x24f/0x310 kernel/task_work.c:228 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88807ab87580 which belongs to the cache ntfs_inode_cache of size 1752 The buggy address is located 1696 bytes inside of freed 1752-byte region [ffff88807ab87580, ffff88807ab87c58) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807ab87580 pfn:0x7ab80 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88806bdfa001 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000040 ffff888018388640 dead000000000122 0000000000000000 raw: ffff88807ab87580 0000000080110010 00000001fdffffff ffff88806bdfa001 head: 00fff00000000040 ffff888018388640 dead000000000122 0000000000000000 head: ffff88807ab87580 0000000080110010 00000001fdffffff ffff88806bdfa001 head: 00fff00000000003 ffffea0001eae001 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 5448, tgid 5447 (syz.4.18), ts 94558176274, free_ts 94539440533 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3439 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4695 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] kmem_cache_alloc_lru_noprof+0x1c5/0x2b0 mm/slub.c:4056 ntfs_alloc_inode+0x28/0x80 fs/ntfs3/super.c:559 alloc_inode fs/inode.c:263 [inline] iget5_locked+0xa3/0x250 fs/inode.c:1294 ntfs_iget5+0xc7/0x3bb0 fs/ntfs3/inode.c:530 ntfs_fill_super+0x2569/0x4730 fs/ntfs3/super.c:1208 get_tree_bdev+0x3f7/0x570 fs/super.c:1635 vfs_get_tree+0x90/0x2a0 fs/super.c:1800 do_new_mount+0x2be/0xb40 fs/namespace.c:3472 do_mount fs/namespace.c:3812 [inline] __do_sys_mount fs/namespace.c:4020 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997 page last free pid 4670 tgid 4670 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xd19/0xea0 mm/page_alloc.c:2612 discard_slab mm/slub.c:2583 [inline] __put_partials+0xeb/0x130 mm/slub.c:3051 put_cpu_partial+0x17c/0x250 mm/slub.c:3126 __slab_free+0x2ea/0x3d0 mm/slub.c:4343 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4044 getname_flags+0xb7/0x540 fs/namei.c:139 do_readlinkat+0xd8/0x3a0 fs/stat.c:536 __do_sys_readlink fs/stat.c:574 [inline] __se_sys_readlink fs/stat.c:571 [inline] __x64_sys_readlink+0x7f/0x90 fs/stat.c:571 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88807ab87b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807ab87b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807ab87c00: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ^ ffff88807ab87c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807ab87d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================