==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x110d/0x1140 drivers/hid/hid-mcp2221.c:975
Read of size 1 at addr ffff88812523ffff by task sed/5553
CPU: 1 UID: 0 PID: 5553 Comm: sed Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/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/0x1c0 mm/kasan/report.c:595
mcp2221_raw_event+0x110d/0x1140 drivers/hid/hid-mcp2221.c:975
__hid_input_report.constprop.0+0x319/0x470 drivers/hid/hid-core.c:2175
hid_irq_in+0x55d/0x710 drivers/hid/usbhid/hid-core.c:287
__usb_hcd_giveback_urb+0x38e/0x610 drivers/usb/core/hcd.c:1657
usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741
dummy_timer+0xdaf/0x3820 drivers/usb/gadget/udc/dummy_hcd.c:2023
__run_hrtimer kernel/time/hrtimer.c:2074 [inline]
__hrtimer_run_queues+0x462/0x9c0 kernel/time/hrtimer.c:2131
hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2148
handle_softirqs+0x1d9/0x9b0 kernel/softirq.c:645
__do_softirq kernel/softirq.c:679 [inline]
invoke_softirq kernel/softirq.c:519 [inline]
__irq_exit_rcu+0x168/0x210 kernel/softirq.c:758
irq_exit_rcu+0x9/0x30 kernel/softirq.c:775
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1062
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:211 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:221
Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 b6 67 04 fa 48 89 df e8 3e be 04 fa f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 75 02 f7 f9 65 48 83 3d b4 fe 97 05 00 74 16 5b
RSP: 0018:ffffc90001cd77e8 EFLAGS: 00000246
RAX: 0000000000000002 RBX: ffffffff9440a460 RCX: 0000000000000040
RDX: 0000000000000001 RSI: ffffffff892df159 RDI: ffffffff87d2bd80
RBP: 0000000000000202 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000001
R13: ffff888124b1cd40 R14: dffffc0000000000 R15: 1ffff9200039af04
debug_object_activate+0x343/0x4b0 lib/debugobjects.c:891
debug_rcu_head_queue kernel/rcu/rcu.h:245 [inline]
__call_rcu_common.constprop.0+0x35/0x9b0 kernel/rcu/tree.c:3166
slab_free_hook mm/slub.c:2712 [inline]
slab_free mm/slub.c:6509 [inline]
kmem_cache_free+0x41c/0x650 mm/slub.c:6636
anon_vma_free mm/rmap.c:137 [inline]
__put_anon_vma+0x114/0x3a0 mm/rmap.c:2974
put_anon_vma mm/internal.h:290 [inline]
unlink_anon_vmas+0x5e4/0x8d0 mm/rmap.c:540
free_pgtables+0x2e7/0xd80 mm/memory.c:414
exit_mmap+0x44c/0xa00 mm/mmap.c:1327
__mmput kernel/fork.c:1193 [inline]
mmput+0xe0/0x430 kernel/fork.c:1216
exit_mm kernel/exit.c:592 [inline]
do_exit+0x83b/0x2a50 kernel/exit.c:974
do_group_exit+0xd5/0x2a0 kernel/exit.c:1129
__do_sys_exit_group kernel/exit.c:1140 [inline]
__se_sys_exit_group kernel/exit.c:1138 [inline]
__x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1138
x64_sys_call+0x1567/0x1570 arch/x86/include/generated/asm/syscalls_64.h:232
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f591e9da6c5
Code: Unable to access opcode bytes at 0x7f591e9da69b.
RSP: 002b:00007ffe43dc0f58 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007f591eadbfe8 RCX: 00007f591e9da6c5
RDX: 00000000000000e7 RSI: ffffffffffffff88 RDI: 0000000000000000
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f591eada680 R15: 00007f591eadc000
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x7f00b14c5 pfn:0x12523f
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 0000000000000000 00000000ffffffff 0000000000000000
raw: 00000007f00b14c5 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3913, tgid 3913 (modprobe), ts 56868497994
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871
prep_new_page mm/page_alloc.c:1879 [inline]
get_page_from_freelist+0xf4b/0x3440 mm/page_alloc.c:3943
__alloc_frozen_pages_noprof+0x2d7/0x2f70 mm/page_alloc.c:5436
alloc_slab_page mm/slub.c:3347 [inline]
allocate_slab mm/slub.c:3462 [inline]
new_slab+0xa9/0x6e0 mm/slub.c:3513
refill_objects+0xe3/0x410 mm/slub.c:7418
refill_sheaf mm/slub.c:2885 [inline]
__prefill_sheaf_pfmemalloc+0x5f/0xb0 mm/slub.c:5086
kmem_cache_prefill_sheaf+0x1bd/0x450 mm/slub.c:5174
mt_get_sheaf lib/maple_tree.c:154 [inline]
mas_alloc_nodes lib/maple_tree.c:1116 [inline]
mas_preallocate+0x65a/0xee0 lib/maple_tree.c:5057
vma_iter_prealloc mm/vma.h:665 [inline]
__split_vma+0x2f8/0x1db0 mm/vma.c:573
vms_gather_munmap_vmas+0x3a5/0x1670 mm/vma.c:1528
__mmap_setup mm/vma.c:2546 [inline]
__mmap_region+0x4c9/0x3130 mm/vma.c:2869
mmap_region+0x3db/0x6d0 mm/vma.c:2974
do_mmap+0x12b6/0x1c10 mm/mmap.c:573
vm_mmap_pgoff+0x1f0/0x390 mm/util.c:581
ksys_mmap_pgoff+0x3cb/0x610 mm/mmap.c:619
__do_sys_mmap arch/x86/kernel/sys_x86_64.c:96 [inline]
__se_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline]
__x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:89
page last free pid 5213 tgid 5213 ts 88688406190 stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
__free_pages_prepare mm/page_alloc.c:1418 [inline]
__free_frozen_pages+0x714/0xfc0 mm/page_alloc.c:2962
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x4e/0x70 mm/kasan/common.c:361
kasan_slab_alloc include/linux/kasan.h:253 [inline]
slab_post_alloc_hook mm/slub.c:4683 [inline]
slab_alloc_node mm/slub.c:4996 [inline]
__do_kmalloc_node mm/slub.c:5413 [inline]
__kvmalloc_node_noprof+0x2f7/0x950 mm/slub.c:7015
seq_buf_alloc fs/seq_file.c:39 [inline]
seq_read_iter+0x819/0x1270 fs/seq_file.c:211
kernfs_fop_read_iter+0x46c/0x610 fs/kernfs/file.c:290
new_sync_read fs/read_write.c:493 [inline]
vfs_read+0x82e/0xb40 fs/read_write.c:574
ksys_read+0x12a/0x250 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x119/0x710 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88812523fe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88812523ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88812523ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888125240000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888125240080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: f5 cmc
1: 53 push %rbx
2: 48 8b 74 24 10 mov 0x10(%rsp),%rsi
7: 48 89 fb mov %rdi,%rbx
a: 48 83 c7 18 add $0x18,%rdi
e: e8 b6 67 04 fa call 0xfa0467c9
13: 48 89 df mov %rbx,%rdi
16: e8 3e be 04 fa call 0xfa04be59
1b: f7 c5 00 02 00 00 test $0x200,%ebp
21: 75 23 jne 0x46
23: 9c pushf
24: 58 pop %rax
25: f6 c4 02 test $0x2,%ah
28: 75 37 jne 0x61
* 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction
2f: e8 75 02 f7 f9 call 0xf9f702a9
34: 65 48 83 3d b4 fe 97 cmpq $0x0,%gs:0x597feb4(%rip) # 0x597fef1
3b: 05 00
3d: 74 16 je 0x55
3f: 5b pop %rbx