==================================================================
BUG: KASAN: null-ptr-deref in mcp2221_raw_event+0xc1f/0x1030 drivers/hid/hid-mcp2221.c:910
Write of size 241 at addr 0000000000000000 by task syz.8.3785/23442
CPU: 0 UID: 0 PID: 23442 Comm: syz.8.3785 Not tainted syzkaller #0 PREEMPT(voluntary)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
kasan_report+0xe0/0x110 mm/kasan/report.c:595
check_region_inline mm/kasan/generic.c:183 [inline]
kasan_check_range+0x100/0x1b0 mm/kasan/generic.c:189
__asan_memcpy+0x3c/0x60 mm/kasan/shadow.c:106
mcp2221_raw_event+0xc1f/0x1030 drivers/hid/hid-mcp2221.c:910
__hid_input_report.constprop.0+0x314/0x450 drivers/hid/hid-core.c:2130
hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286
__usb_hcd_giveback_urb+0x388/0x610 drivers/usb/core/hcd.c:1661
usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1745
dummy_timer+0x1814/0x3a30 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+0x208/0x8d0 kernel/softirq.c:579
__do_softirq kernel/softirq.c:613 [inline]
invoke_softirq kernel/softirq.c:453 [inline]
__irq_exit_rcu+0xfa/0x160 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+0x90/0xb0 arch/x86/kernel/apic/apic.c:1050
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 96 9e 1a fa 48 89 df e8 7e f2 1a fa f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 45 4c 0e fa 65 8b 05 2e 4e 52 05 85 c0 74 16 5b
RSP: 0018:ffffc90013467c20 EFLAGS: 00000246
RAX: 0000000000000002 RBX: ffff88810aff0000 RCX: ffffffff8185d28f
RDX: 0000000000000000 RSI: ffffffff88d25cfc RDI: ffffffff878963e0
RBP: 0000000000000246 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff8a9d49d7 R11: 0000000000000000 R12: ffff88810aff00b8
R13: ffff88812406a200 R14: 0000000000000001 R15: ffff88810aff00b8
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
dummy_queue+0x3f8/0xb80 drivers/usb/gadget/udc/dummy_hcd.c:744
usb_ep_queue+0xf5/0x390 drivers/usb/gadget/udc/core.c:300
raw_process_ep_io+0x647/0xc30 drivers/usb/gadget/legacy/raw_gadget.c:1113
raw_ioctl_ep_write drivers/usb/gadget/legacy/raw_gadget.c:1152 [inline]
raw_ioctl+0xaab/0x2c30 drivers/usb/gadget/legacy/raw_gadget.c:1324
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:598 [inline]
__se_sys_ioctl fs/ioctl.c:584 [inline]
__x64_sys_ioctl+0x18b/0x210 fs/ioctl.c:584
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0x4b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcd30c4e7ab
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:00007fcd2f6b5f70 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000000000b1 RCX: 00007fcd30c4e7ab
RDX: 00007fcd2f6b5ff0 RSI: 0000000040085507 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007fcd30fc0320 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000246 R12: 00002000000001c0
R13: 0000000000000000 R14: 00007fcd30e95fa0 R15: 00007ffe26ef8448
==================================================================
----------------
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 96 9e 1a fa call 0xfa1a9ea9
13: 48 89 df mov %rbx,%rdi
16: e8 7e f2 1a fa call 0xfa1af299
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 45 4c 0e fa call 0xfa0e4c79
34: 65 8b 05 2e 4e 52 05 mov %gs:0x5524e2e(%rip),%eax # 0x5524e69
3b: 85 c0 test %eax,%eax
3d: 74 16 je 0x55
3f: 5b pop %rbx