==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x110d/0x1140 drivers/hid/hid-mcp2221.c:975
Read of size 1 at addr ffff888119683fff by task syz.1.1687/10001
CPU: 1 UID: 0 PID: 10001 Comm: syz.1.1687 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/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+0xdb5/0x3840 drivers/usb/gadget/udc/dummy_hcd.c:2051
__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:__orc_find+0x8e/0xf0 arch/x86/kernel/unwind_orc.c:107
Code: 00 48 89 da 48 c1 ea 03 0f b6 34 0a 48 89 da 83 e2 07 83 c2 03 40 38 f2 7c 05 40 84 f6 75 4b 48 63 13 48 01 da 49 39 d5 73 af <4c> 8d 63 fc 49 39 ec 73 b2 4d 29 f7 49 c1 ff 02 4b 8d 14 7f 48 8d
RSP: 0018:ffffc90014e7f958 EFLAGS: 00000287
RAX: ffffffff8b74b6aa RBX: ffffffff8b1f73f0 RCX: dffffc0000000000
RDX: ffffffff810001cc RSI: 0000000000000000 RDI: ffffffff8b1f73b0
RBP: ffffffff8b1f73b0 R08: ffffffff8b74b776 R09: 0000000000000007
R10: 0000000000000200 R11: 0000000000000001 R12: ffffffff8b1f7434
R13: ffffffff8100012f R14: ffffffff8b1f73b0 R15: ffffffff8b1f73b0
orc_find arch/x86/kernel/unwind_orc.c:238 [inline]
unwind_next_frame+0x2ec/0x2090 arch/x86/kernel/unwind_orc.c:510
arch_stack_walk+0x94/0xf0 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x8e/0xc0 kernel/stacktrace.c:122
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:264 [inline]
__kasan_slab_free+0x43/0x70 mm/kasan/common.c:296
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2748 [inline]
slab_free mm/slub.c:6509 [inline]
kfree+0x20c/0x650 mm/slub.c:6802
raw_ioctl_ep_write drivers/usb/gadget/legacy/raw_gadget.c:1154 [inline]
raw_ioctl+0x265/0x2b80 drivers/usb/gadget/legacy/raw_gadget.c:1325
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
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:0x7fdc5083f1eb
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:00007fdc4f28df60 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000009 RCX: 00007fdc5083f1eb
RDX: 00007fdc4f28dfe0 RSI: 0000000040085507 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007fdc50bf0320 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000246 R12: 00002000000000c0
R13: 0000000000000000 R14: 00007fdc50ac5fa0 R15: 00007fff43a1afc8
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888119683c80 pfn:0x119683
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 dead000000000100 dead000000000122 0000000000000000
raw: ffff888119683c80 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 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4913, tgid 4913 (modprobe), ts 105238097216
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]
__pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774
alloc_from_pcs mm/slub.c:4850 [inline]
slab_alloc_node mm/slub.c:4984 [inline]
kmem_cache_alloc_noprof+0x471/0x650 mm/slub.c:5010
vm_area_alloc+0x1f/0x160 mm/vma_init.c:36
__mmap_new_vma mm/vma.c:2656 [inline]
__mmap_region+0xfcf/0x3130 mm/vma.c:2889
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
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
page last free pid 14 tgid 14 ts 150335610220 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
rcu_do_batch kernel/rcu/tree.c:2650 [inline]
rcu_core+0x5f0/0x1260 kernel/rcu/tree.c:2919
handle_softirqs+0x1d9/0x9b0 kernel/softirq.c:645
run_ksoftirqd kernel/softirq.c:1099 [inline]
run_ksoftirqd+0x38/0x60 kernel/softirq.c:1091
smpboot_thread_fn+0x3d3/0xab0 kernel/smpboot.c:160
kthread+0x373/0x450 kernel/kthread.c:436
ret_from_fork+0x69f/0xc90 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:
ffff888119683e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888119683f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888119683f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888119684000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888119684080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 48 89 da mov %rbx,%rdx
3: 48 c1 ea 03 shr $0x3,%rdx
7: 0f b6 34 0a movzbl (%rdx,%rcx,1),%esi
b: 48 89 da mov %rbx,%rdx
e: 83 e2 07 and $0x7,%edx
11: 83 c2 03 add $0x3,%edx
14: 40 38 f2 cmp %sil,%dl
17: 7c 05 jl 0x1e
19: 40 84 f6 test %sil,%sil
1c: 75 4b jne 0x69
1e: 48 63 13 movslq (%rbx),%rdx
21: 48 01 da add %rbx,%rdx
24: 49 39 d5 cmp %rdx,%r13
27: 73 af jae 0xffffffd8
* 29: 4c 8d 63 fc lea -0x4(%rbx),%r12 <-- trapping instruction
2d: 49 39 ec cmp %rbp,%r12
30: 73 b2 jae 0xffffffe4
32: 4d 29 f7 sub %r14,%r15
35: 49 c1 ff 02 sar $0x2,%r15
39: 4b 8d 14 7f lea (%r15,%r15,2),%rdx
3d: 48 rex.W
3e: 8d .byte 0x8d