================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0xfc1/0x1180 drivers/hid/hid-mcp2221.c:830 Read of size 1 at addr ffff88802ff3bfff by task udevd/5811 CPU: 1 PID: 5811 Comm: udevd Not tainted 6.6.98-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xac/0x230 mm/kasan/report.c:475 kasan_report+0x117/0x150 mm/kasan/report.c:588 mcp2221_raw_event+0xfc1/0x1180 drivers/hid/hid-mcp2221.c:830 hid_input_report+0x400/0x520 drivers/hid/hid-core.c:2086 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+0x8a3/0x31b0 drivers/usb/gadget/udc/dummy_hcd.c:1993 __run_hrtimer kernel/time/hrtimer.c:1755 [inline] __hrtimer_run_queues+0x51e/0xc40 kernel/time/hrtimer.c:1819 hrtimer_run_softirq+0x187/0x2b0 kernel/time/hrtimer.c:1836 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:memset_orig+0x75/0xac arch/x86/lib/memset_64.S:90 Code: 89 47 30 48 89 47 38 48 8d 7f 40 75 d8 0f 1f 84 00 00 00 00 00 89 d1 83 e1 38 74 14 c1 e9 03 66 0f 1f 44 00 00 ff c9 48 89 07 <48> 8d 7f 08 75 f5 83 e2 07 74 0a ff ca 88 07 48 8d 7f 01 75 f6 4c RSP: 0018:ffffc9000480f478 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffffc9000480f4e8 RCX: 0000000000000000 RDX: 0000000000000060 RSI: 0000000000000000 RDI: ffffc9000480f540 RBP: dffffc0000000000 R08: ffffc9000480f547 R09: 0000000000000000 R10: ffffc9000480f4e8 R11: fffff52000901ea9 R12: 0000000000000000 R13: ffff888076655a00 R14: ffffffff817471a0 R15: 0000000000000000 __unwind_start+0x3e/0x7e0 arch/x86/kernel/unwind_orc.c:688 unwind_start arch/x86/include/asm/unwind.h:64 [inline] arch_stack_walk+0xf8/0x190 arch/x86/kernel/stacktrace.c:24 stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:122 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:1806 [inline] slab_free_freelist_hook+0x130/0x1b0 mm/slub.c:1832 slab_free mm/slub.c:3816 [inline] __kmem_cache_free+0xba/0x1f0 mm/slub.c:3829 tomoyo_realpath_from_path+0x59d/0x5d0 security/tomoyo/realpath.c:286 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_statx+0x15f/0x6d0 fs/stat.c:248 vfs_fstatat+0x12a/0x1b0 fs/stat.c:299 __do_sys_newfstatat fs/stat.c:463 [inline] __se_sys_newfstatat fs/stat.c:457 [inline] __x64_sys_newfstatat+0x117/0x190 fs/stat.c:457 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 RIP: 0033:0x7f61c0511b0a Code: 48 8b 15 f1 f2 0d 00 f7 d8 64 89 02 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 41 89 ca b8 06 01 00 00 0f 05 <3d> 00 f0 ff ff 77 07 31 c0 c3 0f 1f 40 00 48 8b 15 b9 f2 0d 00 f7 RSP: 002b:00007ffe8dd10108 EFLAGS: 00000246 ORIG_RAX: 0000000000000106 RAX: ffffffffffffffda RBX: 00007ffe8dd105a0 RCX: 00007f61c0511b0a RDX: 00007ffe8dd10110 RSI: 00007ffe8dd105a0 RDI: 00000000ffffff9c RBP: 000055d71beb6910 R08: 0000000000000000 R09: 0000000000000020 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe8dd101a0 R13: 00007ffe8dd109d5 R14: 000055d7092cfca4 R15: 000055d7092cfbcc The buggy address belongs to the physical page: page:ffffea0000bfcec0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2ff3b flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 ffffea0000c05188 ffffea0000922a48 0000000000000000 raw: 0000000000000000 0000000000100000 00000000ffffffff 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 5639, tgid 5639 (dhcpcd-run-hook), ts 65441194727, free_ts 92131206743 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:1876 allocate_slab mm/slub.c:2023 [inline] new_slab+0x87/0x2e0 mm/slub.c:2076 ___slab_alloc+0xc6d/0x12f0 mm/slub.c:3230 __slab_alloc mm/slub.c:3329 [inline] __slab_alloc_node mm/slub.c:3382 [inline] slab_alloc_node mm/slub.c:3475 [inline] slab_alloc mm/slub.c:3493 [inline] __kmem_cache_alloc_lru mm/slub.c:3500 [inline] kmem_cache_alloc+0x1b7/0x2e0 mm/slub.c:3509 vm_area_dup+0x27/0x270 kernel/fork.c:501 dup_mmap kernel/fork.c:711 [inline] dup_mm kernel/fork.c:1692 [inline] copy_mm+0xc08/0x1c20 kernel/fork.c:1741 copy_process+0x16d3/0x3d70 kernel/fork.c:2506 kernel_clone+0x21b/0x840 kernel/fork.c:2914 __do_sys_clone kernel/fork.c:3057 [inline] __se_sys_clone kernel/fork.c:3041 [inline] __x64_sys_clone+0x18c/0x1e0 kernel/fork.c:3041 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 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:3722 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:3485 [inline] kmem_cache_alloc_node+0x150/0x330 mm/slub.c:3530 __alloc_skb+0x108/0x2c0 net/core/skbuff.c:640 alloc_skb include/linux/skbuff.h:1284 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1195 [inline] netlink_sendmsg+0x65b/0xbe0 net/netlink/af_netlink.c:1866 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x5bf/0x950 net/socket.c:2595 ___sys_sendmsg+0x220/0x290 net/socket.c:2649 __sys_sendmsg net/socket.c:2678 [inline] __do_sys_sendmsg net/socket.c:2687 [inline] __se_sys_sendmsg+0x1a5/0x270 net/socket.c:2685 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: ffff88802ff3be80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802ff3bf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88802ff3bf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88802ff3c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802ff3c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 89 47 30 mov %eax,0x30(%rdi) 3: 48 89 47 38 mov %rax,0x38(%rdi) 7: 48 8d 7f 40 lea 0x40(%rdi),%rdi b: 75 d8 jne 0xffffffe5 d: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1) 14: 00 15: 89 d1 mov %edx,%ecx 17: 83 e1 38 and $0x38,%ecx 1a: 74 14 je 0x30 1c: c1 e9 03 shr $0x3,%ecx 1f: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 25: ff c9 dec %ecx 27: 48 89 07 mov %rax,(%rdi) * 2a: 48 8d 7f 08 lea 0x8(%rdi),%rdi <-- trapping instruction 2e: 75 f5 jne 0x25 30: 83 e2 07 and $0x7,%edx 33: 74 0a je 0x3f 35: ff ca dec %edx 37: 88 07 mov %al,(%rdi) 39: 48 8d 7f 01 lea 0x1(%rdi),%rdi 3d: 75 f6 jne 0x35 3f: 4c rex.WR