==================================================================
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 ffff888033fc3280 by task kworker/u4:20/13325
CPU: 0 PID: 13325 Comm: kworker/u4:20 Not tainted 5.16.0-rc2-next-20211125-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: bat_events batadv_nc_worker
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:strlen+0x4d/0x90 lib/string.c:487
Code: 07 38 d0 7f 04 84 c0 75 48 80 7d 00 00 74 39 48 bb 00 00 00 00 00 fc ff df 48 89 e8 48 83 c0 01 48 89 c2 48 89 c1 48 c1 ea 03 <83> e1 07 0f b6 14 1a 38 ca 7f 04 84 d2 75 1f 80 38 00 75 de 48 83
RSP: 0018:ffffc90004a97ac0 EFLAGS: 00000a03
RAX: ffffffff89ad672d RBX: dffffc0000000000 RCX: ffffffff89ad672d
RDX: 1ffffffff135ace5 RSI: ffffffff8bb83220 RDI: ffffffff89ad6720
RBP: ffffffff89ad6720 R08: 0000000000000000 R09: ffffffff8d914ad7
R10: fffffbfff1b2295a R11: 0000000000000000 R12: ffffffff8bb83220
R13: ffffffff8ba80200 R14: ffffffff8bb83220 R15: ffffc90004a97b90
strlen include/linux/fortify-string.h:102 [inline]
trace_event_get_offsets_lock include/trace/events/lock.h:39 [inline]
perf_trace_lock+0xb1/0x4d0 include/trace/events/lock.h:39
trace_lock_release include/trace/events/lock.h:58 [inline]
lock_release+0x4a8/0x720 kernel/locking/lockdep.c:5648
rcu_lock_release include/linux/rcupdate.h:273 [inline]
rcu_read_unlock include/linux/rcupdate.h:727 [inline]
batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:416 [inline]
batadv_nc_worker+0x86b/0xfa0 net/batman-adv/network-coding.c:723
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
Allocated by task 18575:
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 ffff888033fc3280
which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes inside of
8-byte region [ffff888033fc3280, ffff888033fc3288)
The buggy address belongs to the page:
page:ffffea0000cff0c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x33fc3
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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 17824, ts 604128765393, free_ts 576891380548
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_pages+0x1a7/0x300 mm/mempolicy.c:2192
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_file+0x51/0x350 fs/kernfs/file.c:985
sysfs_add_file_mode_ns+0x20f/0x3f0 fs/sysfs/file.c:294
create_files fs/sysfs/group.c:64 [inline]
internal_create_group+0x322/0xb10 fs/sysfs/group.c:148
internal_create_groups.part.0+0x90/0x140 fs/sysfs/group.c:188
internal_create_groups fs/sysfs/group.c:184 [inline]
sysfs_create_groups+0x25/0x50 fs/sysfs/group.c:214
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
__unfreeze_partials+0x19f/0x1c0 mm/slub.c:2527
qlink_free mm/kasan/quarantine.c:146 [inline]
qlist_free_all+0x5a/0xf0 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+0x142/0x3a0 mm/slub.c:3247
shmem_alloc_inode+0x18/0x40 mm/shmem.c:3744
alloc_inode+0x61/0x230 fs/inode.c:235
new_inode_pseudo fs/inode.c:993 [inline]
new_inode+0x27/0x2f0 fs/inode.c:1022
shmem_get_inode+0x195/0xcd0 mm/shmem.c:2289
shmem_mknod+0x5a/0x1f0 mm/shmem.c:2847
lookup_open.isra.0+0xfe4/0x13d0 fs/namei.c:3280
open_last_lookups fs/namei.c:3350 [inline]
path_openat+0x9b8/0x2750 fs/namei.c:3556
do_filp_open+0x1aa/0x400 fs/namei.c:3586
do_sys_openat2+0x16d/0x4d0 fs/open.c:1212
Memory state around the buggy address:
ffff888033fc3180: fc fc fa fc fc fc fc fa fc fc fc fc fa fc fc fc
ffff888033fc3200: fc fa fc fc fc fc fa fc fc fc fc 00 fc fc fc fc
>ffff888033fc3280: 01 fc fc fc fc fb fc fc fc fc fb fc fc fc fc fa
^
ffff888033fc3300: fc fc fc fc fb fc fc fc fc fa fc fc fc fc fa fc
ffff888033fc3380: fc fc fc fb fc fc fc fc fb fc fc fc fc fb fc fc
==================================================================
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 38 d0 cmp %dl,%al
2: 7f 04 jg 0x8
4: 84 c0 test %al,%al
6: 75 48 jne 0x50
8: 80 7d 00 00 cmpb $0x0,0x0(%rbp)
c: 74 39 je 0x47
e: 48 bb 00 00 00 00 00 movabs $0xdffffc0000000000,%rbx
15: fc ff df
18: 48 89 e8 mov %rbp,%rax
1b: 48 83 c0 01 add $0x1,%rax
1f: 48 89 c2 mov %rax,%rdx
22: 48 89 c1 mov %rax,%rcx
25: 48 c1 ea 03 shr $0x3,%rdx
* 29: 83 e1 07 and $0x7,%ecx <-- trapping instruction
2c: 0f b6 14 1a movzbl (%rdx,%rbx,1),%edx
30: 38 ca cmp %cl,%dl
32: 7f 04 jg 0x38
34: 84 d2 test %dl,%dl
36: 75 1f jne 0x57
38: 80 38 00 cmpb $0x0,(%rax)
3b: 75 de jne 0x1b
3d: 48 rex.W
3e: 83 .byte 0x83