================================================================== 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 ffff888025e8e758 by task syz-executor.3/14932 CPU: 1 PID: 14932 Comm: syz-executor.3 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:check_kcov_mode+0x7/0x40 kernel/kcov.c:166 Code: 00 e9 59 fe ff ff 48 8b 7c 24 08 e8 93 bc 46 00 e9 61 fd ff ff cc cc cc cc cc cc cc cc cc cc cc cc cc cc 65 8b 05 c9 8c 8a 7e <89> c2 81 e2 00 01 00 00 a9 00 01 ff 00 74 10 31 c0 85 d2 74 15 8b RSP: 0018:ffffc90004667570 EFLAGS: 00000206 RAX: 0000000080000000 RBX: 000000000000000f RCX: ffff888018708000 RDX: 0000000000040000 RSI: ffff888018708000 RDI: 0000000000000003 RBP: ffff88807210e880 R08: 0000000000000000 R09: 000000000000000f R10: ffffffff83a3511a R11: 0000000000000010 R12: 0000000000000001 R13: 000000000000000c R14: dffffc0000000000 R15: 0000000000000000 write_comp_data kernel/kcov.c:221 [inline] __sanitizer_cov_trace_const_cmp1+0x22/0x80 kernel/kcov.c:273 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_compat_sys_openat fs/open.c:1288 [inline] __se_compat_sys_openat fs/open.c:1286 [inline] __ia32_compat_sys_openat+0x13f/0x1f0 fs/open.c:1286 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf6ed4549 Code: 03 74 c0 01 10 05 03 74 b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f44ce5fc EFLAGS: 00000296 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 0000000020000280 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 14931: 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_compat drivers/usb/core/devio.c:2181 [inline] usbdev_do_ioctl drivers/usb/core/devio.c:2698 [inline] usbdev_ioctl+0x160e/0x36c0 drivers/usb/core/devio.c:2791 compat_ptr_ioctl+0x67/0x90 fs/ioctl.c:910 __do_compat_sys_ioctl+0x1c7/0x290 fs/ioctl.c:972 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c The buggy address belongs to the object at ffff888025e8e758 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of 8-byte region [ffff888025e8e758, ffff888025e8e760) The buggy address belongs to the page: page:ffffea000097a380 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x25e8e 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 6574, ts 731516558336, free_ts 731516477320 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] vmalloc+0x67/0x80 mm/vmalloc.c:3147 xt_compat_init_offsets+0xdf/0x220 net/netfilter/x_tables.c:733 compat_table_info+0xb7/0x5b0 net/ipv4/netfilter/ip_tables.c:936 get_info+0x282/0x740 net/ipv6/netfilter/ip6_tables.c:989 do_ipt_get_ctl+0x152/0x9d0 net/ipv4/netfilter/ip_tables.c:1654 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:4249 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 __vfree+0x3c/0xd0 mm/vmalloc.c:2680 vfree+0x5a/0x90 mm/vmalloc.c:2711 xt_compat_flush_offsets+0x8b/0x160 net/netfilter/x_tables.c:691 compat_get_entries+0x1f6/0x770 net/ipv4/netfilter/ip_tables.c:1604 do_ipt_get_ctl+0x4ed/0x9d0 net/ipv4/netfilter/ip_tables.c:1660 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:4249 __sys_getsockopt+0x21f/0x5f0 net/socket.c:2220 __do_compat_sys_socketcall+0x513/0x660 net/compat.c:495 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Memory state around the buggy address: ffff888025e8e600: fc fc fc fb fc fc fc fc fb fc fc fc fc fb fc fc ffff888025e8e680: fc fc fb fc fc fc fc fb fc fc fc fc fb fc fc fc >ffff888025e8e700: fc fa fc fc fc fc fb fc fc fc fc 01 fc fc fc fc ^ ffff888025e8e780: fa fc fc fc fc fb fc fc fc fc 00 fc fc fc fc 00 ffff888025e8e800: fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc fa fc ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: e9 59 fe ff ff jmpq 0xfffffe5e 5: 48 8b 7c 24 08 mov 0x8(%rsp),%rdi a: e8 93 bc 46 00 callq 0x46bca2 f: e9 61 fd ff ff jmpq 0xfffffd75 14: cc int3 15: cc int3 16: cc int3 17: cc int3 18: cc int3 19: cc int3 1a: cc int3 1b: cc int3 1c: cc int3 1d: cc int3 1e: cc int3 1f: cc int3 20: cc int3 21: cc int3 22: 65 8b 05 c9 8c 8a 7e mov %gs:0x7e8a8cc9(%rip),%eax # 0x7e8a8cf2 * 29: 89 c2 mov %eax,%edx <-- trapping instruction 2b: 81 e2 00 01 00 00 and $0x100,%edx 31: a9 00 01 ff 00 test $0xff0100,%eax 36: 74 10 je 0x48 38: 31 c0 xor %eax,%eax 3a: 85 d2 test %edx,%edx 3c: 74 15 je 0x53 3e: 8b .byte 0x8b