==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0x106a/0x1240 drivers/hid/hid-mcp2221.c:948
Read of size 1 at addr ffff888053233fff by task syz.6.3135/14917
CPU: 0 UID: 0 PID: 14917 Comm: syz.6.3135 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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:2139 [inline]
hid_input_report+0x40a/0x520 drivers/hid/hid-core.c:2166
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+0x85f/0x44c0 drivers/usb/gadget/udc/dummy_hcd.c:1995
__run_hrtimer kernel/time/hrtimer.c:1777 [inline]
__hrtimer_run_queues+0x52c/0xc60 kernel/time/hrtimer.c:1841
hrtimer_run_softirq+0x187/0x2b0 kernel/time/hrtimer.c:1858
handle_softirqs+0x286/0x870 kernel/softirq.c:622
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:723
irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:__debug_check_no_obj_freed lib/debugobjects.c:1113 [inline]
RIP: 0010:debug_check_no_obj_freed+0x121/0x470 lib/debugobjects.c:1129
Code: 85 6c 03 00 00 48 81 c4 88 00 00 00 5b 41 5c 41 5d 41 5e 41 5f 5d e9 8e 3d b6 06 cc 48 c1 e8 0c 45 31 f6 4c 89 6c 24 40 eb 18 <41> 01 de 49 81 c4 00 10 00 00 48 8b 44 24 38 48 ff c8 0f 84 40 ff
RSP: 0018:ffffc90000bd78c0 EFLAGS: 00000293
RAX: 250d4af5d99a4b00 RBX: 0000000000000004 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8d70d481 RDI: 00000000ffffffff
RBP: ffff888149c54690 R08: ffffffff8f7cdc77 R09: 1ffffffff1ef9b8e
R10: dffffc0000000000 R11: fffffbfff1ef9b8f R12: ffff888053019000
R13: ffff888053019de8 R14: 0000000000000000 R15: 0000000000000000
slab_free_hook mm/slub.c:2470 [inline]
slab_free mm/slub.c:6630 [inline]
kfree+0x115/0x6d0 mm/slub.c:6837
raw_ioctl+0x2071/0x3be0 drivers/usb/gadget/legacy/raw_gadget.c:-1
__do_compat_sys_ioctl fs/ioctl.c:695 [inline]
__se_compat_sys_ioctl fs/ioctl.c:638 [inline]
__ia32_compat_sys_ioctl+0x543/0x840 fs/ioctl.c:638
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
__do_fast_syscall_32+0xb6/0x2b0 arch/x86/entry/syscall_32.c:306
do_fast_syscall_32+0x34/0x80 arch/x86/entry/syscall_32.c:331
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf7fa3539
Code: 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 002b:00000000f5495504 EFLAGS: 00000206 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000040085507
RDX: 00000000f5495548 RSI: 00000000f7436ff4 RDI: 0000000000000001
RBP: 00000000f5496568 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffffffffffffffff pfn:0x53233
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 00000000ffffffff 0000000000000000
raw: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 12726, tgid 12725 (syz.9.2287), ts 427288506268, free_ts 435144260634
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850
prep_new_page mm/page_alloc.c:1858 [inline]
get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884
__alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183
alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416
alloc_slab_page mm/slub.c:3055 [inline]
allocate_slab+0x96/0x350 mm/slub.c:3228
new_slab mm/slub.c:3282 [inline]
___slab_alloc+0xe94/0x18a0 mm/slub.c:4651
__slab_alloc+0x65/0x100 mm/slub.c:4770
__slab_alloc_node mm/slub.c:4846 [inline]
slab_alloc_node mm/slub.c:5268 [inline]
__do_kmalloc_node mm/slub.c:5641 [inline]
__kmalloc_noprof+0x471/0x7f0 mm/slub.c:5654
kmalloc_noprof include/linux/slab.h:961 [inline]
kmalloc_array_noprof include/linux/slab.h:1003 [inline]
iter_file_splice_write+0x1c6/0x10e0 fs/splice.c:679
do_splice_from fs/splice.c:938 [inline]
direct_splice_actor+0x101/0x160 fs/splice.c:1161
splice_direct_to_actor+0x5a8/0xcc0 fs/splice.c:1105
do_splice_direct_actor fs/splice.c:1204 [inline]
do_splice_direct+0x181/0x270 fs/splice.c:1230
do_sendfile+0x4da/0x7e0 fs/read_write.c:1370
__do_compat_sys_sendfile fs/read_write.c:1446 [inline]
__se_compat_sys_sendfile fs/read_write.c:1435 [inline]
__ia32_compat_sys_sendfile+0x120/0x1d0 fs/read_write.c:1435
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
__do_fast_syscall_32+0xb6/0x2b0 arch/x86/entry/syscall_32.c:306
do_fast_syscall_32+0x34/0x80 arch/x86/entry/syscall_32.c:331
page last free pid 10561 tgid 10561 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1394 [inline]
__free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906
discard_slab mm/slub.c:3326 [inline]
__put_partials+0x146/0x170 mm/slub.c:3872
put_cpu_partial+0x1f2/0x2e0 mm/slub.c:3947
__slab_free+0x2b9/0x390 mm/slub.c:5921
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:352
kasan_slab_alloc include/linux/kasan.h:252 [inline]
slab_post_alloc_hook mm/slub.c:4970 [inline]
slab_alloc_node mm/slub.c:5280 [inline]
kmem_cache_alloc_lru_noprof+0x35d/0x6d0 mm/slub.c:5299
sock_alloc_inode+0x28/0xc0 net/socket.c:322
alloc_inode+0x6a/0x1b0 fs/inode.c:346
new_inode_pseudo include/linux/fs.h:3395 [inline]
sock_alloc net/socket.c:637 [inline]
__sock_create+0x12d/0x9f0 net/socket.c:1569
sock_create net/socket.c:1663 [inline]
__sys_socket_create net/socket.c:1700 [inline]
__sys_socket+0xd7/0x1b0 net/socket.c:1747
__do_compat_sys_socketcall net/compat.c:448 [inline]
__se_compat_sys_socketcall net/compat.c:423 [inline]
__ia32_compat_sys_socketcall+0x6df/0x9c0 net/compat.c:423
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
__do_fast_syscall_32+0xb6/0x2b0 arch/x86/entry/syscall_32.c:306
do_fast_syscall_32+0x34/0x80 arch/x86/entry/syscall_32.c:331
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
Memory state around the buggy address:
ffff888053233e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888053233f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888053233f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888053234000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888053234080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess), 3 bytes skipped:
0: 00 00 add %al,(%rax)
2: 48 81 c4 88 00 00 00 add $0x88,%rsp
9: 5b pop %rbx
a: 41 5c pop %r12
c: 41 5d pop %r13
e: 41 5e pop %r14
10: 41 5f pop %r15
12: 5d pop %rbp
13: e9 8e 3d b6 06 jmp 0x6b63da6
18: cc int3
19: 48 c1 e8 0c shr $0xc,%rax
1d: 45 31 f6 xor %r14d,%r14d
20: 4c 89 6c 24 40 mov %r13,0x40(%rsp)
25: eb 18 jmp 0x3f
* 27: 41 01 de add %ebx,%r14d <-- trapping instruction
2a: 49 81 c4 00 10 00 00 add $0x1000,%r12
31: 48 8b 44 24 38 mov 0x38(%rsp),%rax
36: 48 ff c8 dec %rax
39: 0f .byte 0xf
3a: 84 40 ff test %al,-0x1(%rax)