================================================================== BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0x1062/0x1240 drivers/hid/hid-mcp2221.c:856 Read of size 1 at addr ffff88802c4cbfff by task kworker/u4:7/2901 CPU: 1 PID: 2901 Comm: kworker/u4:7 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Workqueue: bat_events batadv_nc_worker Call Trace: dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xac/0x220 mm/kasan/report.c:468 kasan_report+0x117/0x150 mm/kasan/report.c:581 mcp2221_raw_event+0x1062/0x1240 drivers/hid/hid-mcp2221.c:856 hid_input_report+0x400/0x520 drivers/hid/hid-core.c:2095 hid_irq_in+0x479/0x6d0 drivers/hid/usbhid/hid-core.c:284 __usb_hcd_giveback_urb+0x35f/0x520 drivers/usb/core/hcd.c:1650 dummy_timer+0x88a/0x3140 drivers/usb/gadget/udc/dummy_hcd.c:1993 __run_hrtimer kernel/time/hrtimer.c:1750 [inline] __hrtimer_run_queues+0x51e/0xc40 kernel/time/hrtimer.c:1814 hrtimer_run_softirq+0x187/0x2b0 kernel/time/hrtimer.c:1831 handle_softirqs+0x280/0x820 kernel/softirq.c:578 __do_softirq kernel/softirq.c:612 [inline] invoke_softirq kernel/softirq.c:452 [inline] __irq_exit_rcu+0xc7/0x190 kernel/softirq.c:661 irq_exit_rcu+0x9/0x20 kernel/softirq.c:673 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1088 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687 RIP: 0010:trace_lock_acquire include/trace/events/lock.h:24 [inline] RIP: 0010:lock_acquire+0xc4/0x410 kernel/locking/lockdep.c:5725 Code: 7e 83 f8 08 0f 83 8a 01 00 00 41 89 c6 c1 e8 06 48 8d 3c c5 68 8d 4a 8e be 08 00 00 00 e8 54 f3 75 00 4c 0f a3 35 14 94 e3 0c <73> 0d e8 f5 9f 08 00 84 c0 0f 84 18 02 00 00 48 c7 c0 1c c2 4a 8e RSP: 0018:ffffc9000baf7a40 EFLAGS: 00000257 RAX: 0000000000000001 RBX: 0000000000000000 RCX: ffffffff8166f94c RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff8e4a8d68 RBP: ffffc9000baf7b48 R08: ffffffff8e4a8d6f R09: 1ffffffff1c951ad R10: dffffc0000000000 R11: fffffbfff1c951ae R12: 1ffff9200175ef54 R13: ffffffff8cd2fee0 R14: 0000000000000001 R15: dffffc0000000000 rcu_lock_acquire include/linux/rcupdate.h:334 [inline] rcu_read_lock include/linux/rcupdate.h:786 [inline] batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:408 [inline] batadv_nc_worker+0xef/0x610 net/batman-adv/network-coding.c:719 process_one_work kernel/workqueue.c:2634 [inline] process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711 worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792 kthread+0x2fa/0x390 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 Allocated by task 5454: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4e/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc_node_track_caller+0xb2/0x230 mm/slab_common.c:1027 kmalloc_reserve+0x117/0x260 net/core/skbuff.c:581 __alloc_skb+0x138/0x2c0 net/core/skbuff.c:650 alloc_skb include/linux/skbuff.h:1284 [inline] alloc_skb_with_frags+0xca/0x7c0 net/core/skbuff.c:6328 sock_alloc_send_pskb+0x857/0x990 net/core/sock.c:2821 unix_dgram_sendmsg+0x5a1/0x1720 net/unix/af_unix.c:2001 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] sock_write_iter+0x2bb/0x3f0 net/socket.c:1160 do_iter_readv_writev fs/read_write.c:-1 [inline] do_iter_write+0x79a/0xc70 fs/read_write.c:860 vfs_writev fs/read_write.c:933 [inline] do_writev+0x252/0x410 fs/read_write.c:976 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 5455: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4e/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x50 mm/kasan/generic.c:522 ____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1811 [inline] slab_free_freelist_hook+0x130/0x1b0 mm/slub.c:1837 slab_free mm/slub.c:3830 [inline] __kmem_cache_free+0xba/0x1f0 mm/slub.c:3843 skb_kfree_head net/core/skbuff.c:945 [inline] skb_free_head net/core/skbuff.c:957 [inline] skb_release_data+0x634/0x800 net/core/skbuff.c:987 skb_release_all net/core/skbuff.c:1053 [inline] __kfree_skb net/core/skbuff.c:1067 [inline] consume_skb+0xb2/0x110 net/core/skbuff.c:1283 __unix_dgram_recvmsg+0xa04/0xd60 net/unix/af_unix.c:2490 sock_recvmsg_nosec net/socket.c:1046 [inline] sock_recvmsg net/socket.c:1068 [inline] sock_read_iter+0x2b7/0x3b0 net/socket.c:1138 call_read_iter include/linux/fs.h:2012 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x431/0x920 fs/read_write.c:470 ksys_read+0x147/0x250 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88802c4cbc00 which belongs to the cache kmalloc-cg-512 of size 512 The buggy address is located 511 bytes to the right of allocated 512-byte region [ffff88802c4cbc00, ffff88802c4cbe00) The buggy address belongs to the physical page: page:ffffea0000b13200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2c4c8 head:ffffea0000b13200 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff88801784f140 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5454, tgid 5454 (dhcpcd), ts 50680824433, free_ts 38540118756 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1cd/0x210 mm/page_alloc.c:1554 prep_new_page mm/page_alloc.c:1561 [inline] get_page_from_freelist+0x195c/0x19f0 mm/page_alloc.c:3191 __alloc_pages+0x1e3/0x460 mm/page_alloc.c:4457 alloc_slab_page+0x5d/0x170 mm/slub.c:1881 allocate_slab mm/slub.c:2028 [inline] new_slab+0x87/0x2e0 mm/slub.c:2081 ___slab_alloc+0xc6d/0x1300 mm/slub.c:3253 __slab_alloc mm/slub.c:3339 [inline] __slab_alloc_node mm/slub.c:3392 [inline] slab_alloc_node mm/slub.c:3485 [inline] __kmem_cache_alloc_node+0x1a2/0x260 mm/slub.c:3534 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc_node_track_caller+0xa2/0x230 mm/slab_common.c:1027 kmalloc_reserve+0x117/0x260 net/core/skbuff.c:581 __alloc_skb+0x138/0x2c0 net/core/skbuff.c:650 alloc_skb include/linux/skbuff.h:1284 [inline] alloc_skb_with_frags+0xca/0x7c0 net/core/skbuff.c:6328 sock_alloc_send_pskb+0x857/0x990 net/core/sock.c:2821 unix_dgram_sendmsg+0x5a1/0x1720 net/unix/af_unix.c:2001 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] sock_write_iter+0x2bb/0x3f0 net/socket.c:1160 do_iter_readv_writev fs/read_write.c:-1 [inline] do_iter_write+0x79a/0xc70 fs/read_write.c:860 vfs_writev fs/read_write.c:933 [inline] do_writev+0x252/0x410 fs/read_write.c:976 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1154 [inline] free_unref_page_prepare+0x7ce/0x8e0 mm/page_alloc.c:2336 free_unref_page+0x32/0x2e0 mm/page_alloc.c:2429 __slab_free+0x35e/0x410 mm/slub.c:3736 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x75/0xe0 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x143/0x160 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x6e/0x4d0 mm/slab.h:767 slab_alloc_node mm/slub.c:3495 [inline] __kmem_cache_alloc_node+0x13e/0x260 mm/slub.c:3534 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0xa4/0x240 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] tomoyo_realpath_from_path+0xe3/0x5d0 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x20f/0x4b0 security/tomoyo/file.c:822 security_inode_getattr+0xd3/0x120 security/security.c:2153 vfs_getattr fs/stat.c:173 [inline] vfs_fstat fs/stat.c:198 [inline] __do_sys_newfstat fs/stat.c:473 [inline] __se_sys_newfstat fs/stat.c:470 [inline] __x64_sys_newfstat+0x101/0x1f0 fs/stat.c:470 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff88802c4cbe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802c4cbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802c4cbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88802c4cc000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802c4cc080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 83 f8 08 cmp $0x8,%eax 3: 0f 83 8a 01 00 00 jae 0x193 9: 41 89 c6 mov %eax,%r14d c: c1 e8 06 shr $0x6,%eax f: 48 8d 3c c5 68 8d 4a lea -0x71b57298(,%rax,8),%rdi 16: 8e 17: be 08 00 00 00 mov $0x8,%esi 1c: e8 54 f3 75 00 call 0x75f375 21: 4c 0f a3 35 14 94 e3 bt %r14,0xce39414(%rip) # 0xce3943d 28: 0c * 29: 73 0d jae 0x38 <-- trapping instruction 2b: e8 f5 9f 08 00 call 0x8a025 30: 84 c0 test %al,%al 32: 0f 84 18 02 00 00 je 0x250 38: 48 c7 c0 1c c2 4a 8e mov $0xffffffff8e4ac21c,%rax