==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x103c/0x10a0 drivers/hid/hid-mcp2221.c:957
Read of size 1 at addr ffff8881359a7fff by task syz.2.857/9480
CPU: 0 UID: 0 PID: 9480 Comm: syz.2.857 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:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:179 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:198
Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 b6 43 1f fa 48 89 df e8 8e 93 1f fa f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 f5 d0 12 fa 65 8b 05 4e aa 87 05 85 c0 74 16 5b
RSP: 0018:ffffc900154e7c48 EFLAGS: 00000246
RAX: 0000000000000006 RBX: ffff8881f5628140 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff890c4e9f RDI: ffffffff87b04160
RBP: 0000000000000246 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff888112cd9dc0
R13: fffff52002a9cfb5 R14: dffffc0000000000 R15: 0000000000000001
hrtimer_start_expires include/linux/hrtimer.h:234 [inline]
hrtimer_sleeper_start_expires kernel/time/hrtimer.c:2216 [inline]
do_nanosleep+0x13c/0x570 kernel/time/hrtimer.c:2290
hrtimer_nanosleep+0x14f/0x350 kernel/time/hrtimer.c:2339
common_nsleep+0xa1/0xd0 kernel/time/posix-timers.c:1345
__do_sys_clock_nanosleep kernel/time/posix-timers.c:1391 [inline]
__se_sys_clock_nanosleep kernel/time/posix-timers.c:1368 [inline]
__x64_sys_clock_nanosleep+0x336/0x480 kernel/time/posix-timers.c:1368
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:0x7f5cfeb3d60e
Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08
RSP: 002b:00007f5cfd5cdf38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e6
RAX: ffffffffffffffda RBX: 00007f5cfd5cf6c0 RCX: 00007f5cfeb3d60e
RDX: 00007f5cfd5cdf90 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000140
R13: 0000000000000000 R14: 00007f5cfedf5fa0 R15: 00007fff0b09da58
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8881359a7000 pfn:0x1359a7
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 dead000000000100 dead000000000122 0000000000000000
raw: ffff8881359a7000 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 3331, tgid 3331 (modprobe), ts 61395229611, free_ts 138993778188
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_slab_page mm/slub.c:3278 [inline]
allocate_slab mm/slub.c:3467 [inline]
new_slab+0xa6/0x6b0 mm/slub.c:3525
refill_objects+0x277/0x420 mm/slub.c:7251
refill_sheaf mm/slub.c:2816 [inline]
__pcs_replace_empty_main+0x375/0x650 mm/slub.c:4651
alloc_from_pcs mm/slub.c:4749 [inline]
slab_alloc_node mm/slub.c:4883 [inline]
kmem_cache_alloc_noprof+0x520/0x6a0 mm/slub.c:4905
vm_area_alloc+0x1f/0x160 mm/vma_init.c:32
__mmap_new_vma mm/vma.c:2547 [inline]
__mmap_region+0xfcd/0x2a20 mm/vma.c:2771
mmap_region+0x35d/0x620 mm/vma.c:2856
do_mmap+0xc53/0x12d0 mm/mmap.c:560
vm_mmap_pgoff+0x201/0x390 mm/util.c:581
ksys_mmap_pgoff+0x3cb/0x610 mm/mmap.c:606
__do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline]
__se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline]
__x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82
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 0 tgid 0 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
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
__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
Memory state around the buggy address:
ffff8881359a7e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881359a7f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881359a7f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881359a8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8881359a8080: 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 43 1f fa call 0xfa1f43c9
13: 48 89 df mov %rbx,%rdi
16: e8 8e 93 1f fa call 0xfa1f93a9
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 f5 d0 12 fa call 0xfa12d129
34: 65 8b 05 4e aa 87 05 mov %gs:0x587aa4e(%rip),%eax # 0x587aa89
3b: 85 c0 test %eax,%eax
3d: 74 16 je 0x55
3f: 5b pop %rbx