==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x106a/0x1240 drivers/hid/hid-mcp2221.c:948
Read of size 1 at addr ffff88804c623fff by task syz-executor/6188
CPU: 0 UID: 0 PID: 6188 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xca/0x240 mm/kasan/report.c:482
kasan_report+0x118/0x150 mm/kasan/report.c:595
mcp2221_raw_event+0x106a/0x1240 drivers/hid/hid-mcp2221.c:948
__hid_input_report drivers/hid/hid-core.c:2130 [inline]
hid_input_report+0x40a/0x520 drivers/hid/hid-core.c:2157
hid_irq_in+0x47e/0x6d0 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x376/0x540 drivers/usb/core/hcd.c:1661
dummy_timer+0x862/0x4550 drivers/usb/gadget/udc/dummy_hcd.c:1995
__run_hrtimer kernel/time/hrtimer.c:1761 [inline]
__hrtimer_run_queues+0x52c/0xc60 kernel/time/hrtimer.c:1825
hrtimer_run_softirq+0x187/0x2b0 kernel/time/hrtimer.c:1842
handle_softirqs+0x286/0x870 kernel/softirq.c:579
__do_softirq kernel/softirq.c:613 [inline]
invoke_softirq kernel/softirq.c:453 [inline]
__irq_exit_rcu+0xca/0x1f0 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+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1050
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:kasan_byte_accessible+0x16/0x30 mm/kasan/generic.c:201
Code: 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 0f 1f 00 48 c1 ef 03 48 b8 00 00 00 00 00 fc ff df 0f b6 04 07 <3c> 08 0f 92 c0 e9 0b 37 ed fe cc 66 66 66 66 66 66 2e 0f 1f 84 00
RSP: 0018:ffffc9000b697718 EFLAGS: 00000216
RAX: 0000000000000000 RBX: ffffffff8172c1b2 RCX: dec948c3f2ef9c00
RDX: 0000000000000000 RSI: ffffffff8172c1b2 RDI: 1ffffffff1c273e4
RBP: ffffffff8172c195 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: fffff520016d2f2d R12: 0000000000000002
R13: ffffffff8e139f20 R14: ffffffff8e139f20 R15: 0000000000000000
__kasan_check_byte+0x12/0x40 mm/kasan/common.c:567
kasan_check_byte include/linux/kasan.h:399 [inline]
lock_acquire+0x8d/0x360 kernel/locking/lockdep.c:5842
rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
rcu_read_lock include/linux/rcupdate.h:841 [inline]
class_rcu_constructor include/linux/rcupdate.h:1155 [inline]
unwind_next_frame+0xc2/0x2390 arch/x86/kernel/unwind_orc.c:479
__unwind_start+0x5b9/0x760 arch/x86/kernel/unwind_orc.c:758
unwind_start arch/x86/include/asm/unwind.h:64 [inline]
arch_stack_walk+0xe4/0x150 arch/x86/kernel/stacktrace.c:24
stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:122
save_stack+0xf5/0x1f0 mm/page_owner.c:156
__reset_page_owner+0x71/0x1f0 mm/page_owner.c:308
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
__free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895
vfree+0x25a/0x400 mm/vmalloc.c:3434
bch2_fs_btree_write_buffer_exit+0x1ac/0x1e0 fs/bcachefs/btree_write_buffer.c:871
__bch2_fs_free fs/bcachefs/super.c:615 [inline]
bch2_fs_release+0x297/0x830 fs/bcachefs/super.c:667
kobject_cleanup lib/kobject.c:689 [inline]
kobject_release lib/kobject.c:720 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x22b/0x480 lib/kobject.c:737
deactivate_locked_super+0xbc/0x130 fs/super.c:474
cleanup_mnt+0x425/0x4c0 fs/namespace.c:1375
task_work_run+0x1d4/0x260 kernel/task_work.c:227
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
exit_to_user_mode_loop+0xec/0x110 kernel/entry/common.c:43
exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
do_syscall_64+0x2bd/0x3b0 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9403b8ff17
Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffd2888bb28 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f9403c11c05 RCX: 00007f9403b8ff17
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffd2888bbe0
RBP: 00007ffd2888bbe0 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffd2888cc70
R13: 00007f9403c11c05 R14: 00000000000c893c R15: 00007ffd2888ccb0
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x118 pfn:0x4c623
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000118 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 12253, tgid 12253 (syz-executor), ts 732231127943, free_ts 807063434619
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851
prep_new_page mm/page_alloc.c:1859 [inline]
get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858
__alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148
alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416
alloc_slab_page mm/slub.c:2487 [inline]
allocate_slab+0x8a/0x370 mm/slub.c:2655
new_slab mm/slub.c:2709 [inline]
___slab_alloc+0xbeb/0x1410 mm/slub.c:3891
__slab_alloc mm/slub.c:3981 [inline]
__slab_alloc_node mm/slub.c:4056 [inline]
slab_alloc_node mm/slub.c:4217 [inline]
kmem_cache_alloc_node_noprof+0x280/0x3c0 mm/slub.c:4281
kmalloc_reserve+0xbd/0x290 net/core/skbuff.c:578
__alloc_skb+0x142/0x2d0 net/core/skbuff.c:669
alloc_skb include/linux/skbuff.h:1336 [inline]
bt_skb_alloc include/net/bluetooth/bluetooth.h:509 [inline]
vhci_get_user drivers/bluetooth/hci_vhci.c:488 [inline]
vhci_write+0xbe/0x4a0 drivers/bluetooth/hci_vhci.c:608
do_iter_readv_writev+0x61c/0x8b0 fs/read_write.c:-1
vfs_writev+0x31a/0x960 fs/read_write.c:1057
do_writev+0x14d/0x2d0 fs/read_write.c:1103
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 12899 tgid 12899 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
__free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895
__slab_free+0x303/0x3c0 mm/slub.c:4591
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:340
kasan_slab_alloc include/linux/kasan.h:250 [inline]
slab_post_alloc_hook mm/slub.c:4180 [inline]
slab_alloc_node mm/slub.c:4229 [inline]
kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4236
mt_alloc_one lib/maple_tree.c:176 [inline]
mas_alloc_nodes+0x2e9/0x8e0 lib/maple_tree.c:1255
mas_node_count_gfp lib/maple_tree.c:1337 [inline]
mas_preallocate+0x3ad/0x6f0 lib/maple_tree.c:5537
vma_iter_prealloc mm/vma.h:462 [inline]
commit_merge+0x1fd/0x700 mm/vma.c:753
vma_expand+0x40c/0x7e0 mm/vma.c:1158
relocate_vma_down+0x2e6/0x500 mm/vma_exec.c:58
setup_arg_pages+0x5df/0xaa0 fs/exec.c:690
load_elf_binary+0xba4/0x2740 fs/binfmt_elf.c:1013
search_binary_handler fs/exec.c:1670 [inline]
exec_binprm fs/exec.c:1702 [inline]
bprm_execve+0x99c/0x1450 fs/exec.c:1754
do_execveat_common+0x510/0x6a0 fs/exec.c:1860
do_execve fs/exec.c:1934 [inline]
__do_sys_execve fs/exec.c:2010 [inline]
__se_sys_execve fs/exec.c:2005 [inline]
__x64_sys_execve+0x94/0xb0 fs/exec.c:2005
Memory state around the buggy address:
ffff88804c623e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88804c623f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88804c623f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88804c624000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88804c624080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 00 00 add %al,(%rax)
2: 00 00 add %al,(%rax)
4: 90 nop
5: 90 nop
6: 90 nop
7: 90 nop
8: 90 nop
9: 90 nop
a: 90 nop
b: 90 nop
c: 90 nop
d: 90 nop
e: 90 nop
f: 90 nop
10: 90 nop
11: 90 nop
12: 90 nop
13: 90 nop
14: 66 0f 1f 00 nopw (%rax)
18: 48 c1 ef 03 shr $0x3,%rdi
1c: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
23: fc ff df
26: 0f b6 04 07 movzbl (%rdi,%rax,1),%eax
* 2a: 3c 08 cmp $0x8,%al <-- trapping instruction
2c: 0f 92 c0 setb %al
2f: e9 0b 37 ed fe jmp 0xfeed373f
34: cc int3
35: 66 data16
36: 66 data16
37: 66 data16
38: 66 data16
39: 66 data16
3a: 66 data16
3b: 2e cs
3c: 0f .byte 0xf
3d: 1f (bad)
3e: 84 00 test %al,(%rax)