==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0xf94/0x1030 drivers/hid/hid-mcp2221.c:854
Read of size 1 at addr ffff88805ae03fff by task syz.3.845/9438
CPU: 0 UID: 0 PID: 9438 Comm: syz.3.845 Not tainted 6.16.0-rc6-syzkaller-00002-g155a3c003e55 #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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/0x610 mm/kasan/report.c:480
kasan_report+0xe0/0x110 mm/kasan/report.c:593
mcp2221_raw_event+0xf94/0x1030 drivers/hid/hid-mcp2221.c:854
__hid_input_report.constprop.0+0x311/0x450 drivers/hid/hid-core.c:2117
hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x38d/0x6e0 drivers/usb/core/hcd.c:1650
usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1734
dummy_timer+0x180e/0x3a20 drivers/usb/gadget/udc/dummy_hcd.c:1995
__run_hrtimer kernel/time/hrtimer.c:1761 [inline]
__hrtimer_run_queues+0x1ff/0xad0 kernel/time/hrtimer.c:1825
hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1842
handle_softirqs+0x219/0x8e0 kernel/softirq.c:579
__do_softirq kernel/softirq.c:613 [inline]
invoke_softirq kernel/softirq.c:453 [inline]
__irq_exit_rcu+0x109/0x170 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+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1050
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:finish_task_switch.isra.0+0x22a/0xc10 kernel/sched/core.c:5265
Code: fb 09 00 00 44 8b 05 09 cc 1f 0f 45 85 c0 0f 85 be 01 00 00 4c 89 e7 e8 a4 f6 ff ff e8 df d5 39 00 fb 65 48 8b 1d be e2 46 12 <48> 8d bb 18 16 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1
RSP: 0018:ffffc9000389f0b0 EFLAGS: 00000202
RAX: 0000000000005715 RBX: ffff88807d822440 RCX: 0000000000000007
RDX: 0000000000000000 RSI: ffffffff8de32e47 RDI: ffffffff8c158f60
RBP: ffffc9000389f0f8 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff90a98757 R11: 0000000000000001 R12: ffff8880b843a2c0
R13: ffff88802c010000 R14: 0000000000000001 R15: ffff8880b843b130
context_switch kernel/sched/core.c:5400 [inline]
__schedule+0x1172/0x5de0 kernel/sched/core.c:6786
preempt_schedule_irq+0x51/0x90 kernel/sched/core.c:7109
irqentry_exit+0x36/0x90 kernel/entry/common.c:307
asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:709
RIP: 0010:cpuset_nodemask_valid_mems_allowed+0x0/0x80 kernel/cgroup/cpuset.c:4187
Code: 60 fc ff ff e8 71 49 6b 00 e9 19 ff ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 <66> 0f 1f 00 55 53 48 89 fb 65 48 8b 2d e7 4c 19 12 e8 4a 6f 04 00
RSP: 0018:ffffc9000389f390 EFLAGS: 00000283
RAX: 000000000005abf1 RBX: ffff88801ca902d8 RCX: ffffc9000e88d000
RDX: 0000000000080000 RSI: ffffffff821f41ae RDI: ffff88801ca902d8
RBP: ffff88801ca902d0 R08: 0000000000000004 R09: 0000000000000002
R10: 0000000000000002 R11: 1ffffffff1cb9fa9 R12: ffffc9000389f410
R13: 0000000000000002 R14: 0000000000440dc0 R15: 0000000000000002
policy_nodemask+0x436/0x4e0 mm/mempolicy.c:2216
alloc_pages_mpol+0x8e/0x550 mm/mempolicy.c:2380
alloc_frozen_pages_noprof mm/mempolicy.c:2490 [inline]
alloc_pages_noprof+0x131/0x390 mm/mempolicy.c:2510
pagetable_alloc_noprof include/linux/mm.h:2867 [inline]
__pte_alloc_one_noprof include/asm-generic/pgalloc.h:75 [inline]
pte_alloc_one+0x1c/0x3a0 arch/x86/mm/pgtable.c:18
__pte_alloc+0x6d/0x3c0 mm/memory.c:441
do_anonymous_page mm/memory.c:5039 [inline]
do_pte_missing mm/memory.c:4249 [inline]
handle_pte_fault mm/memory.c:6069 [inline]
__handle_mm_fault+0x4358/0x5490 mm/memory.c:6212
handle_mm_fault+0x589/0xd10 mm/memory.c:6381
faultin_page mm/gup.c:1186 [inline]
__get_user_pages+0x589/0x3b80 mm/gup.c:1488
__get_user_pages_locked mm/gup.c:1754 [inline]
__gup_longterm_locked+0x20d/0x1840 mm/gup.c:2512
pin_user_pages_remote+0xed/0x140 mm/gup.c:3506
process_vm_rw_single_vec mm/process_vm_access.c:106 [inline]
process_vm_rw_core.constprop.0+0x41b/0x9a0 mm/process_vm_access.c:216
process_vm_rw+0x2ff/0x360 mm/process_vm_access.c:284
__do_sys_process_vm_readv mm/process_vm_access.c:296 [inline]
__se_sys_process_vm_readv mm/process_vm_access.c:292 [inline]
__x64_sys_process_vm_readv+0xe2/0x1c0 mm/process_vm_access.c:292
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcbb298e929
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fcbb376c038 EFLAGS: 00000246 ORIG_RAX: 0000000000000136
RAX: ffffffffffffffda RBX: 00007fcbb2bb6080 RCX: 00007fcbb298e929
RDX: 0000000000000002 RSI: 0000200000008400 RDI: 0000000000000285
RBP: 00007fcbb2a10b39 R08: 0000000000000286 R09: 0000000000000000
R10: 0000200000008640 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fcbb2bb6080 R15: 00007ffd1ab98b98
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5ae03
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 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 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 8953, tgid 8944 (syz.4.756), ts 397015690004, free_ts 418042003536
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1704
prep_new_page mm/page_alloc.c:1712 [inline]
get_page_from_freelist+0x1321/0x3890 mm/page_alloc.c:3669
__alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:4959
alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2419
alloc_slab_page mm/slub.c:2451 [inline]
allocate_slab mm/slub.c:2619 [inline]
new_slab+0x23b/0x330 mm/slub.c:2673
___slab_alloc+0xd9c/0x1940 mm/slub.c:3859
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3949
__slab_alloc_node mm/slub.c:4024 [inline]
slab_alloc_node mm/slub.c:4185 [inline]
kmem_cache_alloc_node_noprof+0xf5/0x3b0 mm/slub.c:4249
kmalloc_reserve+0x18b/0x2c0 net/core/skbuff.c:579
__alloc_skb+0x166/0x380 net/core/skbuff.c:670
alloc_skb_fclone include/linux/skbuff.h:1386 [inline]
tcp_stream_alloc_skb+0x34/0x570 net/ipv4/tcp.c:894
tcp_sendmsg_locked+0x12d7/0x42b0 net/ipv4/tcp.c:1200
tcp_sendmsg+0x2e/0x50 net/ipv4/tcp.c:1396
inet_sendmsg+0xb9/0x140 net/ipv4/af_inet.c:851
sock_sendmsg_nosec net/socket.c:712 [inline]
__sock_sendmsg net/socket.c:727 [inline]
__sys_sendto+0x43c/0x520 net/socket.c:2180
__do_sys_sendto net/socket.c:2187 [inline]
__se_sys_sendto net/socket.c:2183 [inline]
__x64_sys_sendto+0xe0/0x1c0 net/socket.c:2183
page last free pid 9251 tgid 9251 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1248 [inline]
__free_frozen_pages+0x7fe/0x1180 mm/page_alloc.c:2706
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+0x69/0x90 mm/kasan/common.c:329
kasan_slab_alloc include/linux/kasan.h:250 [inline]
slab_post_alloc_hook mm/slub.c:4148 [inline]
slab_alloc_node mm/slub.c:4197 [inline]
kmem_cache_alloc_noprof+0x1cb/0x3b0 mm/slub.c:4204
mt_alloc_one lib/maple_tree.c:176 [inline]
mas_alloc_nodes+0x18b/0x8b0 lib/maple_tree.c:1249
mas_node_count_gfp+0x105/0x130 lib/maple_tree.c:1331
mas_preallocate+0x7e0/0xde0 lib/maple_tree.c:5534
vma_iter_prealloc mm/vma.h:463 [inline]
commit_merge+0x2a8/0x1030 mm/vma.c:750
vma_expand+0x3c1/0x910 mm/vma.c:1153
vma_merge_new_range+0x2c0/0xa00 mm/vma.c:1091
__mmap_region+0x7f1/0x25e0 mm/vma.c:2617
mmap_region+0x1ab/0x3f0 mm/vma.c:2692
do_mmap+0xa3e/0x1210 mm/mmap.c:561
vm_mmap_pgoff+0x281/0x450 mm/util.c:579
ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:607
Memory state around the buggy address:
ffff88805ae03e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88805ae03f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88805ae03f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88805ae04000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88805ae04080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess), 2 bytes skipped:
0: 00 00 add %al,(%rax)
2: 44 8b 05 09 cc 1f 0f mov 0xf1fcc09(%rip),%r8d # 0xf1fcc12
9: 45 85 c0 test %r8d,%r8d
c: 0f 85 be 01 00 00 jne 0x1d0
12: 4c 89 e7 mov %r12,%rdi
15: e8 a4 f6 ff ff call 0xfffff6be
1a: e8 df d5 39 00 call 0x39d5fe
1f: fb sti
20: 65 48 8b 1d be e2 46 mov %gs:0x1246e2be(%rip),%rbx # 0x1246e2e6
27: 12
* 28: 48 8d bb 18 16 00 00 lea 0x1618(%rbx),%rdi <-- trapping instruction
2f: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
36: fc ff df
39: 48 89 fa mov %rdi,%rdx
3c: 48 rex.W
3d: c1 .byte 0xc1