================================================================== 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 ffff88804d84c4b0 by task syz-executor.2/11235 CPU: 1 PID: 11235 Comm: syz-executor.2 Not tainted 5.16.0-rc1-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+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:636 irq_exit_rcu+0x5/0x20 kernel/softirq.c:648 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:lock_is_held_type+0xff/0x140 kernel/locking/lockdep.c:5685 Code: 00 00 b8 ff ff ff ff 65 0f c1 05 9c 4d b0 76 83 f8 01 75 29 9c 58 f6 c4 02 75 3d 48 f7 04 24 00 02 00 00 74 01 fb 48 83 c4 08 <44> 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 45 31 ed eb b9 0f 0b 48 RSP: 0018:ffffc90002a5f5c8 EFLAGS: 00000282 RAX: 0000000000000046 RBX: 0000000000000001 RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000 RBP: ffffffff8bb839a0 R08: 0000000000000000 R09: ffffffff8d9172d7 R10: fffffbfff1b22e5a R11: 0000000000000000 R12: ffff888018820000 R13: 0000000000000000 R14: 00000000ffffffff R15: ffff888018820a60 lock_is_held include/linux/lockdep.h:283 [inline] rcu_read_lock_sched_held+0x3a/0x70 kernel/rcu/update.c:125 trace_lock_acquire include/trace/events/lock.h:13 [inline] lock_acquire+0x442/0x510 kernel/locking/lockdep.c:5608 rcu_lock_acquire include/linux/rcupdate.h:268 [inline] rcu_read_lock include/linux/rcupdate.h:688 [inline] folio_memcg_lock+0x3a/0x3e0 mm/memcontrol.c:2028 page_remove_rmap+0x25/0x1480 mm/rmap.c:1348 zap_pte_range mm/memory.c:1357 [inline] zap_pmd_range mm/memory.c:1467 [inline] zap_pud_range mm/memory.c:1496 [inline] zap_p4d_range mm/memory.c:1517 [inline] unmap_page_range+0xf0e/0x29f0 mm/memory.c:1538 unmap_single_vma+0x198/0x310 mm/memory.c:1583 unmap_vmas+0x16b/0x2f0 mm/memory.c:1615 exit_mmap+0x1d0/0x630 mm/mmap.c:3170 __mmput+0x122/0x4b0 kernel/fork.c:1113 mmput+0x56/0x60 kernel/fork.c:1134 exit_mm kernel/exit.c:507 [inline] do_exit+0xb27/0x2b40 kernel/exit.c:819 do_group_exit+0x125/0x310 kernel/exit.c:929 get_signal+0x47d/0x2220 kernel/signal.c:2830 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fdb43096ae9 Code: Unable to access opcode bytes at RIP 0x7fdb43096abf. RSP: 002b:00007fdb4060c218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007fdb431a9f68 RCX: 00007fdb43096ae9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fdb431a9f68 RBP: 00007fdb431a9f60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fdb431a9f6c R13: 00007fff5218a2ff R14: 00007fdb4060c300 R15: 0000000000022000 Allocated by task 11232: 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 ffff88804d84c4b0 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of 8-byte region [ffff88804d84c4b0, ffff88804d84c4b8) The buggy address belongs to the page: page:ffffea0001361300 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88804d84ceb0 pfn:0x4d84c flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 dead000000000100 dead000000000122 ffff888010c41280 raw: ffff88804d84ceb0 0000000080660064 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 26892, ts 669273387682, free_ts 669238305501 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:2191 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_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 fs/kernfs/dir.c:647 [inline] kernfs_create_dir_ns+0x9c/0x220 fs/kernfs/dir.c:984 sysfs_create_dir_ns+0x128/0x290 fs/sysfs/dir.c:59 create_dir lib/kobject.c:89 [inline] kobject_add_internal+0x2d2/0xa60 lib/kobject.c:255 kobject_add_varg lib/kobject.c:390 [inline] kobject_init_and_add+0x101/0x160 lib/kobject.c:473 netdev_queue_add_kobject net/core/net-sysfs.c:1665 [inline] netdev_queue_update_kobjects+0x1a2/0x460 net/core/net-sysfs.c:1710 register_queue_kobjects net/core/net-sysfs.c:1771 [inline] netdev_register_kobject+0x35a/0x430 net/core/net-sysfs.c:2014 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 __vunmap+0x781/0xb70 mm/vmalloc.c:2632 free_work+0x58/0x70 mm/vmalloc.c:95 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88804d84c380: fc fc fc fb fc fc fc fc fb fc fc fc fc fb fc fc ffff88804d84c400: fc fc fb fc fc fc fc 00 fc fc fc fc fb fc fc fc >ffff88804d84c480: fc fb fc fc fc fc 01 fc fc fc fc fb fc fc fc fc ^ ffff88804d84c500: 00 fc fc fc fc fb fc fc fc fc 00 fc fc fc fc fb ffff88804d84c580: fc fc fc fc fb fc fc fc fc fb fc fc fc fc fb fc ================================================================== ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: b8 ff ff ff ff mov $0xffffffff,%eax 7: 65 0f c1 05 9c 4d b0 xadd %eax,%gs:0x76b04d9c(%rip) # 0x76b04dab e: 76 f: 83 f8 01 cmp $0x1,%eax 12: 75 29 jne 0x3d 14: 9c pushfq 15: 58 pop %rax 16: f6 c4 02 test $0x2,%ah 19: 75 3d jne 0x58 1b: 48 f7 04 24 00 02 00 testq $0x200,(%rsp) 22: 00 23: 74 01 je 0x26 25: fb sti 26: 48 83 c4 08 add $0x8,%rsp * 2a: 44 89 e8 mov %r13d,%eax <-- trapping instruction 2d: 5b pop %rbx 2e: 5d pop %rbp 2f: 41 5c pop %r12 31: 41 5d pop %r13 33: 41 5e pop %r14 35: 41 5f pop %r15 37: c3 retq 38: 45 31 ed xor %r13d,%r13d 3b: eb b9 jmp 0xfffffff6 3d: 0f 0b ud2 3f: 48 rex.W