================================================================== 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 ffff88807b18f3e8 by task syz-executor.0/12633 CPU: 0 PID: 12633 Comm: syz-executor.0 Not tainted 5.16.0-rc4-next-20211210-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+0xa5/0x3ed mm/kasan/report.c:255 __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: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:write_comp_data kernel/kcov.c:221 [inline] RIP: 0010:__sanitizer_cov_trace_const_cmp1+0x7/0x80 kernel/kcov.c:273 Code: 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 03 00 00 00 65 48 8b 0c 25 40 70 02 00 48 89 ce 4c 8b 54 24 08 RSP: 0018:ffffc9000295f8b0 EFLAGS: 00000206 RAX: 0000000000000000 RBX: 0000000000000009 RCX: 0000000000000000 RDX: ffff8880348c9d40 RSI: 0000000000000009 RDI: 0000000000000010 RBP: ffff88806bb2ae80 R08: 0000000000000000 R09: 0000000000000009 R10: ffffffff83b012d7 R11: 0000000000000010 R12: 0000000000000010 R13: 00000000000000e1 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_path_perm+0x2f0/0x400 security/tomoyo/file.c:838 tomoyo_path_unlink+0x8e/0xd0 security/tomoyo/tomoyo.c:149 security_path_unlink+0xd7/0x150 security/security.c:1148 do_unlinkat+0x360/0x650 fs/namei.c:4214 __do_sys_unlink fs/namei.c:4266 [inline] __se_sys_unlink fs/namei.c:4264 [inline] __x64_sys_unlink+0xc6/0x110 fs/namei.c:4264 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:0x7f28a61d77d7 Code: 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 57 00 00 00 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:00007ffec68abb28 EFLAGS: 00000206 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f28a61d77d7 RDX: 00007ffec68abb60 RSI: 00007ffec68abb60 RDI: 00007ffec68abbf0 RBP: 00007ffec68abbf0 R08: 0000000000000001 R09: 00007ffec68ab9c0 R10: 00005555559db873 R11: 0000000000000206 R12: 00007f28a62311b2 R13: 00007ffec68accb0 R14: 00005555559db810 R15: 00007ffec68accf0 Allocated by task 21631: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:586 [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 ffff88807b18f3e8 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of 8-byte region [ffff88807b18f3e8, ffff88807b18f3f0) The buggy address belongs to the page: page:ffffea0001ec63c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7b18f flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000048f3c0 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 3630, ts 131800144117, free_ts 131735562161 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+0x1aa/0x310 mm/mempolicy.c:2271 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab mm/slub.c:1944 [inline] new_slab+0x28d/0x3a0 mm/slub.c:2004 ___slab_alloc+0x6be/0xd60 mm/slub.c:3019 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3106 slab_alloc_node mm/slub.c:3197 [inline] slab_alloc mm/slub.c:3239 [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 fs/kernfs/dir.c:647 [inline] kernfs_create_dir_ns+0x9c/0x220 fs/kernfs/dir.c:994 sysfs_create_dir_ns+0x128/0x290 fs/sysfs/dir.c:59 create_dir lib/kobject.c:89 [inline] kobject_add_internal+0x2d2/0xa60 lib/kobject.c:255 kobject_add_varg lib/kobject.c:390 [inline] kobject_init_and_add+0x101/0x160 lib/kobject.c:473 netdev_queue_add_kobject net/core/net-sysfs.c:1653 [inline] netdev_queue_update_kobjects+0x1ec/0x4c0 net/core/net-sysfs.c:1705 register_queue_kobjects net/core/net-sysfs.c:1766 [inline] netdev_register_kobject+0x35a/0x430 net/core/net-sysfs.c:2012 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+0x17c/0x1a0 mm/slub.c:2537 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0x100 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:766 [inline] slab_alloc_node mm/slub.c:3231 [inline] slab_alloc mm/slub.c:3239 [inline] kmem_cache_alloc_trace+0x1e9/0x2c0 mm/slub.c:3256 kmalloc include/linux/slab.h:581 [inline] tomoyo_print_header security/tomoyo/audit.c:156 [inline] tomoyo_init_log+0x18a/0x1ee0 security/tomoyo/audit.c:255 tomoyo_supervisor+0x34d/0xf00 security/tomoyo/common.c:2097 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x419/0x590 security/tomoyo/file.c:734 security_file_ioctl+0x50/0xb0 security/security.c:1533 __do_sys_ioctl fs/ioctl.c:868 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0xb3/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 Memory state around the buggy address: ffff88807b18f280: 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc fa ffff88807b18f300: fc fc fc fc fb fc fc fc fc 00 fc fc fc fc 00 fc >ffff88807b18f380: fc fc fc fa fc fc fc fc 00 fc fc fc fc 01 fc fc ^ ffff88807b18f400: fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc ffff88807b18f480: fc 00 fc fc fc fc fa fc fc fc fc 00 fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 01 4c 89 44 add %ecx,0x44(%rcx,%rcx,4) 4: 38 e8 cmp %ch,%al 6: 48 c7 44 38 e0 06 00 movq $0x6,-0x20(%rax,%rdi,1) d: 00 00 f: 48 89 4c 38 f0 mov %rcx,-0x10(%rax,%rdi,1) 14: 4e 89 54 c8 20 mov %r10,0x20(%rax,%r9,8) 19: 48 89 10 mov %rdx,(%rax) 1c: c3 retq 1d: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 23: 53 push %rbx 24: 41 89 fb mov %edi,%r11d 27: 41 89 f1 mov %esi,%r9d * 2a: bf 03 00 00 00 mov $0x3,%edi <-- trapping instruction 2f: 65 48 8b 0c 25 40 70 mov %gs:0x27040,%rcx 36: 02 00 38: 48 89 ce mov %rcx,%rsi 3b: 4c 8b 54 24 08 mov 0x8(%rsp),%r10