================================================================== BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948 Read of size 1 at addr ffff888135dbffff by task udevd/2855 CPU: 0 UID: 0 PID: 2855 Comm: udevd Not tainted syzkaller #0 PREEMPT(voluntary) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948 __hid_input_report.constprop.0+0x314/0x450 drivers/hid/hid-core.c:2139 hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286 __usb_hcd_giveback_urb+0x38b/0x610 drivers/usb/core/hcd.c:1661 usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1745 dummy_timer+0x1809/0x3a00 drivers/usb/gadget/udc/dummy_hcd.c:1995 __run_hrtimer kernel/time/hrtimer.c:1777 [inline] __hrtimer_run_queues+0x202/0xad0 kernel/time/hrtimer.c:1841 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1858 handle_softirqs+0x208/0x8d0 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xfa/0x160 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline] sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1052 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 RIP: 0010:string_nocheck lib/vsprintf.c:652 [inline] RIP: 0010:string+0x1ce/0x4f0 lib/vsprintf.c:735 Code: ff 48 89 ee e8 e3 a2 3c fa 48 81 fd 00 e0 ff ff 0f 87 4a 01 00 00 e8 61 a7 3c fa 48 8b 44 24 40 31 ff 45 31 ff 48 89 44 24 18 <41> 0f bf c4 89 c6 89 04 24 e8 84 a2 3c fa 66 45 85 e4 0f 84 be 00 RSP: 0018:ffffc9000152f8a0 EFLAGS: 00000246 RAX: ffffffffffff0a00 RBX: ffff88811f004000 RCX: ffffffff8741a6ed RDX: ffff888116c0ba00 RSI: ffffffff8741a6ff RDI: 0000000000000000 RBP: ffff8881113e321c R08: 0000000000000007 R09: ffffffffffffe000 R10: ffff8881113e321c R11: 0000000000000000 R12: 00000000ffffffff R13: ffff88811f005000 R14: ffff8881113e421c R15: 0000000000000000 vsnprintf+0x4bc/0x1160 lib/vsprintf.c:2926 vscnprintf+0x40/0x90 lib/vsprintf.c:2991 sysfs_emit_at+0x190/0x1a0 fs/sysfs/file.c:788 uevent_show+0x287/0x3a0 drivers/base/core.c:2762 dev_attr_show+0x56/0xe0 drivers/base/core.c:2421 sysfs_kf_seq_show+0x216/0x3e0 fs/sysfs/file.c:65 seq_read_iter+0x50e/0x12d0 fs/seq_file.c:230 kernfs_fop_read_iter+0x46c/0x610 fs/kernfs/file.c:297 new_sync_read fs/read_write.c:491 [inline] vfs_read+0x8bf/0xcf0 fs/read_write.c:572 ksys_read+0x12a/0x250 fs/read_write.c:715 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4d0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f2b04f7a407 Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff RSP: 002b:00007ffd109a2b70 EFLAGS: 00000202 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007f2b04e8c880 RCX: 00007f2b04f7a407 RDX: 0000000000001000 RSI: 00005573d8e11ab0 RDI: 000000000000000c RBP: 00007f2b050c2ff0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 000000000000000a R13: 00007f2b050c2ea0 R14: 0000000000000000 R15: 00005573d8e06260 Allocated by task 38: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:417 kmalloc_noprof include/linux/slab.h:957 [inline] usb_cache_string+0x5d/0x150 drivers/usb/core/message.c:1028 usb_enumerate_device drivers/usb/core/hub.c:2538 [inline] usb_new_device+0x1d0/0x1a60 drivers/usb/core/hub.c:2665 hub_port_connect drivers/usb/core/hub.c:5567 [inline] hub_port_connect_change drivers/usb/core/hub.c:5707 [inline] port_event drivers/usb/core/hub.c:5871 [inline] hub_event+0x2fce/0x5060 drivers/usb/core/hub.c:5953 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3263 process_scheduled_works kernel/workqueue.c:3346 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3427 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x56d/0x700 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 38: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 __kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x43/0x70 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2539 [inline] slab_free mm/slub.c:6630 [inline] kfree+0x288/0x670 mm/slub.c:6837 usb_cache_string+0xf2/0x150 drivers/usb/core/message.c:1037 usb_enumerate_device drivers/usb/core/hub.c:2538 [inline] usb_new_device+0x1d0/0x1a60 drivers/usb/core/hub.c:2665 hub_port_connect drivers/usb/core/hub.c:5567 [inline] hub_port_connect_change drivers/usb/core/hub.c:5707 [inline] port_event drivers/usb/core/hub.c:5871 [inline] hub_event+0x2fce/0x5060 drivers/usb/core/hub.c:5953 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3263 process_scheduled_works kernel/workqueue.c:3346 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3427 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x56d/0x700 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888135dbfc00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 511 bytes to the right of allocated 512-byte region [ffff888135dbfc00, ffff888135dbfe00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888135dbe000 pfn:0x135dbc head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x200000000000240(workingset|head|node=0|zone=2) page_type: f5(slab) raw: 0200000000000240 ffff888100041c80 ffffea0004767f10 ffffea00044f4110 raw: ffff888135dbe000 000000000010000b 00000000f5000000 0000000000000000 head: 0200000000000240 ffff888100041c80 ffffea0004767f10 ffffea00044f4110 head: ffff888135dbe000 000000000010000b 00000000f5000000 0000000000000000 head: 0200000000000002 ffffea0004d76f01 00000000ffffffff 00000000ffffffff head: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5191, tgid 5191 (udevd), ts 124074123851, free_ts 107312183578 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x1003/0x2dc0 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x259/0x21f0 mm/page_alloc.c:5183 alloc_pages_mpol+0xe4/0x410 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3055 [inline] allocate_slab mm/slub.c:3228 [inline] new_slab+0x24a/0x360 mm/slub.c:3282 ___slab_alloc+0xdb7/0x1a70 mm/slub.c:4651 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4770 __slab_alloc_node mm/slub.c:4846 [inline] slab_alloc_node mm/slub.c:5268 [inline] __kmalloc_cache_noprof+0x3c8/0x750 mm/slub.c:5758 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] kernfs_fop_open+0x244/0xda0 fs/kernfs/file.c:641 do_dentry_open+0x6da/0x13a0 fs/open.c:965 vfs_open+0x82/0x3f0 fs/open.c:1097 do_open fs/namei.c:3975 [inline] path_openat+0x1de4/0x2cb0 fs/namei.c:4134 do_filp_open+0x20b/0x470 fs/namei.c:4161 do_sys_openat2+0x11b/0x1d0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_sys_openat fs/open.c:1468 [inline] __se_sys_openat fs/open.c:1463 [inline] __x64_sys_openat+0x174/0x210 fs/open.c:1463 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4d0 arch/x86/entry/syscall_64.c:94 page last free pid 5212 tgid 5212 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0x78f/0x1000 mm/page_alloc.c:2906 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4d/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x4e/0x70 mm/kasan/common.c:352 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4970 [inline] slab_alloc_node mm/slub.c:5280 [inline] kmem_cache_alloc_noprof+0x260/0x6c0 mm/slub.c:5287 vm_area_alloc+0x1f/0x160 mm/vma_init.c:32 __mmap_new_vma mm/vma.c:2461 [inline] __mmap_region+0xec1/0x25d0 mm/vma.c:2670 mmap_region+0x1ab/0x3f0 mm/vma.c:2740 do_mmap+0xa2e/0x11f0 mm/mmap.c:558 vm_mmap_pgoff+0x201/0x390 mm/util.c:581 ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:604 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4d0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888135dbfe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888135dbff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888135dbff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888135dc0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888135dc0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: ff 48 89 decl -0x77(%rax) 3: ee out %al,(%dx) 4: e8 e3 a2 3c fa call 0xfa3ca2ec 9: 48 81 fd 00 e0 ff ff cmp $0xffffffffffffe000,%rbp 10: 0f 87 4a 01 00 00 ja 0x160 16: e8 61 a7 3c fa call 0xfa3ca77c 1b: 48 8b 44 24 40 mov 0x40(%rsp),%rax 20: 31 ff xor %edi,%edi 22: 45 31 ff xor %r15d,%r15d 25: 48 89 44 24 18 mov %rax,0x18(%rsp) * 2a: 41 0f bf c4 movswl %r12w,%eax <-- trapping instruction 2e: 89 c6 mov %eax,%esi 30: 89 04 24 mov %eax,(%rsp) 33: e8 84 a2 3c fa call 0xfa3ca2bc 38: 66 45 85 e4 test %r12w,%r12w 3c: 0f .byte 0xf 3d: 84 .byte 0x84 3e: be .byte 0xbe