================================================================== BUG: KASAN: slab-out-of-bounds in usb_hcd_poll_rh_status+0x2d2/0x660 drivers/usb/core/hcd.c:774 Write of size 2 at addr ffff88801e1e0438 by task syslogd/4786 CPU: 1 PID: 4786 Comm: syslogd Not tainted 5.11.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x9a/0xcc lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413 check_memory_region_inline mm/kasan/generic.c:179 [inline] check_memory_region+0x13d/0x180 mm/kasan/generic.c:185 memcpy+0x39/0x60 mm/kasan/shadow.c:65 usb_hcd_poll_rh_status+0x2d2/0x660 drivers/usb/core/hcd.c:774 call_timer_fn+0x163/0x4b0 kernel/time/timer.c:1417 expire_timers kernel/time/timer.c:1462 [inline] __run_timers.part.0+0x52a/0x8b0 kernel/time/timer.c:1731 __run_timers kernel/time/timer.c:1712 [inline] run_timer_softirq+0x9c/0x190 kernel/time/timer.c:1744 __do_softirq+0x29b/0x9f6 kernel/softirq.c:343 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:226 [inline] __irq_exit_rcu kernel/softirq.c:420 [inline] irq_exit_rcu+0x134/0x200 kernel/softirq.c:432 sysvec_apic_timer_interrupt+0x4d/0x100 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:629 RIP: 0010:copy_user_enhanced_fast_string+0x3/0x40 arch/x86/lib/copy_user_64.S:203 Code: 07 48 ff c6 48 ff c7 ff c9 75 f2 89 d1 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 31 c0 0f 01 ca c3 0f 1f 80 00 00 00 00 0f 01 cb <83> fa 40 0f 82 70 ff ff ff 89 d1 f3 a4 31 c0 0f 01 ca c3 66 2e 0f RSP: 0018:ffffc9000a91f898 EFLAGS: 00040246 RAX: 0000000000000001 RBX: 0000000000000087 RCX: ffffffff836c5726 RDX: 0000000000000087 RSI: ffff88801a0a6400 RDI: 000055904afb2950 RBP: 000055904afb2950 R08: 0000000000000000 R09: ffff88801a0a6486 R10: ffffed1003414c90 R11: 0000000000000000 R12: ffff88801a0a6400 R13: 0000000000000087 R14: 0000000000000000 R15: ffffc9000a91fc58 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline] copyout.part.0+0x83/0xa0 lib/iov_iter.c:148 copyout lib/iov_iter.c:637 [inline] _copy_to_iter+0x1fe/0xed0 lib/iov_iter.c:637 __skb_datagram_iter+0xec/0x6b0 net/core/datagram.c:425 skb_copy_datagram_iter+0x37/0x40 net/core/datagram.c:533 skb_copy_datagram_msg include/linux/skbuff.h:3538 [inline] unix_dgram_recvmsg+0x3d8/0xb80 net/unix/af_unix.c:2138 sock_recvmsg_nosec net/socket.c:886 [inline] sock_recvmsg net/socket.c:904 [inline] sock_recvmsg net/socket.c:900 [inline] sock_read_iter+0x2b4/0x3f0 net/socket.c:977 call_read_iter include/linux/fs.h:1895 [inline] new_sync_read+0x4a2/0x5f0 fs/read_write.c:415 vfs_read+0x264/0x470 fs/read_write.c:496 ksys_read+0x171/0x1d0 fs/read_write.c:634 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f1331a208fe Code: c0 e9 e6 fe ff ff 50 48 8d 3d 0e c7 09 00 e8 c9 cf 01 00 66 0f 1f 84 00 00 00 00 00 64 8b 04 25 18 00 00 00 85 c0 75 14 0f 05 <48> 3d 00 f0 ff ff 77 5a c3 66 0f 1f 84 00 00 00 00 00 48 83 ec 28 RSP: 002b:00007ffdc0c52ce8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f1331a208fe RDX: 00000000000000ff RSI: 000055904afb2950 RDI: 0000000000000000 RBP: 000055904afb2910 R08: 00007f1331ab0040 R09: 00007f1331ab00c0 R10: 00007f1331aaffc0 R11: 0000000000000246 R12: 000055904afb299b R13: 000055904afb2950 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 7187: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:401 [inline] ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429 kmalloc include/linux/slab.h:557 [inline] do_proc_bulk+0x252/0x630 drivers/usb/core/devio.c:1221 proc_bulk drivers/usb/core/devio.c:1268 [inline] usbdev_do_ioctl drivers/usb/core/devio.c:2542 [inline] usbdev_ioctl+0x475/0x2e80 drivers/usb/core/devio.c:2708 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x11f/0x190 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88801e1e0438 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of 8-byte region [ffff88801e1e0438, ffff88801e1e0440) The buggy address belongs to the page: page:00000000a3745732 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1e1e0 flags: 0xfff00000000200(slab) raw: 00fff00000000200 dead000000000100 dead000000000122 ffff88800f441c80 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 0x12c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 7237232271 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x144/0x1c0 mm/page_alloc.c:2297 prep_new_page mm/page_alloc.c:2306 [inline] get_page_from_freelist+0x1c6e/0x3f80 mm/page_alloc.c:3945 __alloc_pages_nodemask+0x2d6/0x730 mm/page_alloc.c:4995 __alloc_pages include/linux/gfp.h:511 [inline] alloc_page_interleave+0xf/0x190 mm/mempolicy.c:2133 alloc_pages include/linux/gfp.h:547 [inline] alloc_slab_page mm/slub.c:1618 [inline] allocate_slab+0x2b6/0x4a0 mm/slub.c:1758 new_slab mm/slub.c:1821 [inline] new_slab_objects mm/slub.c:2578 [inline] ___slab_alloc+0x476/0x790 mm/slub.c:2741 __slab_alloc.constprop.0+0x95/0xe0 mm/slub.c:2781 slab_alloc_node mm/slub.c:2857 [inline] slab_alloc mm/slub.c:2900 [inline] kmem_cache_alloc_trace+0x2cc/0x360 mm/slub.c:2917 kmalloc include/linux/slab.h:552 [inline] usb_control_msg+0xae/0x460 drivers/usb/core/message.c:143 usb_get_string+0x9a/0x130 drivers/usb/core/message.c:837 usb_string_sub+0xa8/0x2a0 drivers/usb/core/message.c:876 usb_string+0x250/0x480 drivers/usb/core/message.c:981 usb_cache_string+0x63/0xd0 drivers/usb/core/message.c:1023 usb_enumerate_device drivers/usb/core/hub.c:2401 [inline] usb_new_device+0x226/0x7b0 drivers/usb/core/hub.c:2524 register_root_hub drivers/usb/core/hcd.c:1010 [inline] usb_add_hcd.cold+0x110f/0x1433 drivers/usb/core/hcd.c:2805 vhci_hcd_probe+0x176/0x310 drivers/usb/usbip/vhci_hcd.c:1371 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1271 [inline] free_pcp_prepare+0x2cb/0x410 mm/page_alloc.c:1306 free_unref_page_prepare mm/page_alloc.c:3200 [inline] free_unref_page+0x12/0x1b0 mm/page_alloc.c:3248 __vunmap+0x59e/0x940 mm/vmalloc.c:2286 free_work+0x4b/0x70 mm/vmalloc.c:67 process_one_work+0x828/0x1390 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 Memory state around the buggy address: ffff88801e1e0300: fc fc fc fc fb fc fc fc fc 00 fc fc fc fc 00 fc ffff88801e1e0380: fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc >ffff88801e1e0400: fc fc 00 fc fc fc fc 01 fc fc fc fc 00 fc fc fc ^ ffff88801e1e0480: fc fa fc fc fc fc fa fc fc fc fc fa fc fc fc fc ffff88801e1e0500: fa fc fc fc fc fa fc fc fc fc fa fc fc fc fc 00 ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 48 ff c6 inc %rsi 3: 48 ff c7 inc %rdi 6: ff c9 dec %ecx 8: 75 f2 jne 0xfffffffc a: 89 d1 mov %edx,%ecx c: c1 e9 03 shr $0x3,%ecx f: 83 e2 07 and $0x7,%edx 12: f3 48 a5 rep movsq %ds:(%rsi),%es:(%rdi) 15: 89 d1 mov %edx,%ecx 17: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) 19: 31 c0 xor %eax,%eax 1b: 0f 01 ca clac 1e: c3 retq 1f: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 26: 0f 01 cb stac * 29: 83 fa 40 cmp $0x40,%edx <-- trapping instruction 2c: 0f 82 70 ff ff ff jb 0xffffffa2 32: 89 d1 mov %edx,%ecx 34: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) 36: 31 c0 xor %eax,%eax 38: 0f 01 ca clac 3b: c3 retq 3c: 66 data16 3d: 2e cs 3e: 0f .byte 0xf