==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:948
Read of size 1 at addr ffff88813d427fff by task udevd/5245
CPU: 0 UID: 0 PID: 5245 Comm: udevd Not tainted syzkaller #0 PREEMPT(voluntary)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x156/0x4c9 mm/kasan/report.c:482
kasan_report+0xdf/0x1a0 mm/kasan/report.c:595
mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:948
__hid_input_report.constprop.0+0x314/0x460 drivers/hid/hid-core.c:2139
hid_irq_in+0x52e/0x6b0 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x38d/0x610 drivers/usb/core/hcd.c:1657
usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741
dummy_timer+0xd85/0x3670 drivers/usb/gadget/udc/dummy_hcd.c:1995
__run_hrtimer kernel/time/hrtimer.c:1777 [inline]
__hrtimer_run_queues+0x516/0x990 kernel/time/hrtimer.c:1841
hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1858
handle_softirqs+0x1dd/0x8f0 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0xed/0x150 kernel/softirq.c:723
irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1056
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:arch_atomic_read arch/x86/include/asm/atomic.h:23 [inline]
RIP: 0010:raw_atomic_read include/linux/atomic/atomic-arch-fallback.h:457 [inline]
RIP: 0010:rcu_is_watching_curr_cpu include/linux/context_tracking.h:128 [inline]
RIP: 0010:rcu_is_watching+0x60/0xc0 kernel/rcu/tree.c:751
Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 75 5c 48 03 1c ed e0 7b ed 88 48 b8 00 00 00 00 00 fc ff df 48 89 da 48 c1 ea 03 0f b6 14 02 <48> 89 d8 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 24 8b 03 c1 e8 02
RSP: 0018:ffffc900023c74a0 EFLAGS: 00000a06
RAX: dffffc0000000000 RBX: ffff8881f5633628 RCX: 0000000095481a34
RDX: 0000000000000000 RSI: ffffffff878a88a0 RDI: ffffffff88ed7be0
RBP: 0000000000000000 R08: 0000000000000007 R09: 0000000000000001
R10: 0000000000000200 R11: 0000000000000000 R12: ffffffff819c88c0
R13: ffffc900023c7528 R14: 0000000000000000 R15: ffff888122609d40
rcu_read_lock include/linux/rcupdate.h:868 [inline]
class_rcu_constructor include/linux/rcupdate.h:1195 [inline]
unwind_next_frame+0x6fa/0x1ea0 arch/x86/kernel/unwind_orc.c:495
arch_stack_walk+0x94/0xf0 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x8e/0xc0 kernel/stacktrace.c:122
kasan_save_stack+0x30/0x50 mm/kasan/common.c:56
kasan_record_aux_stack+0x8c/0xa0 mm/kasan/generic.c:556
__call_rcu_common.constprop.0+0xa5/0x9b0 kernel/rcu/tree.c:3119
slab_free_hook mm/slub.c:2504 [inline]
slab_free mm/slub.c:6670 [inline]
kmem_cache_free+0x46f/0x6d0 mm/slub.c:6781
file_free fs/file_table.c:79 [inline]
__fput_deferred+0x3e6/0x490 fs/file_table.c:523
fput_close+0x118/0x250 fs/file_table.c:585
path_openat+0xfec/0x3120 fs/namei.c:4796
do_filp_open+0x1f7/0x420 fs/namei.c:4814
do_sys_openat2+0x12e/0x220 fs/open.c:1430
do_sys_open fs/open.c:1436 [inline]
__do_sys_openat fs/open.c:1452 [inline]
__se_sys_openat fs/open.c:1447 [inline]
__x64_sys_openat+0x12d/0x210 fs/open.c:1447
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xc9/0x570 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f4332638407
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:00007ffde338bf70 EFLAGS: 00000202 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f433254a880 RCX: 00007f4332638407
RDX: 0000000000080000 RSI: 00007ffde338c0f0 RDI: ffffffffffffff9c
RBP: 0000000000000008 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 00005636dc7447f5
R13: 00005636dc7447f5 R14: 0000000000000001 R15: 00005636dc75f140
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888100000000 pfn:0x13d427
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 dead000000000100 dead000000000122 0000000000000000
raw: ffff888100000000 ffff8881170cb2a0 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO|__GFP_COMP), pid 13236, tgid 13236 (syz.4.2236), ts 1168924469417, free_ts 1171228267337
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1846
prep_new_page mm/page_alloc.c:1854 [inline]
get_page_from_freelist+0xd57/0x3b20 mm/page_alloc.c:3915
__alloc_frozen_pages_noprof+0x269/0x2230 mm/page_alloc.c:5210
alloc_pages_mpol+0xe8/0x410 mm/mempolicy.c:2486
alloc_frozen_pages_noprof mm/mempolicy.c:2557 [inline]
alloc_pages_noprof+0x131/0x390 mm/mempolicy.c:2577
pagetable_alloc_noprof include/linux/mm.h:3190 [inline]
pmd_alloc_one_noprof include/asm-generic/pgalloc.h:143 [inline]
__pmd_alloc+0x3b/0x990 mm/memory.c:6666
pmd_alloc include/linux/mm.h:3106 [inline]
__handle_mm_fault+0xedd/0x2d30 mm/memory.c:6363
handle_mm_fault+0x36d/0xa20 mm/memory.c:6580
do_user_addr_fault+0x5ae/0x11d0 arch/x86/mm/fault.c:1336
handle_page_fault arch/x86/mm/fault.c:1476 [inline]
exc_page_fault+0x66/0xc0 arch/x86/mm/fault.c:1532
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618
page last free pid 5244 tgid 5244 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
__free_frozen_pages+0x7d1/0x1010 mm/page_alloc.c:2943
__pagetable_free include/linux/mm.h:3200 [inline]
pagetable_free include/linux/mm.h:3224 [inline]
pagetable_dtor_free include/linux/mm.h:3328 [inline]
__tlb_remove_table include/asm-generic/tlb.h:220 [inline]
__tlb_remove_table_free mm/mmu_gather.c:227 [inline]
tlb_remove_table_rcu+0x2b2/0x390 mm/mmu_gather.c:290
rcu_do_batch kernel/rcu/tree.c:2605 [inline]
rcu_core+0x7c0/0x15c0 kernel/rcu/tree.c:2857
handle_softirqs+0x1dd/0x8f0 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0xed/0x150 kernel/softirq.c:723
irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1056
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
Memory state around the buggy address:
ffff88813d427e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88813d427f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88813d427f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88813d428000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88813d428080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 48 89 fa mov %rdi,%rdx
3: 48 c1 ea 03 shr $0x3,%rdx
7: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
b: 75 5c jne 0x69
d: 48 03 1c ed e0 7b ed add -0x77128420(,%rbp,8),%rbx
14: 88
15: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
1c: fc ff df
1f: 48 89 da mov %rbx,%rdx
22: 48 c1 ea 03 shr $0x3,%rdx
26: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx
* 2a: 48 89 d8 mov %rbx,%rax <-- trapping instruction
2d: 83 e0 07 and $0x7,%eax
30: 83 c0 03 add $0x3,%eax
33: 38 d0 cmp %dl,%al
35: 7c 04 jl 0x3b
37: 84 d2 test %dl,%dl
39: 75 24 jne 0x5f
3b: 8b 03 mov (%rbx),%eax
3d: c1 e8 02 shr $0x2,%eax