==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x10b0/0x12a0 drivers/hid/hid-mcp2221.c:964
Read of size 1 at addr ffff8880589bbfff by task syz.0.4192/22200
CPU: 1 UID: 0 PID: 22200 Comm: syz.0.4192 Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Call Trace:
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_address_description+0x55/0x1e0 mm/kasan/report.c:378
print_report+0x58/0x70 mm/kasan/report.c:482
kasan_report+0x117/0x150 mm/kasan/report.c:595
mcp2221_raw_event+0x10b0/0x12a0 drivers/hid/hid-mcp2221.c:964
__hid_input_report+0x41c/0x580 drivers/hid/hid-core.c:2161
hid_irq_in+0x492/0x710 drivers/hid/usbhid/hid-core.c:287
__usb_hcd_giveback_urb+0x374/0x530 drivers/usb/core/hcd.c:1657
dummy_timer+0xac3/0x4b40 drivers/usb/gadget/udc/dummy_hcd.c:2005
__run_hrtimer kernel/time/hrtimer.c:2032 [inline]
__hrtimer_run_queues+0x3bc/0xa10 kernel/time/hrtimer.c:2096
hrtimer_run_softirq+0x17a/0x240 kernel/time/hrtimer.c:2113
handle_softirqs+0x225/0x840 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0xca/0x220 kernel/softirq.c:735
irq_exit_rcu+0x9/0x30 kernel/softirq.c:752
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1062
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
RIP: 0010:__wait_for_common+0xb0/0x670 kernel/sched/completion.c:120
Code: 31 48 89 4c 24 18 42 c7 44 31 08 f3 f3 f3 f3 48 c7 c7 0e 69 2e 8e be 74 00 00 00 e8 3a 74 c5 f5 2e 2e 2e 31 c0 49 8d 7c 24 08 <48> 89 7c 24 68 e8 56 51 01 00 4c 89 e0 48 c1 e8 03 48 89 44 24 28
RSP: 0018:ffffc900066ff8c0 EFLAGS: 00000246
RAX: 0000000000000000 RBX: ffff888022b740e0 RCX: 0000000000000046
RDX: 0000000000000000 RSI: ffffffff8e4aeb49 RDI: ffffc900066ffaa8
RBP: ffffc900066ffa08 R08: ffffffff90576ff7 R09: 1ffffffff20aedfe
R10: dffffc0000000000 R11: fffffbfff20aedff R12: ffffc900066ffaa0
R13: 0000000000000001 R14: dffffc0000000000 R15: ffffc900066ffaa0
wait_for_common kernel/sched/completion.c:132 [inline]
wait_for_completion_interruptible+0x1f/0x40 kernel/sched/completion.c:221
raw_process_ep_io+0x609/0xd80 drivers/usb/gadget/legacy/raw_gadget.c:1122
raw_ioctl_ep_write drivers/usb/gadget/legacy/raw_gadget.c:1153 [inline]
raw_ioctl+0x251c/0x41c0 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+0xfc/0x170 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fef6639daeb
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:00007fef671f6f60 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fef6639daeb
RDX: 00007fef671f6fe0 RSI: 0000000040085507 RDI: 0000000000000005
RBP: 0000000000000005 R08: 00007fef66750320 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000246 R12: 00002000000006c0
R13: 0000000000000000 R14: 00007fef66625fa0 R15: 00007fef6674fa48
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xaaacb pfn:0x589bb
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea0001626e88 ffffea0001208e08 0000000000000000
raw: 00000000000aaacb 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 0x152c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 21996, tgid 21987 (syz.8.4130), ts 1240556160460, free_ts 1242561913415
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1859
prep_new_page mm/page_alloc.c:1867 [inline]
get_page_from_freelist+0x21fa/0x2270 mm/page_alloc.c:3946
__alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5304
alloc_pages_mpol+0x212/0x380 mm/mempolicy.c:2490
alloc_frozen_pages_noprof mm/mempolicy.c:2561 [inline]
alloc_pages_noprof+0xac/0x2a0 mm/mempolicy.c:2581
folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2591
filemap_alloc_folio_noprof+0x111/0x470 mm/filemap.c:1013
ractl_alloc_folio mm/readahead.c:200 [inline]
ra_alloc_folio mm/readahead.c:463 [inline]
page_cache_ra_order+0x569/0xee0 mm/readahead.c:535
do_sync_mmap_readahead+0x75e/0x990 mm/filemap.c:3428
filemap_fault+0x7d9/0x13b0 mm/filemap.c:3582
__do_fault+0x138/0x2a0 mm/memory.c:5425
do_cow_fault mm/memory.c:5890 [inline]
do_fault mm/memory.c:5996 [inline]
do_pte_missing+0x1032/0x34b0 mm/memory.c:4566
handle_pte_fault mm/memory.c:6379 [inline]
__handle_mm_fault mm/memory.c:6517 [inline]
handle_mm_fault+0x1b36/0x3080 mm/memory.c:6686
faultin_page mm/gup.c:1126 [inline]
__get_user_pages+0x1678/0x2720 mm/gup.c:1428
populate_vma_page_range+0x2be/0x3c0 mm/gup.c:1860
__mm_populate+0x25f/0x390 mm/gup.c:1963
page last free pid 21987 tgid 21987 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1406 [inline]
free_unref_folios+0xd84/0x14a0 mm/page_alloc.c:3011
folios_put_refs+0x9e9/0xb30 mm/swap.c:1057
folio_batch_release include/linux/folio_batch.h:101 [inline]
truncate_inode_pages_range+0x3ca/0xd80 mm/truncate.c:408
kill_bdev block/bdev.c:91 [inline]
blkdev_flush_mapping+0x109/0x2f0 block/bdev.c:715
blkdev_put_whole block/bdev.c:722 [inline]
bdev_release+0x443/0x690 block/bdev.c:1147
blkdev_release+0x15/0x20 block/fops.c:680
__fput+0x418/0xa50 fs/file_table.c:512
task_work_run+0x1d9/0x270 kernel/task_work.c:233
exit_task_work include/linux/task_work.h:40 [inline]
do_exit+0x73a/0x2360 kernel/exit.c:1004
do_group_exit+0x22d/0x2f0 kernel/exit.c:1147
get_signal+0x121b/0x12c0 kernel/signal.c:3038
arch_do_signal_or_restart+0xbb/0x860 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:66 [inline]
exit_to_user_mode_loop+0x104/0x730 kernel/entry/common.c:101
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
do_syscall_64+0x353/0x580 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff8880589bbe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8880589bbf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8880589bbf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8880589bc000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8880589bc080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 31 48 89 xor %ecx,-0x77(%rax)
3: 4c 24 18 rex.WR and $0x18,%al
6: 42 c7 44 31 08 f3 f3 movl $0xf3f3f3f3,0x8(%rcx,%r14,1)
d: f3 f3
f: 48 c7 c7 0e 69 2e 8e mov $0xffffffff8e2e690e,%rdi
16: be 74 00 00 00 mov $0x74,%esi
1b: e8 3a 74 c5 f5 call 0xf5c5745a
20: 2e 2e 2e 31 c0 cs cs cs xor %eax,%eax
25: 49 8d 7c 24 08 lea 0x8(%r12),%rdi
* 2a: 48 89 7c 24 68 mov %rdi,0x68(%rsp) <-- trapping instruction
2f: e8 56 51 01 00 call 0x1518a
34: 4c 89 e0 mov %r12,%rax
37: 48 c1 e8 03 shr $0x3,%rax
3b: 48 89 44 24 28 mov %rax,0x28(%rsp)