================================================================== 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 ffff88801c6ee8c0 by task syz-executor.3/22929 CPU: 1 PID: 22929 Comm: syz-executor.3 Not tainted 5.16.0-rc2-next-20211125-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+0xa5/0x3ed 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+0x675/0xa20 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:read_emulate+0x0/0x40 arch/x86/kvm/x86.c:6764 Code: 00 fc ff df 48 c1 ea 03 80 3c 02 00 75 0d 48 8b 3b 48 89 ee 5b 5d e9 af dc 0f 00 48 89 df e8 b7 96 b5 00 eb e9 0f 1f 44 00 00 <41> 55 49 89 d5 41 54 49 89 f4 55 48 89 fd 53 89 cb e8 9a 07 6b 00 RSP: 0018:ffffc90003c27678 EFLAGS: 00000246 RAX: dffffc0000000000 RBX: ffff888020664000 RCX: 0000000000000001 RDX: ffff8880333f68d0 RSI: 00000000000000d8 RDI: ffff888020664000 RBP: ffffffff89a31560 R08: 0000000000000000 R09: ffffc90003b5bf53 R10: ffffffff810ea8e0 R11: 0000000000000000 R12: 00000000000000d8 R13: 0000000000000000 R14: ffff8880241c0000 R15: 0000000000000000 emulator_read_write_onepage+0x3bb/0xb30 arch/x86/kvm/x86.c:6839 emulator_read_write+0x1c4/0x5a0 arch/x86/kvm/x86.c:6894 read_emulated+0x125/0x270 arch/x86/kvm/emulate.c:1353 segmented_read arch/x86/kvm/emulate.c:1377 [inline] x86_emulate_insn+0x2869/0x39c0 arch/x86/kvm/emulate.c:5514 x86_emulate_instruction+0x714/0x1460 arch/x86/kvm/x86.c:8117 kvm_mmu_page_fault+0x3e9/0x19b0 arch/x86/kvm/mmu/mmu.c:5326 handle_ept_violation+0x29c/0x6e0 arch/x86/kvm/vmx/vmx.c:5303 __vmx_handle_exit arch/x86/kvm/vmx/vmx.c:6012 [inline] vmx_handle_exit+0x4f7/0x18a0 arch/x86/kvm/vmx/vmx.c:6029 vcpu_enter_guest+0x2b88/0x44a0 arch/x86/kvm/x86.c:9894 vcpu_run arch/x86/kvm/x86.c:9961 [inline] kvm_arch_vcpu_ioctl_run+0x4fc/0x21a0 arch/x86/kvm/x86.c:10156 kvm_vcpu_ioctl+0x570/0xf30 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3725 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:0x7feec5f5eae9 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007feec34b3188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007feec6072020 RCX: 00007feec5f5eae9 RDX: 0000000000000000 RSI: 000000000000ae80 RDI: 0000000000000005 RBP: 00007feec5fb8f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffda7a74fef R14: 00007feec34b3300 R15: 0000000000022000 Allocated by task 22930: 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] proc_do_submiturb+0x2a7d/0x3630 drivers/usb/core/devio.c:1816 proc_submiturb drivers/usb/core/devio.c:1975 [inline] usbdev_do_ioctl drivers/usb/core/devio.c:2671 [inline] usbdev_ioctl+0x692/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 ffff88801c6ee8c0 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of 8-byte region [ffff88801c6ee8c0, ffff88801c6ee8c8) The buggy address belongs to the page: page:ffffea000071bb80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c6ee flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000001 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 1, ts 8529285393, free_ts 8527233590 prep_new_page mm/page_alloc.c:2433 [inline] get_page_from_freelist+0xa72/0x2f40 mm/page_alloc.c:4164 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5376 alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2037 alloc_pages+0x29f/0x300 mm/mempolicy.c:2187 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab mm/slub.c:1930 [inline] new_slab+0x261/0x460 mm/slub.c:1993 ___slab_alloc+0x798/0xf30 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_track_caller+0x2e7/0x320 mm/slub.c:4925 kstrdup+0x36/0x70 mm/util.c:60 kstrdup_const+0x53/0x80 mm/util.c:83 __kernfs_new_node+0x9d/0x8b0 fs/kernfs/dir.c:581 kernfs_new_node+0x93/0x120 fs/kernfs/dir.c:647 kernfs_create_link+0xcb/0x230 fs/kernfs/symlink.c:39 sysfs_do_create_link_sd+0x90/0x140 fs/sysfs/symlink.c:44 sysfs_do_create_link fs/sysfs/symlink.c:80 [inline] sysfs_create_link+0x5f/0xc0 fs/sysfs/symlink.c:92 device_create_sys_dev_entry drivers/base/core.c:3219 [inline] device_add+0x101c/0x1ee0 drivers/base/core.c:3361 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1351 [inline] free_pcp_prepare+0x414/0xb60 mm/page_alloc.c:1403 free_unref_page_prepare mm/page_alloc.c:3324 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3403 __vunmap+0x781/0xb70 mm/vmalloc.c:2632 free_work+0x58/0x70 mm/vmalloc.c:95 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2299 worker_thread+0x658/0x11f0 kernel/workqueue.c:2446 kthread+0x405/0x4f0 kernel/kthread.c:345 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88801c6ee780: 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 ffff88801c6ee800: fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc >ffff88801c6ee880: fc fc fc 00 fc fc fc fc 01 fc fc fc fc 00 fc fc ^ ffff88801c6ee900: fc fc 00 fc fc fc fc fa fc fc fc fc 00 fc fc fc ffff88801c6ee980: fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 4 bytes skipped: 0: 48 c1 ea 03 shr $0x3,%rdx 4: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) 8: 75 0d jne 0x17 a: 48 8b 3b mov (%rbx),%rdi d: 48 89 ee mov %rbp,%rsi 10: 5b pop %rbx 11: 5d pop %rbp 12: e9 af dc 0f 00 jmpq 0xfdcc6 17: 48 89 df mov %rbx,%rdi 1a: e8 b7 96 b5 00 callq 0xb596d6 1f: eb e9 jmp 0xa 21: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) * 26: 41 55 push %r13 <-- trapping instruction 28: 49 89 d5 mov %rdx,%r13 2b: 41 54 push %r12 2d: 49 89 f4 mov %rsi,%r12 30: 55 push %rbp 31: 48 89 fd mov %rdi,%rbp 34: 53 push %rbx 35: 89 cb mov %ecx,%ebx 37: e8 9a 07 6b 00 callq 0x6b07d6