==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x10b0/0x12a0 drivers/hid/hid-mcp2221.c:964
Read of size 1 at addr ffff8880599e3fff by task udevd/4992
CPU: 0 UID: 0 PID: 4992 Comm: udevd Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Call Trace:
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_address_description+0x55/0x1e0 mm/kasan/report.c:378
print_report+0x58/0x70 mm/kasan/report.c:482
kasan_report+0x117/0x150 mm/kasan/report.c:595
mcp2221_raw_event+0x10b0/0x12a0 drivers/hid/hid-mcp2221.c:964
__hid_input_report+0x41c/0x580 drivers/hid/hid-core.c:2168
hid_irq_in+0x492/0x710 drivers/hid/usbhid/hid-core.c:287
__usb_hcd_giveback_urb+0x374/0x530 drivers/usb/core/hcd.c:1657
dummy_timer+0xac3/0x4b40 drivers/usb/gadget/udc/dummy_hcd.c:2005
__run_hrtimer kernel/time/hrtimer.c:2032 [inline]
__hrtimer_run_queues+0x3bc/0xa10 kernel/time/hrtimer.c:2096
hrtimer_run_softirq+0x17a/0x240 kernel/time/hrtimer.c:2113
handle_softirqs+0x225/0x840 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0xca/0x220 kernel/softirq.c:735
irq_exit_rcu+0x9/0x30 kernel/softirq.c:752
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1062
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
RIP: 0010:get_current arch/x86/include/asm/current.h:25 [inline]
RIP: 0010:write_comp_data kernel/kcov.c:245 [inline]
RIP: 0010:__sanitizer_cov_trace_const_cmp4+0x8/0x90 kernel/kcov.c:314
Code: 89 44 11 20 c3 cc cc cc cc cc 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 48 8b 04 24 <65> 48 8b 15 78 09 a6 11 65 8b 0d 99 09 a6 11 81 e1 00 01 ff 00 74
RSP: 0018:ffffc900026cf9e0 EFLAGS: 00000246
RAX: ffffffff8247102c RBX: ffff8880562dd180 RCX: ffff88807eb53e00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: dffffc0000000000 R08: ffff88801c2c10fb R09: 1ffff1100385821f
R10: dffffc0000000000 R11: ffffed1003858220 R12: 1ffff1100ac5ba3e
R13: ffff8880562dd1f0 R14: 0000000000008000 R15: 0000000000000000
init_file+0x9c/0x2b0 fs/file_table.c:185
alloc_empty_file+0x74/0x1d0 fs/file_table.c:266
path_openat+0x8f/0x3830 fs/namei.c:4849
do_file_open+0x23e/0x4a0 fs/namei.c:4892
do_sys_openat2+0x115/0x200 fs/open.c:1368
do_sys_open fs/open.c:1374 [inline]
__do_sys_openat fs/open.c:1390 [inline]
__se_sys_openat fs/open.c:1385 [inline]
__x64_sys_openat+0x138/0x170 fs/open.c:1385
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fdde2ca7407
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:00007fffb2c15a00 EFLAGS: 00000202 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fdde348e880 RCX: 00007fdde2ca7407
RDX: 0000000000080000 RSI: 00007fffb2c15b80 RDI: ffffffffffffff9c
RBP: 0000000000000008 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000556f298327f5
R13: 0000556f298327f5 R14: 0000000000000001 R15: 0000000000000000
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x20000082a pfn:0x599e3
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000
raw: 000000020000082a 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 0x140dc2(GFP_HIGHUSER|__GFP_ZERO|__GFP_COMP), pid 16898, tgid 16889 (syz.0.3480), ts 662391912651, free_ts 663562815632
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1859
prep_new_page mm/page_alloc.c:1867 [inline]
get_page_from_freelist+0x21fa/0x2270 mm/page_alloc.c:3946
__alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5304
alloc_pages_mpol+0x212/0x380 mm/mempolicy.c:2490
folio_alloc_mpol_noprof+0x39/0x160 mm/mempolicy.c:2509
vma_alloc_folio_noprof+0xe1/0x1e0 mm/mempolicy.c:2544
folio_prealloc mm/memory.c:-1 [inline]
alloc_anon_folio mm/memory.c:5247 [inline]
do_anonymous_page mm/memory.c:5342 [inline]
do_pte_missing+0x173a/0x34b0 mm/memory.c:4564
handle_pte_fault mm/memory.c:6379 [inline]
__handle_mm_fault mm/memory.c:6517 [inline]
handle_mm_fault+0x1b36/0x3080 mm/memory.c:6686
faultin_page mm/gup.c:1126 [inline]
__get_user_pages+0x1678/0x2720 mm/gup.c:1428
__get_user_pages_locked mm/gup.c:1692 [inline]
__gup_longterm_locked+0x3bc/0x15c0 mm/gup.c:2481
gup_fast_fallback+0x1d8c/0x20e0 mm/gup.c:3209
pfn_reader_user_pin+0xf2f/0x1340 drivers/iommu/iommufd/pages.c:932
iopt_pages_fill drivers/iommu/iommufd/pages.c:2158 [inline]
iopt_pages_fill_xarray+0x4db/0x1180 drivers/iommu/iommufd/pages.c:2225
iopt_area_add_access+0x210/0x4c0 drivers/iommu/iommufd/pages.c:2473
iommufd_access_pin_pages+0x71a/0xc50 drivers/iommu/iommufd/device.c:1455
iommufd_test_access_pages drivers/iommu/iommufd/selftest.c:1580 [inline]
iommufd_test+0x495c/0x6050 drivers/iommu/iommufd/selftest.c:2100
page last free pid 16892 tgid 16889 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1406 [inline]
free_unref_folios+0xd84/0x14a0 mm/page_alloc.c:3011
folios_put_refs+0x9e9/0xb30 mm/swap.c:1057
free_pages_and_swap_cache+0x2ba/0x490 mm/swap_state.c:586
__tlb_batch_free_encoded_pages mm/mmu_gather.c:138 [inline]
tlb_batch_pages_flush mm/mmu_gather.c:151 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:417 [inline]
tlb_flush_mmu+0x6d3/0xa30 mm/mmu_gather.c:424
zap_pte_range mm/memory.c:1973 [inline]
zap_pmd_range mm/memory.c:2020 [inline]
zap_pud_range mm/memory.c:2048 [inline]
zap_p4d_range mm/memory.c:2069 [inline]
__zap_vma_range+0x4130/0x4f10 mm/memory.c:2109
unmap_vmas+0x390/0x550 mm/memory.c:2178
exit_mmap+0x293/0x9f0 mm/mmap.c:1300
__mmput+0x118/0x420 kernel/fork.c:1187
exit_mm+0x221/0x2d0 kernel/exit.c:610
do_exit+0x6cd/0x2360 kernel/exit.c:992
do_group_exit+0x22d/0x2f0 kernel/exit.c:1147
get_signal+0x121b/0x12c0 kernel/signal.c:3038
arch_do_signal_or_restart+0xbb/0x860 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:66 [inline]
exit_to_user_mode_loop+0x104/0x730 kernel/entry/common.c:101
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
do_syscall_64+0x353/0x580 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff8880599e3e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8880599e3f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8880599e3f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8880599e4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8880599e4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 89 44 11 20 mov %eax,0x20(%rcx,%rdx,1)
4: c3 ret
5: cc int3
6: cc int3
7: cc int3
8: cc int3
9: cc int3
a: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1)
11: 00
12: 90 nop
13: 90 nop
14: 90 nop
15: 90 nop
16: 90 nop
17: 90 nop
18: 90 nop
19: 90 nop
1a: 90 nop
1b: 90 nop
1c: 90 nop
1d: 90 nop
1e: 90 nop
1f: 90 nop
20: 90 nop
21: 90 nop
22: f3 0f 1e fa endbr64
26: 48 8b 04 24 mov (%rsp),%rax
* 2a: 65 48 8b 15 78 09 a6 mov %gs:0x11a60978(%rip),%rdx # 0x11a609aa <-- trapping instruction
31: 11
32: 65 8b 0d 99 09 a6 11 mov %gs:0x11a60999(%rip),%ecx # 0x11a609d2
39: 81 e1 00 01 ff 00 and $0xff0100,%ecx
3f: 74 .byte 0x74