================================================================== BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0xfcd/0x1190 drivers/hid/hid-mcp2221.c:852 Read of size 1 at addr ffff8880571affff by task syz.6.2515/14944 CPU: 0 UID: 0 PID: 14944 Comm: syz.6.2515 Not tainted 6.15.0-rc5-syzkaller-00204-g0e1329d4045c #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xb4/0x290 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 mcp2221_raw_event+0xfcd/0x1190 drivers/hid/hid-mcp2221.c:852 __hid_input_report drivers/hid/hid-core.c:2117 [inline] hid_input_report+0x407/0x520 drivers/hid/hid-core.c:2144 hid_irq_in+0x47e/0x6d0 drivers/hid/usbhid/hid-core.c:286 __usb_hcd_giveback_urb+0x417/0x690 drivers/usb/core/hcd.c:1650 dummy_timer+0x862/0x4550 drivers/usb/gadget/udc/dummy_hcd.c:1994 __run_hrtimer kernel/time/hrtimer.c:1761 [inline] __hrtimer_run_queues+0x529/0xc60 kernel/time/hrtimer.c:1825 hrtimer_run_softirq+0x187/0x2b0 kernel/time/hrtimer.c:1842 handle_softirqs+0x283/0x870 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:rcu_is_watching_curr_cpu include/linux/context_tracking.h:128 [inline] RIP: 0010:rcu_is_watching+0x26/0xb0 kernel/rcu/tree.c:736 Code: 90 90 90 90 f3 0f 1e fa 41 57 41 56 53 65 ff 05 a0 09 cb 10 e8 fb 1a a8 09 89 c3 83 f8 08 73 65 49 bf 00 00 00 00 00 fc ff df <4c> 8d 34 dd 10 9c 95 8d 4c 89 f0 48 c1 e8 03 42 80 3c 38 00 74 08 RSP: 0000:ffffc9001612e5b0 EFLAGS: 00000293 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 44c3fbf01535d500 RDX: ffffc9001612e701 RSI: ffffffff8bc0fec0 RDI: ffffffff8bc0fe80 RBP: dffffc0000000000 R08: ffffc9001612e970 R09: 0000000000000000 R10: ffffc9001612e758 R11: fffff52002c25ced R12: ffffc9001612e980 R13: ffffffff8171a9f5 R14: ffffffff8df3b860 R15: dffffc0000000000 trace_lock_release include/trace/events/lock.h:69 [inline] lock_release+0x4b/0x3e0 kernel/locking/lockdep.c:5877 rcu_lock_release include/linux/rcupdate.h:341 [inline] rcu_read_unlock include/linux/rcupdate.h:871 [inline] class_rcu_destructor include/linux/rcupdate.h:1155 [inline] unwind_next_frame+0x19a9/0x2390 arch/x86/kernel/unwind_orc.c:680 arch_stack_walk+0x11c/0x150 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:122 save_stack+0xf7/0x1f0 mm/page_owner.c:156 __set_page_owner+0x8d/0x4a0 mm/page_owner.c:329 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x21c7/0x22a0 mm/page_alloc.c:3688 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4970 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 folio_alloc_mpol_noprof+0x39/0x70 mm/mempolicy.c:2320 shmem_alloc_folio mm/shmem.c:1854 [inline] shmem_alloc_and_add_folio+0x447/0xf60 mm/shmem.c:1893 shmem_get_folio_gfp+0x597/0x15f0 mm/shmem.c:2533 shmem_get_folio mm/shmem.c:2639 [inline] shmem_write_begin+0xf7/0x2b0 mm/shmem.c:3289 generic_perform_write+0x2c4/0x910 mm/filemap.c:4103 shmem_file_write_iter+0xf8/0x120 mm/shmem.c:3464 __kernel_write_iter+0x390/0x860 fs/read_write.c:617 dump_emit_page fs/coredump.c:885 [inline] dump_user_range+0x830/0xc20 fs/coredump.c:959 elf_core_dump+0x32ed/0x3900 fs/binfmt_elf.c:2128 do_coredump+0x1ec8/0x2a30 fs/coredump.c:759 get_signal+0x10d9/0x1310 kernel/signal.c:3019 arch_do_signal_or_restart+0x95/0x780 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] irqentry_exit_to_user_mode+0x81/0x120 kernel/entry/common.c:231 exc_page_fault+0x91/0x110 arch/x86/mm/fault.c:1541 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0033:0x7f47a7d8e971 Code: 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 48 3d 01 f0 ff ff 73 01 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f RSP: 002b:00000000fffffe10 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007f47a7fb5fa0 RCX: 00007f47a7d8e969 RDX: 0000000000000000 RSI: 00000000fffffe10 RDI: 0000000000000000 RBP: 00007f47a7e10ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f47a7fb5fa0 R15: 00007ffe73ef7628 Allocated by task 11531: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4327 [inline] __kmalloc_node_track_caller_noprof+0x271/0x4e0 mm/slub.c:4346 kmalloc_reserve+0x136/0x290 net/core/skbuff.c:599 __alloc_skb+0x142/0x2d0 net/core/skbuff.c:668 alloc_skb include/linux/skbuff.h:1340 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:748 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:805 [inline] nsim_dev_trap_report_work+0x29a/0xb80 drivers/net/netdevsim/dev.c:851 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 11531: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2380 [inline] slab_free mm/slub.c:4642 [inline] kfree+0x193/0x440 mm/slub.c:4841 skb_kfree_head net/core/skbuff.c:1058 [inline] skb_free_head net/core/skbuff.c:1070 [inline] skb_release_data+0x69a/0x890 net/core/skbuff.c:1097 skb_release_all net/core/skbuff.c:1162 [inline] __kfree_skb net/core/skbuff.c:1176 [inline] consume_skb+0x9e/0xf0 net/core/skbuff.c:1408 nsim_dev_trap_report drivers/net/netdevsim/dev.c:821 [inline] nsim_dev_trap_report_work+0x7cf/0xb80 drivers/net/netdevsim/dev.c:851 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff8880571ae000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 4095 bytes to the right of allocated 4096-byte region [ffff8880571ae000, ffff8880571af000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x571a8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801a042140 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801a042140 dead000000000122 0000000000000000 head: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea00015c6a01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 11531, tgid 11531 (kworker/u8:3), ts 1156405274946, free_ts 1155293571391 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x21c7/0x22a0 mm/page_alloc.c:3688 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4970 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2450 [inline] allocate_slab+0x8a/0x3b0 mm/slub.c:2618 new_slab mm/slub.c:2672 [inline] ___slab_alloc+0xbfc/0x1480 mm/slub.c:3858 __slab_alloc mm/slub.c:3948 [inline] __slab_alloc_node mm/slub.c:4023 [inline] slab_alloc_node mm/slub.c:4184 [inline] __do_kmalloc_node mm/slub.c:4326 [inline] __kmalloc_node_track_caller_noprof+0x2f8/0x4e0 mm/slub.c:4346 kmalloc_reserve+0x136/0x290 net/core/skbuff.c:599 __alloc_skb+0x142/0x2d0 net/core/skbuff.c:668 alloc_skb include/linux/skbuff.h:1340 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:748 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:805 [inline] nsim_dev_trap_report_work+0x29a/0xb80 drivers/net/netdevsim/dev.c:851 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 page last free pid 14587 tgid 14587 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0xb05/0xcd0 mm/page_alloc.c:2725 discard_slab mm/slub.c:2716 [inline] __put_partials+0x161/0x1c0 mm/slub.c:3185 put_cpu_partial+0x17c/0x250 mm/slub.c:3260 __slab_free+0x2f7/0x400 mm/slub.c:4512 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] slab_alloc_node mm/slub.c:4196 [inline] kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4203 taskstats_tgid_alloc kernel/taskstats.c:576 [inline] taskstats_exit+0x14a/0xa30 kernel/taskstats.c:615 do_exit+0x854/0x2550 kernel/exit.c:938 do_group_exit+0x21c/0x2d0 kernel/exit.c:1102 __do_sys_exit_group kernel/exit.c:1113 [inline] __se_sys_exit_group kernel/exit.c:1111 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1111 x64_sys_call+0x21ba/0x21c0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880571afe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880571aff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880571aff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880571b0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880571b0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 90 nop 1: 90 nop 2: 90 nop 3: 90 nop 4: f3 0f 1e fa endbr64 8: 41 57 push %r15 a: 41 56 push %r14 c: 53 push %rbx d: 65 ff 05 a0 09 cb 10 incl %gs:0x10cb09a0(%rip) # 0x10cb09b4 14: e8 fb 1a a8 09 call 0x9a81b14 19: 89 c3 mov %eax,%ebx 1b: 83 f8 08 cmp $0x8,%eax 1e: 73 65 jae 0x85 20: 49 bf 00 00 00 00 00 movabs $0xdffffc0000000000,%r15 27: fc ff df * 2a: 4c 8d 34 dd 10 9c 95 lea -0x726a63f0(,%rbx,8),%r14 <-- trapping instruction 31: 8d 32: 4c 89 f0 mov %r14,%rax 35: 48 c1 e8 03 shr $0x3,%rax 39: 42 80 3c 38 00 cmpb $0x0,(%rax,%r15,1) 3e: 74 08 je 0x48