==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0xf94/0x1030 drivers/hid/hid-mcp2221.c:854
Read of size 1 at addr ffff888075c07fff by task syz.2.796/9270
CPU: 1 UID: 0 PID: 9270 Comm: syz.2.796 Not tainted 6.16.0-rc5-syzkaller #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:408 [inline]
print_report+0xcd/0x680 mm/kasan/report.c:521
kasan_report+0xe0/0x110 mm/kasan/report.c:634
mcp2221_raw_event+0xf94/0x1030 drivers/hid/hid-mcp2221.c:854
__hid_input_report.constprop.0+0x314/0x450 drivers/hid/hid-core.c:2117
hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x38a/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:5269
Code: fb 09 00 00 44 8b 05 09 c8 1f 0f 45 85 c0 0f 85 be 01 00 00 4c 89 e7 e8 a4 f6 ff ff e8 0f da 39 00 fb 65 48 8b 1d be a2 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:ffffc90003c8f4b8 EFLAGS: 00000202
RAX: 000000000001f5ef RBX: ffff88802f954880 RCX: ffffffff81c3b65f
RDX: 0000000000000000 RSI: ffffffff8de3106c RDI: ffffffff8c158660
RBP: ffffc90003c8f500 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff90a97357 R11: 0000000000000001 R12: ffff8880b853a2c0
R13: ffff88802f60a440 R14: 0000000000000001 R15: ffff8880b853b130
context_switch kernel/sched/core.c:5404 [inline]
__schedule+0x1172/0x5de0 kernel/sched/core.c:6790
__schedule_loop kernel/sched/core.c:6868 [inline]
schedule+0xe7/0x3a0 kernel/sched/core.c:6883
schedule_timeout+0x257/0x290 kernel/time/sleep_timeout.c:75
unix_wait_for_peer+0x245/0x280 net/unix/af_unix.c:1596
unix_dgram_sendmsg+0x16bf/0x1840 net/unix/af_unix.c:2199
sock_sendmsg_nosec net/socket.c:712 [inline]
__sock_sendmsg net/socket.c:727 [inline]
____sys_sendmsg+0xa95/0xc70 net/socket.c:2566
___sys_sendmsg+0x134/0x1d0 net/socket.c:2620
__sys_sendmmsg+0x200/0x420 net/socket.c:2709
__do_sys_sendmmsg net/socket.c:2736 [inline]
__se_sys_sendmmsg net/socket.c:2733 [inline]
__x64_sys_sendmmsg+0x9c/0x100 net/socket.c:2733
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:0x7f0196f8e929
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:00007f0197ea0038 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00007f01971b5fa0 RCX: 00007f0196f8e929
RDX: 0000000000000651 RSI: 0000200000000000 RDI: 0000000000000008
RBP: 00007f0197010b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f01971b5fa0 R15: 00007ffc1494f108
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x9ec pfn:0x75c07
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000
raw: 00000000000009ec 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 0x140cc2(GFP_HIGHUSER|__GFP_COMP), pid 8611, tgid 8605 (syz.1.631), ts 313420032577, free_ts 314168509720
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_pages_noprof mm/mempolicy.c:2510 [inline]
folio_alloc_noprof+0x20/0x2d0 mm/mempolicy.c:2520
filemap_alloc_folio_noprof+0x3a1/0x470 mm/filemap.c:1007
filemap_create_folio mm/filemap.c:2519 [inline]
filemap_get_pages+0xd1f/0x1c20 mm/filemap.c:2608
filemap_splice_read+0x5cb/0xcd0 mm/filemap.c:2990
do_splice_read fs/splice.c:979 [inline]
do_splice_read+0x282/0x370 fs/splice.c:953
splice_direct_to_actor+0x2a1/0xa30 fs/splice.c:1083
do_splice_direct_actor fs/splice.c:1201 [inline]
do_splice_direct+0x174/0x240 fs/splice.c:1227
do_sendfile+0xb06/0xe50 fs/read_write.c:1370
__do_sys_sendfile64 fs/read_write.c:1431 [inline]
__se_sys_sendfile64 fs/read_write.c:1417 [inline]
__x64_sys_sendfile64+0x1d8/0x220 fs/read_write.c:1417
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
page last free pid 8607 tgid 8605 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1248 [inline]
free_unref_folios+0xa65/0x1800 mm/page_alloc.c:2763
folios_put_refs+0x56f/0x740 mm/swap.c:992
folio_batch_release include/linux/pagevec.h:101 [inline]
truncate_inode_pages_range+0x311/0xe50 mm/truncate.c:383
evict+0x78c/0x920 fs/inode.c:812
iput_final fs/inode.c:1898 [inline]
iput fs/inode.c:1924 [inline]
iput+0x521/0x880 fs/inode.c:1910
dentry_unlink_inode+0x29c/0x480 fs/dcache.c:466
__dentry_kill+0x1d0/0x600 fs/dcache.c:669
shrink_kill fs/dcache.c:1114 [inline]
shrink_dentry_list+0x140/0x5d0 fs/dcache.c:1141
shrink_dcache_parent+0xe1/0x530 fs/dcache.c:1575
do_one_tree fs/dcache.c:1604 [inline]
shrink_dcache_for_umount+0xa5/0x3e0 fs/dcache.c:1621
generic_shutdown_super+0x6c/0x390 fs/super.c:621
kill_anon_super fs/super.c:1282 [inline]
kill_litter_super+0x70/0xa0 fs/super.c:1292
deactivate_locked_super+0xbe/0x1a0 fs/super.c:474
deactivate_super fs/super.c:507 [inline]
deactivate_super+0xde/0x100 fs/super.c:503
cleanup_mnt+0x225/0x450 fs/namespace.c:1417
task_work_run+0x14d/0x240 kernel/task_work.c:227
Memory state around the buggy address:
ffff888075c07e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888075c07f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888075c07f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888075c08000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888075c08080: 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 c8 1f 0f mov 0xf1fc809(%rip),%r8d # 0xf1fc812
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 0f da 39 00 call 0x39da2e
1f: fb sti
20: 65 48 8b 1d be a2 46 mov %gs:0x1246a2be(%rip),%rbx # 0x1246a2e6
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