================================================================== BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0xfcd/0x1190 drivers/hid/hid-mcp2221.c:852 Read of size 1 at addr ffff88805b16ffff by task syz.1.738/8066 CPU: 1 UID: 0 PID: 8066 Comm: syz.1.738 Not tainted 6.15.0-rc6-syzkaller-00025-g627277ba7c23 #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+0x41a/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+0x52c/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:lock_release+0x2b5/0x3e0 kernel/locking/lockdep.c:5891 Code: 51 48 c7 44 24 20 00 00 00 00 9c 8f 44 24 20 f7 44 24 20 00 02 00 00 75 56 f7 c3 00 02 00 00 74 01 fb 65 48 8b 05 fb 3c d7 10 <48> 3b 44 24 28 0f 85 8b 00 00 00 48 83 c4 30 5b 41 5c 41 5d 41 5e RSP: 0018:ffffc9000426f1b0 EFLAGS: 00000206 RAX: 638e790eea4dca00 RBX: 0000000000000206 RCX: 638e790eea4dca00 RDX: 0000000000000001 RSI: ffffffff8d936f16 RDI: ffffffff8bc1d820 RBP: ffff888025138b18 R08: ffffc9000426f410 R09: 0000000000000000 R10: ffffc9000426f338 R11: fffff5200084de69 R12: 0000000000000001 R13: 0000000000000001 R14: ffffffff8df3dce0 R15: ffff888025138000 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 kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4147 [inline] kmem_cache_alloc_bulk_noprof+0x4e0/0x790 mm/slub.c:5371 mt_alloc_bulk lib/maple_tree.c:181 [inline] mas_alloc_nodes+0x447/0x8e0 lib/maple_tree.c:1271 mas_node_count_gfp lib/maple_tree.c:1331 [inline] mas_preallocate+0x542/0x8b0 lib/maple_tree.c:5501 vma_iter_prealloc mm/vma.h:409 [inline] __split_vma+0x315/0x9b0 mm/vma.c:490 split_vma mm/vma.c:553 [inline] vma_modify+0x23e/0x460 mm/vma.c:1579 vma_modify_flags+0x1e8/0x230 mm/vma.c:1605 mprotect_fixup+0x400/0x9b0 mm/mprotect.c:658 do_mprotect_pkey+0x8cd/0xce0 mm/mprotect.c:832 __do_sys_mprotect mm/mprotect.c:853 [inline] __se_sys_mprotect mm/mprotect.c:850 [inline] __ia32_sys_mprotect+0x7f/0x90 mm/mprotect.c:850 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xb4/0x110 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x34/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7f17539 Code: 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000f74ff968 EFLAGS: 00000206 ORIG_RAX: 000000000000007d RAX: ffffffffffffffda RBX: 00000000f4fb5000 RCX: 0000000000020000 RDX: 0000000000000003 RSI: 0000000000001000 RDI: 0000000000021000 RBP: 00000000f4fd4b40 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 5876: 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] __kvmalloc_node_noprof+0x314/0x5e0 mm/slub.c:5012 seq_buf_alloc fs/seq_file.c:38 [inline] seq_read_iter+0x1fd/0xe10 fs/seq_file.c:210 new_sync_read fs/read_write.c:489 [inline] vfs_read+0x4cd/0x980 fs/read_write.c:570 ksys_read+0x145/0x250 fs/read_write.c:713 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 Freed by task 5876: 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 seq_release+0x54/0x70 fs/seq_file.c:355 kernfs_fop_release+0x133/0x190 fs/kernfs/file.c:766 __fput+0x44c/0xa70 fs/file_table.c:465 fput_close_sync+0x119/0x200 fs/file_table.c:570 __do_sys_close fs/open.c:1581 [inline] __se_sys_close fs/open.c:1566 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1566 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 The buggy address belongs to the object at ffff88805b16e000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 4095 bytes to the right of allocated 4096-byte region [ffff88805b16e000, ffff88805b16f000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5b168 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88802ce6d201 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801a04b500 ffffea000174f400 0000000000000003 raw: 0000000000000000 0000000000040004 00000000f5000000 ffff88802ce6d201 head: 00fff00000000040 ffff88801a04b500 ffffea000174f400 0000000000000003 head: 0000000000000000 0000000000040004 00000000f5000000 ffff88802ce6d201 head: 00fff00000000003 ffffea00016c5a01 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5918, tgid 5918 (udevd), ts 136411658244, free_ts 135707011780 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+0x21ce/0x22b0 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] __kvmalloc_node_noprof+0x411/0x5e0 mm/slub.c:5012 seq_buf_alloc fs/seq_file.c:38 [inline] seq_read_iter+0x1fd/0xe10 fs/seq_file.c:210 new_sync_read fs/read_write.c:489 [inline] vfs_read+0x4cd/0x980 fs/read_write.c:570 ksys_read+0x145/0x250 fs/read_write.c:713 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 page last free pid 5918 tgid 5918 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0xb0e/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 getname_flags+0xb8/0x540 fs/namei.c:146 getname include/linux/fs.h:2852 [inline] getname_maybe_null include/linux/fs.h:2859 [inline] vfs_fstatat+0x43/0x160 fs/stat.c:367 __do_sys_newfstatat fs/stat.c:536 [inline] __se_sys_newfstatat fs/stat.c:530 [inline] __x64_sys_newfstatat+0x11c/0x1a0 fs/stat.c:530 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: ffff88805b16fe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805b16ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805b16ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88805b170000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805b170080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 51 push %rcx 1: 48 c7 44 24 20 00 00 movq $0x0,0x20(%rsp) 8: 00 00 a: 9c pushf b: 8f 44 24 20 pop 0x20(%rsp) f: f7 44 24 20 00 02 00 testl $0x200,0x20(%rsp) 16: 00 17: 75 56 jne 0x6f 19: f7 c3 00 02 00 00 test $0x200,%ebx 1f: 74 01 je 0x22 21: fb sti 22: 65 48 8b 05 fb 3c d7 mov %gs:0x10d73cfb(%rip),%rax # 0x10d73d25 29: 10 * 2a: 48 3b 44 24 28 cmp 0x28(%rsp),%rax <-- trapping instruction 2f: 0f 85 8b 00 00 00 jne 0xc0 35: 48 83 c4 30 add $0x30,%rsp 39: 5b pop %rbx 3a: 41 5c pop %r12 3c: 41 5d pop %r13 3e: 41 5e pop %r14