loop2: detected capacity change from 0 to 4096 ================================================================== BUG: KASAN: slab-out-of-bounds in ntfs_iget5+0x160/0x3b50 fs/ntfs3/inode.c:531 Read of size 8 at addr ffff888076317f60 by task syz-executor.2/6090 CPU: 1 PID: 6090 Comm: syz-executor.2 Not tainted 6.5.0-rc5-syzkaller-00053-g13b937206866 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 ntfs_iget5+0x160/0x3b50 fs/ntfs3/inode.c:531 ntfs_fill_super+0x2cb7/0x4cb0 fs/ntfs3/super.c:1215 get_tree_bdev+0x468/0x6c0 fs/super.c:1318 vfs_get_tree+0x8c/0x270 fs/super.c:1519 do_new_mount+0x28f/0xae0 fs/namespace.c:3335 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f47bba7e1ea Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f47bc7dbee8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f47bc7dbf80 RCX: 00007f47bba7e1ea RDX: 00000000200002c0 RSI: 0000000020000000 RDI: 00007f47bc7dbf40 RBP: 00000000200002c0 R08: 00007f47bc7dbf80 R09: 0000000000010000 R10: 0000000000010000 R11: 0000000000000202 R12: 0000000020000000 R13: 00007f47bc7dbf40 R14: 000000000001f746 R15: 00000000200003c0 Allocated by task 5051: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x66/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook+0x6c/0x3b0 mm/slab.h:762 slab_alloc_node mm/slub.c:3470 [inline] slab_alloc mm/slub.c:3478 [inline] __kmem_cache_alloc_lru mm/slub.c:3485 [inline] kmem_cache_alloc_lru+0x122/0x300 mm/slub.c:3501 alloc_inode_sb include/linux/fs.h:2735 [inline] alloc_inode fs/inode.c:262 [inline] new_inode_pseudo+0x85/0x1d0 fs/inode.c:1018 new_inode+0x29/0x1d0 fs/inode.c:1046 debugfs_get_inode fs/debugfs/inode.c:72 [inline] __debugfs_create_file+0x147/0x500 fs/debugfs/inode.c:430 nsim_bpf_init+0x178/0x260 drivers/net/netdevsim/bpf.c:634 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:303 [inline] nsim_create+0x353/0x460 drivers/net/netdevsim/netdev.c:358 __nsim_dev_port_add+0x6c0/0xae0 drivers/net/netdevsim/dev.c:1390 nsim_dev_port_add_all+0x33/0xe0 drivers/net/netdevsim/dev.c:1446 nsim_drv_probe+0x85f/0xb80 drivers/net/netdevsim/dev.c:1604 really_probe+0x294/0xc30 drivers/base/dd.c:658 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:798 driver_probe_device+0x50/0x420 drivers/base/dd.c:828 __device_attach_driver+0x2d3/0x520 drivers/base/dd.c:956 bus_for_each_drv+0x24a/0x2d0 drivers/base/bus.c:457 __device_attach+0x32f/0x510 drivers/base/dd.c:1028 bus_probe_device+0x185/0x260 drivers/base/bus.c:532 device_add+0xb75/0xf60 drivers/base/core.c:3625 nsim_bus_dev_new drivers/net/netdevsim/bus.c:290 [inline] new_device_store+0x3e9/0x800 drivers/net/netdevsim/bus.c:167 kernfs_fop_write_iter+0x3a6/0x4f0 fs/kernfs/file.c:334 call_write_iter include/linux/fs.h:1877 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x782/0xaf0 fs/read_write.c:584 ksys_write+0x1a0/0x2c0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880763177b0 which belongs to the cache inode_cache of size 1168 The buggy address is located 800 bytes to the right of allocated 1168-byte region [ffff8880763177b0, ffff888076317c40) The buggy address belongs to the physical page: page:ffffea0001d8c500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x76314 head:ffffea0001d8c500 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888014675b40 dead000000000122 0000000000000000 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Reclaimable, gfp_mask 0xd20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 5051, tgid 5051 (syz-executor.0), ts 233782169405, free_ts 21507568635 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x31e8/0x3370 mm/page_alloc.c:3221 __alloc_pages+0x255/0x670 mm/page_alloc.c:4477 alloc_slab_page+0x6a/0x160 mm/slub.c:1862 allocate_slab mm/slub.c:2009 [inline] new_slab+0x84/0x2f0 mm/slub.c:2062 ___slab_alloc+0xade/0x1100 mm/slub.c:3215 __slab_alloc mm/slub.c:3314 [inline] __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] slab_alloc mm/slub.c:3478 [inline] __kmem_cache_alloc_lru mm/slub.c:3485 [inline] kmem_cache_alloc_lru+0x1bf/0x300 mm/slub.c:3501 alloc_inode_sb include/linux/fs.h:2735 [inline] alloc_inode fs/inode.c:262 [inline] new_inode_pseudo+0x85/0x1d0 fs/inode.c:1018 new_inode+0x29/0x1d0 fs/inode.c:1046 debugfs_get_inode fs/debugfs/inode.c:72 [inline] __debugfs_create_file+0x147/0x500 fs/debugfs/inode.c:430 nsim_ethtool_init+0x2aa/0x3f0 drivers/net/netdevsim/ethtool.c:191 nsim_create+0x223/0x460 drivers/net/netdevsim/netdev.c:356 __nsim_dev_port_add+0x6c0/0xae0 drivers/net/netdevsim/dev.c:1390 nsim_dev_port_add_all+0x33/0xe0 drivers/net/netdevsim/dev.c:1446 nsim_drv_probe+0x85f/0xb80 drivers/net/netdevsim/dev.c:1604 really_probe+0x294/0xc30 drivers/base/dd.c:658 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x903/0xa30 mm/page_alloc.c:2348 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2443 free_contig_range+0x9e/0x150 mm/page_alloc.c:6395 destroy_args+0x102/0x9a0 mm/debug_vm_pgtable.c:1029 debug_vm_pgtable+0x42a/0x4b0 mm/debug_vm_pgtable.c:1410 do_one_initcall+0x23d/0x7d0 init/main.c:1232 do_initcall_level+0x157/0x210 init/main.c:1294 do_initcalls+0x3f/0x80 init/main.c:1310 kernel_init_freeable+0x43b/0x5d0 init/main.c:1546 kernel_init+0x1d/0x2a0 init/main.c:1437 ret_from_fork+0x2e/0x60 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff888076317e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888076317e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888076317f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888076317f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888076318000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================