==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:957
Read of size 1 at addr ffff888142d83fff by task klogd/2845
CPU: 1 UID: 0 PID: 2845 Comm: klogd Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/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/0x1d0 mm/kasan/report.c:595
mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:957
__hid_input_report.constprop.0+0x314/0x460 drivers/hid/hid-core.c:2147
hid_irq_in+0x52e/0x6b0 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x38d/0x610 drivers/usb/core/hcd.c:1657
usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741
dummy_timer+0xda1/0x36c0 drivers/usb/gadget/udc/dummy_hcd.c:2005
__run_hrtimer kernel/time/hrtimer.c:1930 [inline]
__hrtimer_run_queues+0x470/0xa00 kernel/time/hrtimer.c:1994
hrtimer_run_softirq+0x17d/0x2c0 kernel/time/hrtimer.c:2011
handle_softirqs+0x1dd/0x9e0 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0x160/0x210 kernel/softirq.c:735
irq_exit_rcu+0x9/0x30 kernel/softirq.c:752
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1061 [inline]
sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1061
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:format_decode+0x745/0xcd0 lib/vsprintf.c:2698
Code: 00 44 0f b6 3b bf 09 00 00 00 41 83 ef 30 44 89 fe e8 ff 86 48 fa 41 83 ff 09 76 8d e8 44 8c 48 fa 45 89 65 04 e9 de fb ff ff 36 8c 48 fa 4d 39 f4 0f 85 40 fa ff ff e8 28 8c 48 fa 31 f6 31
RSP: 0018:ffffc9000166f7d0 EFLAGS: 00000246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff876a3c2b
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff888116af3b80
RBP: ffffc9000166f870 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 000000000068b958 R12: ffffffff878ad2e4
R13: ffffc9000166f900 R14: ffffffff878ad2e3 R15: dffffc0000000000
vsnprintf+0x1c0/0x1240 lib/vsprintf.c:2890
sprintf+0xcc/0x100 lib/vsprintf.c:3111
print_syslog kernel/printk/printk.c:1352 [inline]
info_print_prefix+0x2e4/0x350 kernel/printk/printk.c:1382
record_print_text+0x143/0x3c0 kernel/printk/printk.c:1434
syslog_print+0x46c/0x620 kernel/printk/printk.c:1645
do_syslog+0x5bd/0x6d0 kernel/printk/printk.c:1763
__do_sys_syslog kernel/printk/printk.c:1855 [inline]
__se_sys_syslog kernel/printk/printk.c:1853 [inline]
__x64_sys_syslog+0x74/0xb0 kernel/printk/printk.c:1853
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x10b/0x7f0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f024da42a37
Code: 73 01 c3 48 8b 0d c1 f3 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 67 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 91 f3 0c 00 f7 d8 64 89 01 48
RSP: 002b:00007ffef8b20598 EFLAGS: 00000206 ORIG_RAX: 0000000000000067
RAX: ffffffffffffffda RBX: 00007f024dbe2490 RCX: 00007f024da42a37
RDX: 00000000000003ff RSI: 00007f024dbe2490 RDI: 0000000000000002
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000004000 R11: 0000000000000206 R12: 00007f024dbe2490
R13: 00007f024dbbfdfe R14: 00007f024dbe24e5 R15: 00007f024dbe24e5
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888100000000 pfn:0x142d83
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 dead000000000100 dead000000000122 0000000000000000
raw: ffff888100000000 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 0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO|__GFP_COMP), pid 5232, tgid 5232 (udevd), ts 1047872975554, free_ts 1047999497457
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x153/0x170 mm/page_alloc.c:1858
prep_new_page mm/page_alloc.c:1866 [inline]
get_page_from_freelist+0xf34/0x3a90 mm/page_alloc.c:3946
__alloc_frozen_pages_noprof+0x273/0x28a0 mm/page_alloc.c:5226
alloc_pages_mpol+0xe8/0x410 mm/mempolicy.c:2490
alloc_pages_noprof+0x1a/0x160 mm/mempolicy.c:2581
pagetable_alloc_noprof include/linux/mm.h:3651 [inline]
__pte_alloc_one_noprof include/asm-generic/pgalloc.h:76 [inline]
pte_alloc_one+0x1c/0x3d0 arch/x86/mm/pgtable.c:18
__pte_alloc+0x6d/0x380 mm/memory.c:453
copy_pte_range mm/memory.c:1237 [inline]
copy_pmd_range mm/memory.c:1392 [inline]
copy_pud_range mm/memory.c:1429 [inline]
copy_p4d_range mm/memory.c:1453 [inline]
copy_page_range+0x2d02/0x5740 mm/memory.c:1539
dup_mmap+0xcb9/0x1f30 mm/mmap.c:1840
dup_mm kernel/fork.c:1534 [inline]
copy_mm kernel/fork.c:1586 [inline]
copy_process+0x4928/0x7c70 kernel/fork.c:2264
kernel_clone+0x12e/0x9c0 kernel/fork.c:2721
__do_sys_clone+0xd9/0x120 kernel/fork.c:2862
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x10b/0x7f0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 14 tgid 14 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1402 [inline]
__free_frozen_pages+0x692/0xf10 mm/page_alloc.c:2943
__pagetable_free include/linux/mm.h:3661 [inline]
pagetable_free include/linux/mm.h:3685 [inline]
pagetable_dtor_free include/linux/mm.h:3784 [inline]
__tlb_remove_table include/asm-generic/tlb.h:221 [inline]
__tlb_remove_table_free mm/mmu_gather.c:228 [inline]
tlb_remove_table_rcu+0x2cf/0x380 mm/mmu_gather.c:291
rcu_do_batch kernel/rcu/tree.c:2617 [inline]
rcu_core+0x5a2/0x10d0 kernel/rcu/tree.c:2869
handle_softirqs+0x1dd/0x9e0 kernel/softirq.c:622
run_ksoftirqd kernel/softirq.c:1076 [inline]
run_ksoftirqd+0x38/0x60 kernel/softirq.c:1068
smpboot_thread_fn+0x3d3/0xaa0 kernel/smpboot.c:160
kthread+0x370/0x450 kernel/kthread.c:436
ret_from_fork+0x69a/0xc80 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:
ffff888142d83e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888142d83f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888142d83f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888142d84000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888142d84080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 00 44 0f b6 add %al,-0x4a(%rdi,%rcx,1)
4: 3b bf 09 00 00 00 cmp 0x9(%rdi),%edi
a: 41 83 ef 30 sub $0x30,%r15d
e: 44 89 fe mov %r15d,%esi
11: e8 ff 86 48 fa call 0xfa488715
16: 41 83 ff 09 cmp $0x9,%r15d
1a: 76 8d jbe 0xffffffa9
1c: e8 44 8c 48 fa call 0xfa488c65
21: 45 89 65 04 mov %r12d,0x4(%r13)
25: e9 de fb ff ff jmp 0xfffffc08
* 2a: e8 36 8c 48 fa call 0xfa488c65 <-- trapping instruction
2f: 4d 39 f4 cmp %r14,%r12
32: 0f 85 40 fa ff ff jne 0xfffffa78
38: e8 28 8c 48 fa call 0xfa488c65
3d: 31 f6 xor %esi,%esi
3f: 31 .byte 0x31