================================================================== BUG: KASAN: slab-out-of-bounds in ntfs_trim_fs+0x84f/0x950 fs/ntfs3/bitmap.c:1434 Read of size 2 at addr ffff88801ebefc50 by task syz-executor.0/18633 CPU: 0 PID: 18633 Comm: syz-executor.0 Not tainted 6.1.0-syzkaller #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/0x461 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:0x7f163008c0d9 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:00007f1630d6d168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f16301abf80 RCX: 00007f163008c0d9 RDX: 00000000200000c0 RSI: 00000000c0185879 RDI: 0000000000000004 RBP: 00007f16300e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdf07dbfdf R14: 00007f1630d6d300 R15: 0000000000022000 Allocated by task 7548: 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+0xa3/0xb0 mm/kasan/common.c:380 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc_node+0x5d/0xd0 mm/slab_common.c:962 kmalloc_array_node include/linux/slab.h:666 [inline] kcalloc_node include/linux/slab.h:671 [inline] memcg_alloc_slab_cgroups+0xee/0x1e0 mm/memcontrol.c:2885 account_slab mm/slab.h:635 [inline] kmem_getpages mm/slab.c:1371 [inline] cache_grow_begin+0x300/0x390 mm/slab.c:2570 cache_alloc_refill+0x27f/0x380 mm/slab.c:2943 ____cache_alloc mm/slab.c:3019 [inline] ____cache_alloc mm/slab.c:3002 [inline] __do_cache_alloc mm/slab.c:3202 [inline] slab_alloc_node mm/slab.c:3250 [inline] slab_alloc mm/slab.c:3265 [inline] __kmem_cache_alloc_lru mm/slab.c:3442 [inline] kmem_cache_alloc+0x364/0x460 mm/slab.c:3461 sk_prot_alloc+0x5f/0x290 net/core/sock.c:2024 sk_alloc+0x3a/0x780 net/core/sock.c:2083 unix_create1+0xaa/0x920 net/unix/af_unix.c:959 unix_create+0x114/0x220 net/unix/af_unix.c:1026 __sock_create+0x359/0x790 net/socket.c:1515 io_uring_get_file io_uring/io_uring.c:3382 [inline] io_uring_create io_uring/io_uring.c:3551 [inline] io_uring_setup.cold+0x1772/0x1ac8 io_uring/io_uring.c:3601 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 ffff88801ebefc40 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 16 bytes inside of 32-byte region [ffff88801ebefc40, ffff88801ebefc60) The buggy address belongs to the physical page: page:ffffea00007afbc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801ebeffc1 pfn:0x1ebef flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00005ffe08 ffffea0001d2d588 ffff888012040100 raw: ffff88801ebeffc1 ffff88801ebef000 000000010000003f 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 0x3420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 3876, tgid 3876 (syz-executor.5), ts 256082922427, free_ts 256036538199 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_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x94/0x390 mm/slab.c:2570 cache_alloc_refill+0x27f/0x380 mm/slab.c:2943 ____cache_alloc mm/slab.c:3019 [inline] ____cache_alloc mm/slab.c:3002 [inline] __do_cache_alloc mm/slab.c:3202 [inline] slab_alloc_node mm/slab.c:3250 [inline] __kmem_cache_alloc_node+0x44a/0x510 mm/slab.c:3549 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc+0x4a/0xd0 mm/slab_common.c:968 kmalloc include/linux/slab.h:558 [inline] kzalloc include/linux/slab.h:689 [inline] lsm_task_alloc security/security.c:617 [inline] security_task_alloc+0x10f/0x250 security/security.c:1657 copy_process+0x23cf/0x7190 kernel/fork.c:2235 kernel_clone+0xeb/0x980 kernel/fork.c:2671 __do_sys_clone+0xba/0x100 kernel/fork.c:2812 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 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_list+0x176/0xc40 mm/page_alloc.c:3529 release_pages+0xc8a/0x1360 mm/swap.c:1055 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:59 tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu mm/mmu_gather.c:261 [inline] tlb_finish_mmu+0x14b/0x7e0 mm/mmu_gather.c:361 exit_mmap+0x202/0x7b0 mm/mmap.c:3096 __mmput+0x128/0x4c0 kernel/fork.c:1185 mmput+0x60/0x70 kernel/fork.c:1207 exit_mm kernel/exit.c:516 [inline] do_exit+0xa41/0x2a30 kernel/exit.c:807 do_group_exit+0xd4/0x2a0 kernel/exit.c:950 get_signal+0x21b1/0x2440 kernel/signal.c:2858 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: ffff88801ebefb00: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ffff88801ebefb80: 00 00 00 00 fc fc fc fc 02 fc fc fc fc fc fc fc >ffff88801ebefc00: fa fb fb fb fc fc fc fc 00 00 fc fc fc fc fc fc ^ ffff88801ebefc80: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ffff88801ebefd00: 00 00 00 00 fc fc fc fc 00 00 00 00 fc fc fc fc ==================================================================