==================================================================
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 ffff88807bbd9bc0 by task syz-executor.4/30580
CPU: 0 PID: 30580 Comm: syz-executor.4 Not tainted 5.16.0-rc5-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/0x2ed 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:__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 1a ad 14 f8 48 89 ef e8 62 23 15 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 a3 eb 07 f8 65 8b 05 9c 29 bb 76 85 c0 74 0a 5b 5d c3 e8 50 e3
RSP: 0018:ffffc90004837610 EFLAGS: 00000206
RAX: 0000000000000002 RBX: 0000000000000200 RCX: 1ffffffff1b219c9
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffff888070e571c0 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff817d29f8 R11: 0000000000000000 R12: ffff888070e571a8
R13: ffffc90004837758 R14: ffff88804124dcc0 R15: 0000000000000216
spin_unlock_irqrestore include/linux/spinlock.h:404 [inline]
__skb_try_recv_datagram+0x168/0x4e0 net/core/datagram.c:267
__skb_recv_datagram+0x1a1/0x220 net/core/datagram.c:297
skb_recv_datagram+0xa7/0xe0 net/core/datagram.c:317
netlink_recvmsg+0xe1/0xea0 net/netlink/af_netlink.c:1944
sock_recvmsg_nosec net/socket.c:944 [inline]
____sys_recvmsg+0x527/0x600 net/socket.c:2626
___sys_recvmsg+0x127/0x200 net/socket.c:2670
do_recvmmsg+0x24d/0x6d0 net/socket.c:2764
__sys_recvmmsg net/socket.c:2845 [inline]
__do_sys_recvmmsg net/socket.c:2866 [inline]
__se_sys_recvmmsg net/socket.c:2859 [inline]
__x64_sys_recvmmsg+0x17d/0x260 net/socket.c:2859
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:0x7f38e5216e99
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:00007f38e3b8c168 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 00007f38e5329f60 RCX: 00007f38e5216e99
RDX: 04000000000003e4 RSI: 0000000020002ec0 RDI: 0000000000000004
RBP: 00007f38e5270ff1 R08: 00000000200001c0 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffe7769e6f R14: 00007f38e3b8c300 R15: 0000000000022000
Allocated by task 30651:
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+0xa6/0xd0 mm/kasan/common.c:522
kasan_kmalloc include/linux/kasan.h:269 [inline]
__do_kmalloc mm/slab.c:3702 [inline]
__kmalloc+0x209/0x4d0 mm/slab.c:3711
kmalloc include/linux/slab.h:595 [inline]
do_proc_bulk+0x2fc/0xba0 drivers/usb/core/devio.c:1292
proc_bulk drivers/usb/core/devio.c:1351 [inline]
usbdev_do_ioctl drivers/usb/core/devio.c:2625 [inline]
usbdev_ioctl+0x586/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 ffff88807bbd9bc0
which belongs to the cache kmalloc-32 of size 32
The buggy address is located 0 bytes inside of
32-byte region [ffff88807bbd9bc0, ffff88807bbd9be0)
The buggy address belongs to the page:
page:ffffea0001eef640 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807bbd9fc1 pfn:0x7bbd9
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea0001c88488 ffffea000091f188 ffff888010c40100
raw: ffff88807bbd9fc1 ffff88807bbd9000 000000010000000f 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 0x3420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 8770, ts 1436639208885, free_ts 1426442704216
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_node include/linux/gfp.h:570 [inline]
kmem_getpages mm/slab.c:1377 [inline]
cache_grow_begin+0x75/0x470 mm/slab.c:2593
cache_alloc_refill+0x27f/0x380 mm/slab.c:2965
____cache_alloc mm/slab.c:3048 [inline]
____cache_alloc mm/slab.c:3031 [inline]
__do_cache_alloc mm/slab.c:3275 [inline]
slab_alloc mm/slab.c:3316 [inline]
__do_kmalloc mm/slab.c:3700 [inline]
__kmalloc_track_caller+0x3b0/0x4d0 mm/slab.c:3717
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
setup_gid_attrs drivers/infiniband/core/sysfs.c:1168 [inline]
ib_setup_port_attrs+0x3e7/0x5c0 drivers/infiniband/core/sysfs.c:1440
add_one_compat_dev+0x517/0x7f0 drivers/infiniband/core/device.c:968
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_list+0x1a9/0xfa0 mm/page_alloc.c:3425
release_pages+0x3f4/0x1480 mm/swap.c:980
__pagevec_release+0x77/0x100 mm/swap.c:1000
pagevec_release include/linux/pagevec.h:81 [inline]
invalidate_inode_pages2_range+0xb2e/0x1020 mm/truncate.c:685
open_ctree+0x4828/0x4954 fs/btrfs/disk-io.c:3690
btrfs_fill_super fs/btrfs/super.c:1359 [inline]
btrfs_mount_root.cold+0x15/0x162 fs/btrfs/super.c:1726
legacy_get_tree+0x105/0x220 fs/fs_context.c:610
vfs_get_tree+0x89/0x2f0 fs/super.c:1500
fc_mount fs/namespace.c:994 [inline]
vfs_kern_mount.part.0+0xd3/0x170 fs/namespace.c:1024
vfs_kern_mount+0x3c/0x60 fs/namespace.c:1011
btrfs_mount+0x234/0xa60 fs/btrfs/super.c:1786
legacy_get_tree+0x105/0x220 fs/fs_context.c:610
vfs_get_tree+0x89/0x2f0 fs/super.c:1500
do_new_mount fs/namespace.c:2988 [inline]
path_mount+0x1320/0x1fa0 fs/namespace.c:3318
do_mount fs/namespace.c:3331 [inline]
__do_sys_mount fs/namespace.c:3539 [inline]
__se_sys_mount fs/namespace.c:3516 [inline]
__x64_sys_mount+0x27f/0x300 fs/namespace.c:3516
Memory state around the buggy address:
ffff88807bbd9a80: 00 fc fc fc fc fc fc fc 00 fc fc fc fc fc fc fc
ffff88807bbd9b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
>ffff88807bbd9b80: 00 fc fc fc fc fc fc fc 01 fc fc fc fc fc fc fc
^
ffff88807bbd9c00: 00 fc fc fc fc fc fc fc fa fb fb fb fc fc fc fc
ffff88807bbd9c80: fa fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: 74 24 je 0x26
2: 10 e8 adc %ch,%al
4: 1a ad 14 f8 48 89 sbb -0x76b707ec(%rbp),%ch
a: ef out %eax,(%dx)
b: e8 62 23 15 f8 callq 0xf8152372
10: 81 e3 00 02 00 00 and $0x200,%ebx
16: 75 25 jne 0x3d
18: 9c pushfq
19: 58 pop %rax
1a: f6 c4 02 test $0x2,%ah
1d: 75 2d jne 0x4c
1f: 48 85 db test %rbx,%rbx
22: 74 01 je 0x25
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 a3 eb 07 f8 callq 0xf807ebd2 <-- trapping instruction
2f: 65 8b 05 9c 29 bb 76 mov %gs:0x76bb299c(%rip),%eax # 0x76bb29d2
36: 85 c0 test %eax,%eax
38: 74 0a je 0x44
3a: 5b pop %rbx
3b: 5d pop %rbp
3c: c3 retq
3d: e8 .byte 0xe8
3e: 50 push %rax
3f: e3 .byte 0xe3