==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0xf98/0x1030 drivers/hid/hid-mcp2221.c:852
Read of size 1 at addr ffff88811a603fff by task syz.8.2302/15164
CPU: 0 UID: 0 PID: 15164 Comm: syz.8.2302 Not tainted 6.13.0-rc3-syzkaller-g362a7993ed01 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024
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:378 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:489
kasan_report+0xd9/0x110 mm/kasan/report.c:602
mcp2221_raw_event+0xf98/0x1030 drivers/hid/hid-mcp2221.c:852
__hid_input_report.constprop.0+0x312/0x440 drivers/hid/hid-core.c:2111
hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:285
__usb_hcd_giveback_urb+0x389/0x6e0 drivers/usb/core/hcd.c:1650
usb_hcd_giveback_urb+0x396/0x450 drivers/usb/core/hcd.c:1734
dummy_timer+0x17f0/0x3930 drivers/usb/gadget/udc/dummy_hcd.c:1993
__run_hrtimer kernel/time/hrtimer.c:1739 [inline]
__hrtimer_run_queues+0x20a/0xae0 kernel/time/hrtimer.c:1803
hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1820
handle_softirqs+0x206/0x8d0 kernel/softirq.c:561
__do_softirq kernel/softirq.c:595 [inline]
invoke_softirq kernel/softirq.c:435 [inline]
__irq_exit_rcu+0xfa/0x160 kernel/softirq.c:662
irq_exit_rcu+0x9/0x30 kernel/softirq.c:678
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1049
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:194
Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 c6 66 45 fa 48 89 df e8 0e e6 45 fa f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 65 ff 39 fa 65 8b 05 66 f7 10 79 85 c0 74 16 5b
RSP: 0018:ffffc90005c27cb0 EFLAGS: 00000246
RAX: 0000000000000002 RBX: ffff88811775a008 RCX: 1ffffffff14ab8d9
RDX: 0000000000000000 RSI: ffffffff8727fee0 RDI: ffffffff87473460
RBP: 0000000000000283 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff8a55ffd7 R11: 0000000000000000 R12: 0000000000000001
R13: ffff88811775a190 R14: ffffc90005c27d30 R15: 0000000000000000
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
raw_process_ep_io+0x73e/0xb90 drivers/usb/gadget/legacy/raw_gadget.c:1139
raw_ioctl_ep_write drivers/usb/gadget/legacy/raw_gadget.c:1152 [inline]
raw_ioctl+0xa4d/0x2b90 drivers/usb/gadget/legacy/raw_gadget.c:1324
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:906 [inline]
__se_sys_ioctl fs/ioctl.c:892 [inline]
__x64_sys_ioctl+0x190/0x200 fs/ioctl.c:892
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f990225591b
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:00007f99008c5f70 EFLAGS: 00000246
ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f990225591b
RDX: 00007f99008c5ff0 RSI: 0000000040085507 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007f9902570320 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000246 R12: 0000000020000040
R13: 0000000000000000 R14: 00007f9902445fa0 R15: 00007ffda6a7d1f8
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88811a603dc0 pfn:0x11a603
flags: 0x200000000000000(node=0|zone=2)
page_type: f0(buddy)
raw: 0200000000000000 ffffea00044890c8 ffffea0004cf1a88 0000000000000000
raw: ffff88811a603dc0 0000000000000000 00000000f0000000 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 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), pid 5233, tgid 5233 (kworker/0:3), ts 1304467000535, free_ts 1304561719133
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556
prep_new_page mm/page_alloc.c:1564 [inline]
get_page_from_freelist+0xe76/0x2b90 mm/page_alloc.c:3474
__alloc_pages_noprof+0x21c/0x22a0 mm/page_alloc.c:4751
alloc_pages_mpol_noprof+0xeb/0x400 mm/mempolicy.c:2269
vm_area_alloc_pages mm/vmalloc.c:3589 [inline]
__vmalloc_area_node mm/vmalloc.c:3667 [inline]
__vmalloc_node_range_noprof+0x724/0x1530 mm/vmalloc.c:3844
__vmalloc_node_noprof mm/vmalloc.c:3909 [inline]
vzalloc_noprof+0x6b/0x90 mm/vmalloc.c:3982
hid_open_report+0x2a1/0x830 drivers/hid/hid-core.c:1293
hid_parse include/linux/hid.h:1123 [inline]
aqc_probe+0x138/0x3680 drivers/hwmon/aquacomputer_d5next.c:1555
__hid_device_probe drivers/hid/hid-core.c:2718 [inline]
hid_device_probe+0x349/0x700 drivers/hid/hid-core.c:2755
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x23e/0xa90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x440 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830
__device_attach_driver+0x1df/0x310 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:459
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:534
page last free pid 5233 tgid 5233 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1127 [inline]
free_unref_page+0x661/0xe40 mm/page_alloc.c:2657
vfree+0x17a/0x890 mm/vmalloc.c:3382
hid_open_report+0x50c/0x830 drivers/hid/hid-core.c:1358
hid_parse include/linux/hid.h:1123 [inline]
aqc_probe+0x138/0x3680 drivers/hwmon/aquacomputer_d5next.c:1555
__hid_device_probe drivers/hid/hid-core.c:2718 [inline]
hid_device_probe+0x349/0x700 drivers/hid/hid-core.c:2755
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x23e/0xa90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x440 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830
__device_attach_driver+0x1df/0x310 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:459
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:534
device_add+0x114b/0x1a70 drivers/base/core.c:3665
hid_add_device+0x374/0xa60 drivers/hid/hid-core.c:2901
usbhid_probe+0xd32/0x1400 drivers/hid/usbhid/hid-core.c:1431
usb_probe_interface+0x300/0x9c0 drivers/usb/core/driver.c:396
Memory state around the buggy address:
ffff88811a603e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88811a603f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88811a603f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88811a604000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88811a604080: 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 c6 66 45 fa call 0xfa4566d9
13: 48 89 df mov %rbx,%rdi
16: e8 0e e6 45 fa call 0xfa45e629
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 65 ff 39 fa call 0xfa39ff99
34: 65 8b 05 66 f7 10 79 mov %gs:0x7910f766(%rip),%eax # 0x7910f7a1
3b: 85 c0 test %eax,%eax
3d: 74 16 je 0x55
3f: 5b pop %rbx