================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:359 [inline] BUG: KASAN: slab-out-of-bounds in usb_hcd_poll_rh_status+0x423/0x6b0 drivers/usb/core/hcd.c:774 Write of size 2 at addr ffff8880a79ff880 by task udevd/3909 CPU: 1 PID: 3909 Comm: udevd Not tainted 5.3.0-rc6+ #147 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0xd4/0x306 mm/kasan/report.c:351 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:618 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x134/0x1a0 mm/kasan/generic.c:192 memcpy+0x38/0x50 mm/kasan/common.c:123 memcpy include/linux/string.h:359 [inline] usb_hcd_poll_rh_status+0x423/0x6b0 drivers/usb/core/hcd.c:774 rh_timer_func+0x19/0x20 drivers/usb/core/hcd.c:800 call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1322 expire_timers kernel/time/timer.c:1366 [inline] __run_timers kernel/time/timer.c:1685 [inline] __run_timers kernel/time/timer.c:1653 [inline] run_timer_softirq+0x697/0x17a0 kernel/time/timer.c:1698 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:537 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1133 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:768 [inline] RIP: 0010:kfree+0x239/0x2c0 mm/slab.c:3757 Code: 55 7e 0f 85 20 fe ff ff e8 84 31 54 ff e9 16 fe ff ff e8 ca b9 cb ff 48 83 3d 32 be 26 07 00 0f 84 85 00 00 00 48 89 df 57 9d <0f> 1f 44 00 00 5b 41 5c 41 5d 41 5e 5d c3 e8 a4 b9 cb ff 48 83 3d RSP: 0018:ffff888096bc7958 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000007 RBX: 0000000000000282 RCX: 1ffffffff134b5de RDX: 0000000000000000 RSI: ffffffff8177f03e RDI: 0000000000000282 RBP: ffff888096bc7978 R08: ffff888096bbe600 R09: fffffbfff134afa0 R10: fffffbfff134af9f R11: ffffffff89a57cff R12: ffff888056c7a540 R13: ffff8880aa402000 R14: ffffffff83059eae R15: 0000000000001000 tomoyo_realpath_from_path+0x1de/0x7b0 security/tomoyo/realpath.c:319 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path2_perm+0x344/0x670 security/tomoyo/file.c:923 tomoyo_path_rename+0xee/0x150 security/tomoyo/tomoyo.c:285 security_path_rename+0x20c/0x300 security/security.c:1039 do_renameat2+0x7b8/0xc40 fs/namei.c:4623 __do_sys_rename fs/namei.c:4673 [inline] __se_sys_rename fs/namei.c:4671 [inline] __x64_sys_rename+0x61/0x80 fs/namei.c:4671 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fcb8cc8b527 Code: 32 00 64 83 38 15 74 07 b8 ff ff ff ff 5b c3 48 89 df e8 1c c1 07 00 85 c0 75 ed 31 c0 eb d3 90 90 90 90 b8 52 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e1 f8 32 00 31 d2 48 29 c2 64 RSP: 002b:00007ffdd6c96d48 EFLAGS: 00000206 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00000000025103f0 RCX: 00007fcb8cc8b527 RDX: 0000000000000000 RSI: 00007ffdd6c97190 RDI: 00007ffdd6c96d90 RBP: 00007ffdd6c975d0 R08: 00000000004207f1 R09: 00007fcb8cd5be00 R10: 0000000000000022 R11: 0000000000000206 R12: 0000000000000000 R13: 00007ffdd6c96d88 R14: 0000000002513260 R15: 0000000002514980 Allocated by task 1325: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:493 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:466 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:507 __do_kmalloc mm/slab.c:3655 [inline] __kmalloc+0x163/0x770 mm/slab.c:3664 kmalloc include/linux/slab.h:557 [inline] proc_bulk+0x2f5/0x7f0 drivers/usb/core/devio.c:1168 usbdev_do_ioctl+0x525/0x2d10 drivers/usb/core/devio.c:2443 usbdev_ioctl+0x26/0x30 drivers/usb/core/devio.c:2600 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:509 [inline] do_vfs_ioctl+0xdb6/0x13e0 fs/ioctl.c:696 ksys_ioctl+0xab/0xd0 fs/ioctl.c:713 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9962: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:455 kasan_slab_free+0xe/0x10 mm/kasan/common.c:463 __cache_free mm/slab.c:3425 [inline] kfree+0x10a/0x2c0 mm/slab.c:3756 apparmor_sk_free_security+0xd9/0x120 security/apparmor/lsm.c:782 security_sk_free+0x41/0x80 security/security.c:2034 sk_prot_free net/core/sock.c:1636 [inline] __sk_destruct+0x4a7/0x6e0 net/core/sock.c:1726 sk_destruct+0x86/0xa0 net/core/sock.c:1734 __sk_free+0xfb/0x360 net/core/sock.c:1745 sk_free+0x42/0x50 net/core/sock.c:1756 sock_put include/net/sock.h:1725 [inline] tcp_close+0xbe9/0x10e0 net/ipv4/tcp.c:2494 inet_release+0xed/0x200 net/ipv4/af_inet.c:427 __sock_release+0xce/0x280 net/socket.c:590 sock_close+0x1e/0x30 net/socket.c:1268 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x5a9/0x6a0 arch/x86/entry/common.c:299 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a79ff880 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff8880a79ff880, ffff8880a79ff8a0) The buggy address belongs to the page: page:ffffea00029e7fc0 refcount:1 mapcount:0 mapping:ffff8880aa4001c0 index:0xffff8880a79fffc1 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea000285a1c8 ffffea00024c75c8 ffff8880aa4001c0 raw: ffff8880a79fffc1 ffff8880a79ff000 000000010000001e 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a79ff780: 00 03 fc fc fc fc fc fc fb fb fb fb fc fc fc fc ffff8880a79ff800: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff8880a79ff880: 01 fc fc fc fc fc fc fc 00 fc fc fc fc fc fc fc ^ ffff8880a79ff900: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff8880a79ff980: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================