================================================================== BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948 Read of size 1 at addr ffff88807a08ffff by task syz.0.887/9281 CPU: 0 UID: 0 PID: 9281 Comm: syz.0.887 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 mcp2221_raw_event+0x1070/0x10a0 drivers/hid/hid-mcp2221.c:948 __hid_input_report.constprop.0+0x314/0x450 drivers/hid/hid-core.c:2139 hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:286 __usb_hcd_giveback_urb+0x38b/0x610 drivers/usb/core/hcd.c:1661 usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1745 dummy_timer+0x1809/0x3a00 drivers/usb/gadget/udc/dummy_hcd.c:1995 __run_hrtimer kernel/time/hrtimer.c:1777 [inline] __hrtimer_run_queues+0x202/0xad0 kernel/time/hrtimer.c:1841 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1858 handle_softirqs+0x219/0x8e0 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0x109/0x170 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+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1052 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 RIP: 0010:unwind_next_frame+0xd4f/0x20a0 arch/x86/kernel/unwind_orc.c:590 Code: 03 4c 8b 44 24 28 80 3c 16 00 0f 85 d3 0e 00 00 48 8b 14 24 49 89 45 48 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 <0f> 85 c6 12 00 00 4c 89 e2 4d 89 75 38 48 b8 00 00 00 00 00 fc ff RSP: 0018:ffffc9000c4cf980 EFLAGS: 00000246 RAX: dffffc0000000000 RBX: 0000000000000001 RCX: ffffffff9123671a RDX: 1ffff92001899f45 RSI: 1ffff92001899f47 RDI: ffffc9000c4cfdf0 RBP: ffffc9000c4cfa38 R08: ffffffff9123671e R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000011a27 R12: ffffc9000c4cfa40 R13: ffffc9000c4cf9f0 R14: ffffc9000c4cfdf8 R15: ffffc9000c4cfa24 arch_stack_walk+0x94/0x100 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x8e/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 __kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2539 [inline] slab_free mm/slub.c:6630 [inline] kfree+0x2b8/0x6d0 mm/slub.c:6837 raw_ioctl_ep_write drivers/usb/gadget/legacy/raw_gadget.c:1153 [inline] raw_ioctl+0xab6/0x2c30 drivers/usb/gadget/legacy/raw_gadget.c:1324 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f3d4318ebcb 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:00007f3d44040f70 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f3d4318ebcb RDX: 00007f3d44040ff0 RSI: 0000000040085507 RDI: 0000000000000003 RBP: 0000000000000003 R08: 00007f3d43510320 R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000246 R12: 00002000000004c0 R13: 0000000000000000 R14: 00007f3d433e6090 R15: 00007fff151edce8 Allocated by task 5187: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 unpoison_slab_object mm/kasan/common.c:342 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:368 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+0x254/0x6e0 mm/slub.c:5299 shmem_alloc_inode+0x25/0x50 mm/shmem.c:5147 alloc_inode+0x64/0x240 fs/inode.c:346 new_inode+0x22/0x1c0 fs/inode.c:1145 __shmem_get_inode mm/shmem.c:3046 [inline] shmem_get_inode+0x19a/0xfb0 mm/shmem.c:3120 shmem_mknod+0x1a8/0x450 mm/shmem.c:3841 lookup_open.isra.0+0x11d3/0x1580 fs/namei.c:3796 open_last_lookups fs/namei.c:3895 [inline] path_openat+0x893/0x2cb0 fs/namei.c:4131 do_filp_open+0x20b/0x470 fs/namei.c:4161 do_sys_openat2+0x11b/0x1d0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_sys_openat fs/open.c:1468 [inline] __se_sys_openat fs/open.c:1463 [inline] __x64_sys_openat+0x174/0x210 fs/open.c:1463 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88807a08f470 which belongs to the cache shmem_inode_cache of size 1528 The buggy address is located 1431 bytes to the right of allocated 1528-byte region [ffff88807a08f470, ffff88807a08fa68) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a088 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff888140436b40 0000000000000000 0000000000000001 raw: 0000000000000000 0000000000130013 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff888140436b40 0000000000000000 0000000000000001 head: 0000000000000000 0000000000130013 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea0001e82201 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5193, tgid 5193 (udevd), ts 30132882236, free_ts 29914255767 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x10a3/0x3a30 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x25f/0x2470 mm/page_alloc.c:5183 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3055 [inline] allocate_slab mm/slub.c:3228 [inline] new_slab+0x24a/0x360 mm/slub.c:3282 ___slab_alloc+0xdae/0x1a60 mm/slub.c:4651 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4770 __slab_alloc_node mm/slub.c:4846 [inline] slab_alloc_node mm/slub.c:5268 [inline] kmem_cache_alloc_lru_noprof+0x443/0x6e0 mm/slub.c:5299 shmem_alloc_inode+0x25/0x50 mm/shmem.c:5147 alloc_inode+0x64/0x240 fs/inode.c:346 new_inode+0x22/0x1c0 fs/inode.c:1145 __shmem_get_inode mm/shmem.c:3046 [inline] shmem_get_inode+0x19a/0xfb0 mm/shmem.c:3120 shmem_mknod+0x1a8/0x450 mm/shmem.c:3841 lookup_open.isra.0+0x11d3/0x1580 fs/namei.c:3796 open_last_lookups fs/namei.c:3895 [inline] path_openat+0x893/0x2cb0 fs/namei.c:4131 do_filp_open+0x20b/0x470 fs/namei.c:4161 page last free pid 5184 tgid 5184 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0x7df/0x1160 mm/page_alloc.c:2906 discard_slab mm/slub.c:3326 [inline] __put_partials+0x130/0x170 mm/slub.c:3872 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4d/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 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_node_noprof+0x28a/0x770 mm/slub.c:5332 __alloc_skb+0x2b2/0x380 net/core/skbuff.c:660 alloc_skb include/linux/skbuff.h:1383 [inline] alloc_skb_with_frags+0xe0/0x860 net/core/skbuff.c:6671 sock_alloc_send_pskb+0x7f9/0x980 net/core/sock.c:2965 unix_dgram_sendmsg+0x3e9/0x17f0 net/unix/af_unix.c:2153 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] sock_write_iter+0x566/0x610 net/socket.c:1195 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x7d3/0x11d0 fs/read_write.c:686 ksys_write+0x1f8/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88807a08fe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807a08ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807a08ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807a090000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807a090080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 03 4c 8b 44 add 0x44(%rbx,%rcx,4),%ecx 4: 24 28 and $0x28,%al 6: 80 3c 16 00 cmpb $0x0,(%rsi,%rdx,1) a: 0f 85 d3 0e 00 00 jne 0xee3 10: 48 8b 14 24 mov (%rsp),%rdx 14: 49 89 45 48 mov %rax,0x48(%r13) 18: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 1f: fc ff df 22: 48 c1 ea 03 shr $0x3,%rdx 26: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) * 2a: 0f 85 c6 12 00 00 jne 0x12f6 <-- trapping instruction 30: 4c 89 e2 mov %r12,%rdx 33: 4d 89 75 38 mov %r14,0x38(%r13) 37: 48 rex.W 38: b8 00 00 00 00 mov $0x0,%eax 3d: 00 fc add %bh,%ah 3f: ff .byte 0xff