vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(6) vhci_hcd vhci_hcd.0: devid(0) speed(1) speed_str(low-speed) vhci_hcd vhci_hcd.0: Device attached usb usb9: usbfs: process 14789 (syz-executor.2) did not claim interface 0 before use ================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:377 [inline] BUG: KASAN: slab-out-of-bounds in usb_hcd_poll_rh_status+0x387/0x6f0 drivers/usb/core/hcd.c:771 Write of size 2 at addr ffff8880a459d440 by task syz-executor.5/14790 CPU: 1 PID: 14790 Comm: syz-executor.5 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report+0x8f/0xa0 mm/kasan/report.c:412 memcpy+0x35/0x50 mm/kasan/kasan.c:303 memcpy include/linux/string.h:377 [inline] usb_hcd_poll_rh_status+0x387/0x6f0 drivers/usb/core/hcd.c:771 call_timer_fn+0x177/0x700 kernel/time/timer.c:1338 expire_timers+0x243/0x4e0 kernel/time/timer.c:1375 __run_timers kernel/time/timer.c:1696 [inline] run_timer_softirq+0x21c/0x670 kernel/time/timer.c:1709 __do_softirq+0x265/0x980 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x215/0x260 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1098 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894 RIP: 0010:__sanitizer_cov_trace_pc+0x40/0x50 kernel/kcov.c:108 Code: 00 01 1f 00 75 2b 8b 90 60 13 00 00 83 fa 02 75 20 48 8b 88 68 13 00 00 8b 80 64 13 00 00 48 8b 11 48 83 c2 01 48 39 d0 76 07 <48> 89 34 d1 48 89 11 c3 0f 1f 84 00 00 00 00 00 49 89 f1 49 89 fa RSP: 0018:ffff888092d8fba0 EFLAGS: 00000216 ORIG_RAX: ffffffffffffff13 RAX: 0000000000040000 RBX: ffff888091b795c0 RCX: ffffc90008930000 RDX: 00000000000018ee RSI: ffffffff8344b98f RDI: 0000000000000007 RBP: ffff888097c52000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000007 R11: 0000000000000000 R12: ffff88823b88e2a0 R13: ffff88823b88e2a0 R14: 0000000000000000 R15: ffff888091b795c0 rcu_read_unlock include/linux/rcupdate.h:677 [inline] aa_file_perm+0x3bf/0xd20 security/apparmor/file.c:639 common_file_perm+0x445/0x850 security/apparmor/lsm.c:461 security_file_permission+0x54/0x220 security/security.c:871 rw_verify_area+0x104/0x330 fs/read_write.c:391 vfs_write+0x144/0x540 fs/read_write.c:544 ksys_pwrite64 fs/read_write.c:653 [inline] __do_sys_pwrite64 fs/read_write.c:663 [inline] __se_sys_pwrite64 fs/read_write.c:660 [inline] __x64_sys_pwrite64+0x1f7/0x250 fs/read_write.c:660 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fbc426c3027 Code: 08 89 3c 24 48 89 4c 24 18 e8 e5 f8 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 48 8b 74 24 08 8b 3c 24 b8 12 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 04 24 e8 15 f9 ff ff 48 8b RSP: 002b:00007fbc41084f00 EFLAGS: 00000293 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007fbc427599c8 RCX: 00007fbc426c3027 RDX: 0000000000000001 RSI: 0000000020000080 RDI: 0000000000000006 RBP: 0000000000000007 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000640 R11: 0000000000000293 R12: 0000000000000006 R13: 0000000000000006 R14: 0000000020000230 R15: 0000000000000002 Allocated by task 14789: __do_kmalloc mm/slab.c:3727 [inline] __kmalloc+0x15a/0x3c0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] proc_do_submiturb+0x2d17/0x3b00 drivers/usb/core/devio.c:1673 proc_submiturb drivers/usb/core/devio.c:1827 [inline] usbdev_do_ioctl+0x773/0x3030 drivers/usb/core/devio.c:2481 usbdev_ioctl+0x21/0x30 drivers/usb/core/devio.c:2585 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8138: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 kvfree+0x59/0x60 mm/util.c:452 xt_free_table_info+0xb6/0x180 net/netfilter/x_tables.c:1193 __do_replace+0x6ab/0x870 net/ipv6/netfilter/ip6_tables.c:1107 do_replace net/ipv6/netfilter/ip6_tables.c:1160 [inline] do_ip6t_set_ctl+0x2d2/0x430 net/ipv6/netfilter/ip6_tables.c:1686 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x6f/0xc0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x103/0x160 net/ipv6/ipv6_sockglue.c:945 tcp_setsockopt+0x86/0xd0 net/ipv4/tcp.c:3108 __sys_setsockopt+0x14d/0x240 net/socket.c:2013 __do_sys_setsockopt net/socket.c:2024 [inline] __se_sys_setsockopt net/socket.c:2021 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2021 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a459d440 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff8880a459d440, ffff8880a459d460) The buggy address belongs to the page: page:ffffea0002916740 count:1 mapcount:0 mapping:ffff88813bff01c0 index:0xffff8880a459dfc1 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea0002c16ac8 ffffea00026c5948 ffff88813bff01c0 raw: ffff8880a459dfc1 ffff8880a459d000 000000010000003d 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a459d300: fb fb fb fb fc fc fc fc 00 02 fc fc fc fc fc fc ffff8880a459d380: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff8880a459d400: fb fb fb fb fc fc fc fc 01 fc fc fc fc fc fc fc ^ ffff8880a459d480: 05 fc fc fc fc fc fc fc 00 00 00 fc fc fc fc fc ffff8880a459d500: 00 06 fc fc fc fc fc fc 00 00 00 02 fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 01 1f add %ebx,(%rdi) 2: 00 75 2b add %dh,0x2b(%rbp) 5: 8b 90 60 13 00 00 mov 0x1360(%rax),%edx b: 83 fa 02 cmp $0x2,%edx e: 75 20 jne 0x30 10: 48 8b 88 68 13 00 00 mov 0x1368(%rax),%rcx 17: 8b 80 64 13 00 00 mov 0x1364(%rax),%eax 1d: 48 8b 11 mov (%rcx),%rdx 20: 48 83 c2 01 add $0x1,%rdx 24: 48 39 d0 cmp %rdx,%rax 27: 76 07 jbe 0x30 * 29: 48 89 34 d1 mov %rsi,(%rcx,%rdx,8) <-- trapping instruction 2d: 48 89 11 mov %rdx,(%rcx) 30: c3 retq 31: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1) 38: 00 39: 49 89 f1 mov %rsi,%r9 3c: 49 89 fa mov %rdi,%r10