================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/fortify-string.h:225 [inline] BUG: KASAN: slab-out-of-bounds in usb_hcd_poll_rh_status+0x376/0x780 drivers/usb/core/hcd.c:774 Write of size 2 at addr ffff888021c32e10 by task syz-executor156/3829 CPU: 1 PID: 3829 Comm: syz-executor156 Not tainted 5.16.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 memcpy+0x39/0x60 mm/kasan/shadow.c:66 memcpy include/linux/fortify-string.h:225 [inline] usb_hcd_poll_rh_status+0x376/0x780 drivers/usb/core/hcd.c:774 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x67c/0xa30 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:preempt_count arch/x86/include/asm/preempt.h:27 [inline] RIP: 0010:check_kcov_mode kernel/kcov.c:166 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0x0/0x60 kernel/kcov.c:200 Code: 48 89 ef 5d e9 b1 1c 46 00 5d be 03 00 00 00 e9 46 8c 63 02 66 0f 1f 44 00 00 48 8b be b0 01 00 00 e8 b4 ff ff ff 31 c0 c3 90 <65> 8b 05 c9 dd 8a 7e 89 c1 48 8b 34 24 81 e1 00 01 00 00 65 48 8b RSP: 0018:ffffc90002f9f6c0 EFLAGS: 00000293 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff88801a240000 RSI: ffffffff815ed30c RDI: 0000000000000003 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000001 R10: ffffffff815ed302 R11: 0000000000000000 R12: ffffffff84d45e80 R13: 0000000000000200 R14: ffffc90002f9f720 R15: dffffc0000000000 console_unlock+0x6c2/0xb70 kernel/printk/printk.c:2716 vprintk_emit+0x198/0x4f0 kernel/printk/printk.c:2245 dev_vprintk_emit+0x36e/0x3b2 drivers/base/core.c:4594 dev_printk_emit+0xba/0xf1 drivers/base/core.c:4605 __dev_printk+0xcf/0xf5 drivers/base/core.c:4617 _dev_warn+0xd7/0x109 drivers/base/core.c:4661 checkintf drivers/usb/core/devio.c:826 [inline] checkintf.cold+0x7d/0x97 drivers/usb/core/devio.c:817 do_proc_bulk+0xd9/0xba0 drivers/usb/core/devio.c:1268 proc_bulk drivers/usb/core/devio.c:1351 [inline] usbdev_do_ioctl drivers/usb/core/devio.c:2625 [inline] usbdev_ioctl+0x586/0x36c0 drivers/usb/core/devio.c:2791 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fb0edefc7a9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 14 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffe9a766348 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fb0edf400b0 RCX: 00007fb0edefc7a9 RDX: 0000000020000240 RSI: 00000000c0185502 RDI: 0000000000000006 RBP: 00007ffe9a766370 R08: 00007ffe9a765dc0 R09: 0000000000000000 R10: 000000000000ffff R11: 0000000000000246 R12: 000000000000cffe R13: 00007ffe9a766354 R14: 00007ffe9a766370 R15: 00007ffe9a766360 Allocated by task 3834: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:595 [inline] do_proc_bulk+0x2fc/0xba0 drivers/usb/core/devio.c:1292 proc_bulk drivers/usb/core/devio.c:1351 [inline] usbdev_do_ioctl drivers/usb/core/devio.c:2625 [inline] usbdev_ioctl+0x586/0x36c0 drivers/usb/core/devio.c:2791 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888021c32e10 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of 8-byte region [ffff888021c32e10, ffff888021c32e18) The buggy address belongs to the page: page:ffffea0000870c80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x21c32 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 dead000000000100 dead000000000122 ffff888010c41280 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 2974, ts 18985990443, free_ts 17271290420 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2190 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab mm/slub.c:1930 [inline] new_slab+0x32d/0x4a0 mm/slub.c:1993 ___slab_alloc+0x918/0xfe0 mm/slub.c:3022 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3109 slab_alloc_node mm/slub.c:3200 [inline] slab_alloc mm/slub.c:3242 [inline] __kmalloc+0x2fb/0x340 mm/slub.c:4419 kmalloc include/linux/slab.h:595 [inline] kernfs_fop_write_iter+0x231/0x500 fs/kernfs/file.c:273 call_write_iter include/linux/fs.h:2162 [inline] new_sync_write+0x429/0x660 fs/read_write.c:503 vfs_write+0x7cd/0xae0 fs/read_write.c:590 ksys_write+0x12d/0x250 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3388 kasan_depopulate_vmalloc_pte+0x5c/0x70 mm/kasan/shadow.c:380 apply_to_pte_range mm/memory.c:2518 [inline] apply_to_pmd_range mm/memory.c:2562 [inline] apply_to_pud_range mm/memory.c:2598 [inline] apply_to_p4d_range mm/memory.c:2634 [inline] __apply_to_page_range+0x686/0x1030 mm/memory.c:2668 kasan_release_vmalloc+0xa7/0xc0 mm/kasan/shadow.c:490 __purge_vmap_area_lazy+0x8f9/0x1c50 mm/vmalloc.c:1708 _vm_unmap_aliases.part.0+0x3f0/0x500 mm/vmalloc.c:2111 _vm_unmap_aliases mm/vmalloc.c:2085 [inline] vm_unmap_aliases+0x45/0x50 mm/vmalloc.c:2134 change_page_attr_set_clr+0x241/0x500 arch/x86/mm/pat/set_memory.c:1743 change_page_attr_set arch/x86/mm/pat/set_memory.c:1793 [inline] set_memory_nx+0xb2/0x110 arch/x86/mm/pat/set_memory.c:1941 free_init_pages+0x73/0xc0 arch/x86/mm/init.c:894 kernel_init+0x2e/0x1d0 init/main.c:1508 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff888021c32d00: fc fc fc fc fb fc fc fc fc fb fc fc fc fc fb fc ffff888021c32d80: fc fc fc fb fc fc fc fc fa fc fc fc fc fa fc fc >ffff888021c32e00: fc fc 01 fc fc fc fc fa fc fc fc fc fa fc fc fc ^ ffff888021c32e80: fc fa fc fc fc fc fa fc fc fc fc fa fc fc fc fc ffff888021c32f00: fa fc fc fc fc fa fc fc fc fc fa fc fc fc fc fa ================================================================== ---------------- Code disassembly (best guess): 0: 48 89 ef mov %rbp,%rdi 3: 5d pop %rbp 4: e9 b1 1c 46 00 jmpq 0x461cba 9: 5d pop %rbp a: be 03 00 00 00 mov $0x3,%esi f: e9 46 8c 63 02 jmpq 0x2638c5a 14: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 1a: 48 8b be b0 01 00 00 mov 0x1b0(%rsi),%rdi 21: e8 b4 ff ff ff callq 0xffffffda 26: 31 c0 xor %eax,%eax 28: c3 retq 29: 90 nop * 2a: 65 8b 05 c9 dd 8a 7e mov %gs:0x7e8addc9(%rip),%eax # 0x7e8addfa <-- trapping instruction 31: 89 c1 mov %eax,%ecx 33: 48 8b 34 24 mov (%rsp),%rsi 37: 81 e1 00 01 00 00 and $0x100,%ecx 3d: 65 gs 3e: 48 rex.W 3f: 8b .byte 0x8b