==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0xf94/0x1030 drivers/hid/hid-mcp2221.c:944
Read of size 1 at addr ffff88813b09bfff by task udevd/5220
CPU: 0 UID: 0 PID: 5220 Comm: udevd Not tainted syzkaller #0 PREEMPT(voluntary)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xcd/0x630 mm/kasan/report.c:482
kasan_report+0xe0/0x110 mm/kasan/report.c:595
mcp2221_raw_event+0xf94/0x1030 drivers/hid/hid-mcp2221.c:944
__hid_input_report.constprop.0+0x314/0x450 drivers/hid/hid-core.c:2130
hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x38a/0x6e0 drivers/usb/core/hcd.c:1663
usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1747
dummy_timer+0x1814/0x3a30 drivers/usb/gadget/udc/dummy_hcd.c:1995
__run_hrtimer kernel/time/hrtimer.c:1761 [inline]
__hrtimer_run_queues+0x202/0xad0 kernel/time/hrtimer.c:1825
hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1842
handle_softirqs+0x208/0x8d0 kernel/softirq.c:579
__do_softirq kernel/softirq.c:613 [inline]
invoke_softirq kernel/softirq.c:453 [inline]
__irq_exit_rcu+0xfa/0x160 kernel/softirq.c:680
irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline]
sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1050
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:194
Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 e6 9b 1a fa 48 89 df e8 ce ef 1a fa f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 35 48 0e fa 65 8b 05 3e 6a 52 05 85 c0 74 16 5b
RSP: 0018:ffffc900021cfb98 EFLAGS: 00000246
RAX: 0000000000000006 RBX: ffff888100ac50c8 RCX: 0000000000000006
RDX: 0000000000000000 RSI: ffffffff88d26cfa RDI: ffffffff87896360
RBP: 0000000000000246 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff8a9d65d7 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000246 R14: 0000000000000000 R15: 0000000000000000
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
__wake_up_common_lock kernel/sched/wait.c:127 [inline]
__wake_up+0x3f/0x60 kernel/sched/wait.c:146
kernfs_put_active fs/kernfs/dir.c:478 [inline]
kernfs_put_active+0xcc/0xe0 fs/kernfs/dir.c:465
kernfs_seq_stop_active fs/kernfs/file.c:142 [inline]
kernfs_seq_stop+0xcd/0x120 fs/kernfs/file.c:195
seq_read_iter+0xc80/0x12c0 fs/seq_file.c:280
kernfs_fop_read_iter+0x40f/0x5a0 fs/kernfs/file.c:279
new_sync_read fs/read_write.c:491 [inline]
vfs_read+0x8bc/0xcf0 fs/read_write.c:572
ksys_read+0x12a/0x250 fs/read_write.c:715
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0x4b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f0c1f421407
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:00007ffe409fad10 EFLAGS: 00000202 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007f0c1f333880 RCX: 00007f0c1f421407
RDX: 0000000000001000 RSI: 00007ffe409fb1f0 RDI: 0000000000000008
RBP: 0000000000000008 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 000055dba89e55b0
R13: 00007ffe409fadf0 R14: 00007ffe409fb1f0 R15: 000055db8d44dbcc
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13b09b
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 0000000000000000 00000000ffffffff 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 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 26050, tgid 26050 (modprobe), ts 2477289098702, free_ts 2585478614197
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851
prep_new_page mm/page_alloc.c:1859 [inline]
get_page_from_freelist+0xf98/0x2ce0 mm/page_alloc.c:3858
__alloc_frozen_pages_noprof+0x259/0x21e0 mm/page_alloc.c:5148
alloc_pages_mpol+0xe4/0x410 mm/mempolicy.c:2416
alloc_slab_page mm/slub.c:2487 [inline]
allocate_slab mm/slub.c:2655 [inline]
new_slab+0x247/0x330 mm/slub.c:2709
___slab_alloc+0xc78/0x1680 mm/slub.c:3891
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3981
__slab_alloc_node mm/slub.c:4056 [inline]
slab_alloc_node mm/slub.c:4217 [inline]
kmem_cache_alloc_noprof+0x1f9/0x3b0 mm/slub.c:4236
mt_alloc_one lib/maple_tree.c:176 [inline]
mas_alloc_nodes+0x18b/0x8b0 lib/maple_tree.c:1255
mas_node_count_gfp+0x105/0x130 lib/maple_tree.c:1337
mas_preallocate+0x7e0/0xde0 lib/maple_tree.c:5537
vma_iter_prealloc mm/vma.h:462 [inline]
__mmap_new_vma mm/vma.c:2470 [inline]
__mmap_region+0x10be/0x25d0 mm/vma.c:2669
mmap_region+0x1ab/0x3f0 mm/vma.c:2739
do_mmap+0xa2e/0x11f0 mm/mmap.c:558
vm_mmap_pgoff+0x201/0x390 mm/util.c:580
ksys_mmap_pgoff+0x7d/0x5c0 mm/mmap.c:604
page last free pid 21195 tgid 21195 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
__free_frozen_pages+0x78a/0xfd0 mm/page_alloc.c:2895
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4d/0x120 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x4e/0x70 mm/kasan/common.c:340
kasan_slab_alloc include/linux/kasan.h:250 [inline]
slab_post_alloc_hook mm/slub.c:4180 [inline]
slab_alloc_node mm/slub.c:4229 [inline]
__kmalloc_cache_noprof+0x14c/0x3c0 mm/slub.c:4391
kmalloc_noprof include/linux/slab.h:905 [inline]
usb_control_msg+0xbc/0x4a0 drivers/usb/core/message.c:144
set_port_feature drivers/usb/core/hub.c:470 [inline]
hub_port_reset+0x2a6/0x1e00 drivers/usb/core/hub.c:3082
hub_port_init+0x1f9/0x3b50 drivers/usb/core/hub.c:4938
hub_port_connect drivers/usb/core/hub.c:5495 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5706 [inline]
port_event drivers/usb/core/hub.c:5870 [inline]
hub_event+0x2d84/0x5060 drivers/usb/core/hub.c:5952
process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3236
process_scheduled_works kernel/workqueue.c:3319 [inline]
worker_thread+0x6c8/0xf10 kernel/workqueue.c:3400
kthread+0x3c2/0x780 kernel/kthread.c:463
ret_from_fork+0x5b6/0x6c0 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Memory state around the buggy address:
ffff88813b09be80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88813b09bf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88813b09bf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88813b09c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88813b09c080: 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 e6 9b 1a fa call 0xfa1a9bf9
13: 48 89 df mov %rbx,%rdi
16: e8 ce ef 1a fa call 0xfa1aefe9
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 35 48 0e fa call 0xfa0e4869
34: 65 8b 05 3e 6a 52 05 mov %gs:0x5526a3e(%rip),%eax # 0x5526a79
3b: 85 c0 test %eax,%eax
3d: 74 16 je 0x55
3f: 5b pop %rbx