==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:957
Read of size 1 at addr ffff8881290bffff by task syz.3.5743/27838
CPU: 1 UID: 0 PID: 27838 Comm: syz.3.5743 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
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+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1d0 mm/kasan/report.c:595
mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:957
__hid_input_report.constprop.0+0x314/0x460 drivers/hid/hid-core.c:2147
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+0xda1/0x36c0 drivers/usb/gadget/udc/dummy_hcd.c:2005
__run_hrtimer kernel/time/hrtimer.c:1930 [inline]
__hrtimer_run_queues+0x470/0xa00 kernel/time/hrtimer.c:1994
hrtimer_run_softirq+0x17d/0x2c0 kernel/time/hrtimer.c:2011
handle_softirqs+0x1dd/0x9e0 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0x160/0x210 kernel/softirq.c:735
irq_exit_rcu+0x9/0x30 kernel/softirq.c:752
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1061 [inline]
sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1061
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:preempt_count_add+0x31/0x150 kernel/sched/core.c:5859
Code: 40 da 05 94 55 48 ba 00 00 00 00 00 fc ff df 48 89 c1 53 83 e0 07 89 fb 48 c1 e9 03 83 c0 03 65 01 3d 13 94 74 0b 0f b6 14 11 <38> d0 7c 08 84 d2 0f 85 de 00 00 00 8b 15 0d be 82 12 65 8b 05 f6
RSP: 0018:ffffc900014a7ea8 EFLAGS: 00000282
RAX: 0000000000000003 RBX: 0000000000000001 RCX: 1ffffffff280bb48
RDX: 0000000000000004 RSI: ffffffff821fea87 RDI: 0000000000000001
RBP: ffff8881053e7500 R08: 0000000000000007 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff8881053e7658
R13: ffff8881053e7500 R14: 00007f43c04c5fe0 R15: 0000000000000003
class_preempt_constructor include/linux/preempt.h:468 [inline]
file_ref_put include/linux/file_ref.h:150 [inline]
fput+0x21/0x100 fs/file_table.c:586
fdput include/linux/file.h:63 [inline]
class_fd_destructor include/linux/file.h:83 [inline]
__do_sys_ioctl fs/ioctl.c:585 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x1c6/0x210 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x10b/0x7f0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f43c1a6caeb
Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00
RSP: 002b:00007f43c04c5f60 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f43c1a6caeb
RDX: 00007f43c04c5fe0 RSI: 0000000040085507 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007f43c1e10320 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000246 R12: 0000200000000140
R13: 0000000000000000 R14: 00007f43c1ce5fa0 R15: 00007fffe4150158
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1290bf
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 dead000000000100 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 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 25217, tgid 25217 (modprobe), ts 2719658471478, free_ts 2719948303232
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x153/0x170 mm/page_alloc.c:1858
prep_new_page mm/page_alloc.c:1866 [inline]
get_page_from_freelist+0xf34/0x3a90 mm/page_alloc.c:3946
__alloc_frozen_pages_noprof+0x273/0x28a0 mm/page_alloc.c:5226
alloc_pages_mpol+0xe8/0x410 mm/mempolicy.c:2490
alloc_pages_noprof+0x1a/0x160 mm/mempolicy.c:2581
pagetable_alloc_noprof include/linux/mm.h:3651 [inline]
__pte_alloc_one_noprof include/asm-generic/pgalloc.h:76 [inline]
pte_alloc_one+0x1c/0x3d0 arch/x86/mm/pgtable.c:18
do_fault_around mm/memory.c:5845 [inline]
do_read_fault mm/memory.c:5884 [inline]
do_fault mm/memory.c:6027 [inline]
do_pte_missing mm/memory.c:4550 [inline]
handle_pte_fault mm/memory.c:6411 [inline]
__handle_mm_fault+0x1b7d/0x2780 mm/memory.c:6549
handle_mm_fault+0x36d/0xa20 mm/memory.c:6718
do_user_addr_fault+0x5ae/0x11d0 arch/x86/mm/fault.c:1334
handle_page_fault arch/x86/mm/fault.c:1474 [inline]
exc_page_fault+0x66/0xc0 arch/x86/mm/fault.c:1527
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618
page last free pid 22 tgid 22 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1402 [inline]
__free_frozen_pages+0x692/0xf10 mm/page_alloc.c:2943
__pagetable_free include/linux/mm.h:3661 [inline]
pagetable_free include/linux/mm.h:3685 [inline]
pagetable_dtor_free include/linux/mm.h:3784 [inline]
__tlb_remove_table include/asm-generic/tlb.h:221 [inline]
__tlb_remove_table_free mm/mmu_gather.c:228 [inline]
tlb_remove_table_rcu+0x2cf/0x380 mm/mmu_gather.c:291
rcu_do_batch kernel/rcu/tree.c:2617 [inline]
rcu_core+0x5a2/0x10d0 kernel/rcu/tree.c:2869
handle_softirqs+0x1dd/0x9e0 kernel/softirq.c:622
run_ksoftirqd kernel/softirq.c:1076 [inline]
run_ksoftirqd+0x38/0x60 kernel/softirq.c:1068
smpboot_thread_fn+0x3d3/0xaa0 kernel/smpboot.c:160
kthread+0x370/0x450 kernel/kthread.c:436
ret_from_fork+0x69a/0xc80 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Memory state around the buggy address:
ffff8881290bfe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881290bff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881290bff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881290c0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8881290c0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess), 3 bytes skipped:
0: 94 xchg %eax,%esp
1: 55 push %rbp
2: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx
9: fc ff df
c: 48 89 c1 mov %rax,%rcx
f: 53 push %rbx
10: 83 e0 07 and $0x7,%eax
13: 89 fb mov %edi,%ebx
15: 48 c1 e9 03 shr $0x3,%rcx
19: 83 c0 03 add $0x3,%eax
1c: 65 01 3d 13 94 74 0b add %edi,%gs:0xb749413(%rip) # 0xb749436
23: 0f b6 14 11 movzbl (%rcx,%rdx,1),%edx
* 27: 38 d0 cmp %dl,%al <-- trapping instruction
29: 7c 08 jl 0x33
2b: 84 d2 test %dl,%dl
2d: 0f 85 de 00 00 00 jne 0x111
33: 8b 15 0d be 82 12 mov 0x1282be0d(%rip),%edx # 0x1282be46
39: 65 gs
3a: 8b .byte 0x8b
3b: 05 .byte 0x5
3c: f6 .byte 0xf6