==================================================================
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 ffff88803670f9b0 by task systemd-udevd/2934
CPU: 0 PID: 2934 Comm: systemd-udevd 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+0x6c/0x30c mm/kasan/report.c:256
__kasan_report mm/kasan/report.c:442 [inline]
kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
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:__sanitizer_cov_trace_const_cmp1+0x0/0x80 kernel/kcov.c:269
Code: 39 fe 72 1f 48 83 c2 01 4c 89 44 38 e8 48 c7 44 38 e0 06 00 00 00 48 89 4c 38 f0 4e 89 54 c8 20 48 89 10 c3 66 0f 1f 44 00 00 <53> 41 89 fb 41 89 f1 bf 03 00 00 00 65 48 8b 0c 25 40 70 02 00 48
RSP: 0018:ffffc90001a8f5a8 EFLAGS: 00000202
RAX: 0000000000000000 RBX: 000000000000000d RCX: 0000000000000000
RDX: ffff88807b013a00 RSI: 000000000000000d RDI: 0000000000000010
RBP: ffff888021c6ca80 R08: 0000000000000000 R09: 000000000000000c
R10: ffffffff83a1f017 R11: 0000000000000010 R12: 0000000000000020
R13: 00000000000003c3 R14: dffffc0000000000 R15: 0000000000000000
tomoyo_domain_quota_is_ok+0x32a/0x550 security/tomoyo/util.c:1092
tomoyo_supervisor+0x2f2/0xf00 security/tomoyo/common.c:2089
tomoyo_audit_path_log security/tomoyo/file.c:168 [inline]
tomoyo_path_permission security/tomoyo/file.c:587 [inline]
tomoyo_path_permission+0x270/0x3a0 security/tomoyo/file.c:573
tomoyo_check_open_permission+0x33e/0x380 security/tomoyo/file.c:777
tomoyo_file_open security/tomoyo/tomoyo.c:311 [inline]
tomoyo_file_open+0xa3/0xd0 security/tomoyo/tomoyo.c:306
security_file_open+0x45/0xb0 security/security.c:1635
do_dentry_open+0x353/0x1250 fs/open.c:809
do_open fs/namei.c:3426 [inline]
path_openat+0x1cad/0x2750 fs/namei.c:3559
do_filp_open+0x1aa/0x400 fs/namei.c:3586
do_sys_openat2+0x16d/0x4d0 fs/open.c:1212
do_sys_open fs/open.c:1228 [inline]
__do_sys_open fs/open.c:1236 [inline]
__se_sys_open fs/open.c:1232 [inline]
__x64_sys_open+0x119/0x1c0 fs/open.c:1232
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:0x7fcbd486a9b1
Code: f7 d8 bf ff ff ff ff 64 89 02 eb cb 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 80 3f 00 74 1b be 00 08 09 00 b8 02 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 1f 89 c7 e9 00 ff ff ff 48 8b 05 b1 54 2e 00
RSP: 002b:00007fff2fb01008 EFLAGS: 00000202 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 000055943eeb40c0 RCX: 00007fcbd486a9b1
RDX: 00000000000000ff RSI: 0000000000090800 RDI: 000055943eeab450
RBP: 00007fcbd5a20710 R08: 000055943eea6c90 R09: 7269762f73656369
R10: 00007fcbd4b50b58 R11: 0000000000000202 R12: 0000000000000000
R13: 000055943eeab450 R14: 00000000000000ff R15: 000055943eeab450
Allocated by task 13480:
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 ffff88803670f9b0
which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes inside of
8-byte region [ffff88803670f9b0, ffff88803670f9b8)
The buggy address belongs to the page:
page:ffffea0000d9c3c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3670f
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea0001d1f700 dead000000000002 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 10572, ts 1487110864369, free_ts 1487110755100
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]
__kmalloc_node+0x2cb/0x390 mm/slub.c:4467
kmalloc_node include/linux/slab.h:613 [inline]
__vmalloc_area_node mm/vmalloc.c:2940 [inline]
__vmalloc_node_range+0x473/0xab0 mm/vmalloc.c:3065
__vmalloc_node mm/vmalloc.c:3114 [inline]
vzalloc+0x67/0x80 mm/vmalloc.c:3184
xt_counters_alloc+0x4c/0x70 net/netfilter/x_tables.c:1379
__do_replace+0x9a/0x870 net/ipv4/netfilter/ip_tables.c:1049
do_replace net/ipv4/netfilter/ip_tables.c:1140 [inline]
do_ipt_set_ctl+0x901/0xb80 net/ipv4/netfilter/ip_tables.c:1630
nf_setsockopt+0x83/0xe0 net/netfilter/nf_sockopt.c:101
ip_setsockopt+0x3c3/0x3a90 net/ipv4/ip_sockglue.c:1444
tcp_setsockopt+0x136/0x2520 net/ipv4/tcp.c:3635
__sys_setsockopt+0x2db/0x610 net/socket.c:2176
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+0x373/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
__vfree+0x3c/0xd0 mm/vmalloc.c:2680
vfree+0x5a/0x90 mm/vmalloc.c:2711
copy_entries_to_user net/ipv4/netfilter/ip_tables.c:868 [inline]
get_entries net/ipv4/netfilter/ip_tables.c:1024 [inline]
do_ipt_get_ctl+0x7fe/0x9d0 net/ipv4/netfilter/ip_tables.c:1663
nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116
ip_getsockopt net/ipv4/ip_sockglue.c:1786 [inline]
ip_getsockopt+0x164/0x1c0 net/ipv4/ip_sockglue.c:1765
tcp_getsockopt+0x86/0xd0 net/ipv4/tcp.c:4231
__sys_getsockopt+0x21f/0x5f0 net/socket.c:2220
__do_sys_getsockopt net/socket.c:2235 [inline]
__se_sys_getsockopt net/socket.c:2232 [inline]
__x64_sys_getsockopt+0xba/0x150 net/socket.c:2232
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:
ffff88803670f880: fc fc fc fb fc fc fc fc fb fc fc fc fc fb fc fc
ffff88803670f900: fc fc fb fc fc fc fc fb fc fc fc fc fb fc fc fc
>ffff88803670f980: fc fb fc fc fc fc 01 fc fc fc fc 00 fc fc fc fc
^
ffff88803670fa00: 00 fc fc fc fc fa fc fc fc fc fa fc fc fc fc fa
ffff88803670fa80: fc fc fc fc fa fc fc fc fc fa fc fc fc fc fa fc
==================================================================
----------------
Code disassembly (best guess):
0: 39 fe cmp %edi,%esi
2: 72 1f jb 0x23
4: 48 83 c2 01 add $0x1,%rdx
8: 4c 89 44 38 e8 mov %r8,-0x18(%rax,%rdi,1)
d: 48 c7 44 38 e0 06 00 movq $0x6,-0x20(%rax,%rdi,1)
14: 00 00
16: 48 89 4c 38 f0 mov %rcx,-0x10(%rax,%rdi,1)
1b: 4e 89 54 c8 20 mov %r10,0x20(%rax,%r9,8)
20: 48 89 10 mov %rdx,(%rax)
23: c3 retq
24: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
* 2a: 53 push %rbx <-- trapping instruction
2b: 41 89 fb mov %edi,%r11d
2e: 41 89 f1 mov %esi,%r9d
31: bf 03 00 00 00 mov $0x3,%edi
36: 65 48 8b 0c 25 40 70 mov %gs:0x27040,%rcx
3d: 02 00
3f: 48 rex.W