==================================================================
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 ffff88806e968938 by task syz-executor.1/22915
CPU: 1 PID: 22915 Comm: syz-executor.1 Not tainted 5.15.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: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:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x38/0x70 kernel/locking/spinlock.c:194
Code: 74 24 10 e8 6a 5c 1f f8 48 89 ef e8 b2 d2 1f f8 81 e3 00 02 00 00 75 25 9c 58 f6 c4 02 75 2d 48 85 db 74 01 fb bf 01 00 00 00 d3 9c 12 f8 65 8b 05 8c f1 c4 76 85 c0 74 0a 5b 5d c3 e8 a0 8b
RSP: 0018:ffffc90005a37e20 EFLAGS: 00000206
RAX: 0000000000000002 RBX: 0000000000000200 RCX: 1ffffffff1ae15e9
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffff8880913e2008 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff817e0a58 R11: 0000000000000000 R12: ffff88801d08bf00
R13: ffff8880913e2380 R14: ffffffffffffffea R15: 1ffff92000b46fce
spin_unlock_irqrestore include/linux/spinlock.h:404 [inline]
raw_ioctl_ep_enable drivers/usb/gadget/legacy/raw_gadget.c:824 [inline]
raw_ioctl+0x1854/0x2690 drivers/usb/gadget/legacy/raw_gadget.c:1226
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:0x7f52c8ab58a7
Code: 3c 1c 48 f7 d8 49 39 c4 72 b8 e8 04 54 02 00 85 c0 78 bd 48 83 c4 08 4c 89 e0 5b 41 5c c3 0f 1f 44 00 00 b8 10 00 00 00 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:00007f52c6008058 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f52c90fd020 RCX: 00007f52c8ab58a7
RDX: 00007f52c90fd04c RSI: 0000000040095505 RDI: 0000000000000006
RBP: 0000000000000006 R08: 0000000000000001 R09: 0000000000000000
R10: 00007f52c6008180 R11: 0000000000000246 R12: 00007f52c90fd04e
R13: 00007f52c90fd04c R14: 0000000000000000 R15: 0000000000000000
Allocated by task 22942:
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 ffff88806e968938
which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes inside of
8-byte region [ffff88806e968938, ffff88806e968940)
The buggy address belongs to the page:
page:ffffea0001ba5a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6e968
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 6821, ts 172138311179, free_ts 170485671506
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
qlink_free mm/kasan/quarantine.c:146 [inline]
qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165
kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272
__kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:259 [inline]
slab_post_alloc_hook mm/slab.h:519 [inline]
slab_alloc_node mm/slub.c:3234 [inline]
slab_alloc mm/slub.c:3242 [inline]
kmem_cache_alloc+0x202/0x3a0 mm/slub.c:3247
prepare_creds+0x3f/0x7b0 kernel/cred.c:260
access_override_creds fs/open.c:351 [inline]
do_faccessat+0x3f4/0x850 fs/open.c:415
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
Memory state around the buggy address:
ffff88806e968800: fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc
ffff88806e968880: fc fc fc 00 fc fc fc fc fa fc fc fc fc 00 fc fc
>ffff88806e968900: fc fc 00 fc fc fc fc 01 fc fc fc fc 00 fc fc fc
^
ffff88806e968980: fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc
ffff88806e968a00: 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00
==================================================================
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 24 10 and $0x10,%al
2: e8 6a 5c 1f f8 callq 0xf81f5c71
7: 48 89 ef mov %rbp,%rdi
a: e8 b2 d2 1f f8 callq 0xf81fd2c1
f: 81 e3 00 02 00 00 and $0x200,%ebx
15: 75 25 jne 0x3c
17: 9c pushfq
18: 58 pop %rax
19: f6 c4 02 test $0x2,%ah
1c: 75 2d jne 0x4b
1e: 48 85 db test %rbx,%rbx
21: 74 01 je 0x24
23: fb sti
24: bf 01 00 00 00 mov $0x1,%edi
* 29: e8 d3 9c 12 f8 callq 0xf8129d01 <-- trapping instruction
2e: 65 8b 05 8c f1 c4 76 mov %gs:0x76c4f18c(%rip),%eax # 0x76c4f1c1
35: 85 c0 test %eax,%eax
37: 74 0a je 0x43
39: 5b pop %rbx
3a: 5d pop %rbp
3b: c3 retq
3c: e8 .byte 0xe8
3d: a0 .byte 0xa0
3e: 8b .byte 0x8b