================================================================== BUG: KASAN: slab-out-of-bounds in ntfs_trim_fs+0x84f/0x950 fs/ntfs3/bitmap.c:1434 Read of size 2 at addr ffff88807eff9282 by task syz-executor.0/27642 CPU: 0 PID: 27642 Comm: syz-executor.0 Not tainted 6.1.0-rc8-syzkaller-00152-g3ecc37918c80 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbf/0x1f0 mm/kasan/report.c:495 ntfs_trim_fs+0x84f/0x950 fs/ntfs3/bitmap.c:1434 ntfs_ioctl_fitrim+0x23e/0x340 fs/ntfs3/file.c:40 ntfs_ioctl+0xa0/0xe0 fs/ntfs3/file.c:57 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f4c2348c0d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4c24243168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f4c235abf80 RCX: 00007f4c2348c0d9 RDX: 00000000200000c0 RSI: 00000000c0185879 RDI: 0000000000000004 RBP: 00007f4c234e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc6f0a990f R14: 00007f4c24243300 R15: 0000000000022000 Allocated by task 27642: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa5/0xb0 mm/kasan/common.c:380 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc+0x5a/0xd0 mm/slab_common.c:968 kmalloc_array include/linux/slab.h:605 [inline] kcalloc include/linux/slab.h:636 [inline] wnd_init+0x2ff/0x460 fs/ntfs3/bitmap.c:664 ntfs_fill_super+0x2696/0x37f0 fs/ntfs3/super.c:1118 get_tree_bdev+0x444/0x760 fs/super.c:1324 vfs_get_tree+0x8d/0x2f0 fs/super.c:1531 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x132a/0x1e20 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88807eff9280 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 2 bytes inside of 8-byte region [ffff88807eff9280, ffff88807eff9288) The buggy address belongs to the physical page: page:ffffea0001fbfe40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7eff9 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000001 ffff888012041280 raw: 0000000000000000 0000000080660066 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 23384, tgid 23363 (syz-executor.4), ts 744669323888, free_ts 744665562446 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4291 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5558 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1794 [inline] allocate_slab+0x25f/0x350 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3180 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x199/0x3e0 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc_node_track_caller+0x4b/0xc0 mm/slab_common.c:975 kvasprintf+0xbe/0x160 lib/kasprintf.c:25 kvasprintf_const+0x64/0x190 lib/kasprintf.c:49 kobject_set_name_vargs+0x5a/0x150 lib/kobject.c:257 kobject_add_varg lib/kobject.c:352 [inline] kobject_init_and_add+0xcd/0x160 lib/kobject.c:441 netdev_queue_add_kobject net/core/net-sysfs.c:1666 [inline] netdev_queue_update_kobjects+0x203/0x4f0 net/core/net-sysfs.c:1718 register_queue_kobjects net/core/net-sysfs.c:1779 [inline] netdev_register_kobject+0x334/0x400 net/core/net-sysfs.c:2019 register_netdevice+0xd99/0x1670 net/core/dev.c:10057 __ip_tunnel_create+0x398/0x570 net/ipv4/ip_tunnel.c:267 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x1d/0x4d0 mm/page_alloc.c:3483 __folio_put_small mm/swap.c:105 [inline] __folio_put+0xc5/0x140 mm/swap.c:128 folio_put include/linux/mm.h:1159 [inline] put_page include/linux/mm.h:1211 [inline] anon_pipe_buf_release+0x3fb/0x4c0 fs/pipe.c:138 pipe_buf_release include/linux/pipe_fs_i.h:183 [inline] free_pipe_info+0x200/0x3b0 fs/pipe.c:844 put_pipe_info fs/pipe.c:711 [inline] pipe_release+0x2ba/0x310 fs/pipe.c:734 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16f/0x270 kernel/task_work.c:179 get_signal+0x1c7/0x2440 kernel/signal.c:2635 arch_do_signal_or_restart+0x86/0x2300 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:296 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88807eff9180: fc fc fa fc fc fc fc fa fc fc fc fc fa fc fc fc ffff88807eff9200: fc fb fc fc fc fc fa fc fc fc fc fa fc fc fc fc >ffff88807eff9280: 02 fc fc fc fc fa fc fc fc fc fa fc fc fc fc fa ^ ffff88807eff9300: fc fc fc fc fa fc fc fc fc fa fc fc fc fc fa fc ffff88807eff9380: fc fc fc fa fc fc fc fc fa fc fc fc fc fa fc fc ==================================================================