================================================================== BUG: KASAN: use-after-free in mcp2221_raw_event+0x106a/0x1240 drivers/hid/hid-mcp2221.c:957 Read of size 1 at addr ffff888061763fff by task rm/12002 CPU: 0 UID: 0 PID: 12002 Comm: rm Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 mcp2221_raw_event+0x106a/0x1240 drivers/hid/hid-mcp2221.c:957 __hid_input_report drivers/hid/hid-core.c:2139 [inline] hid_input_report+0x41d/0x580 drivers/hid/hid-core.c:2166 hid_irq_in+0x47e/0x6d0 drivers/hid/usbhid/hid-core.c:286 __usb_hcd_giveback_urb+0x376/0x540 drivers/usb/core/hcd.c:1657 dummy_timer+0xbc0/0x4650 drivers/usb/gadget/udc/dummy_hcd.c:2005 __run_hrtimer kernel/time/hrtimer.c:1930 [inline] __hrtimer_run_queues+0x3c0/0xa20 kernel/time/hrtimer.c:1994 hrtimer_run_softirq+0x17a/0x240 kernel/time/hrtimer.c:2011 handle_softirqs+0x22a/0x840 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xca/0x220 kernel/softirq.c:735 irq_exit_rcu+0x9/0x30 kernel/softirq.c:752 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1061 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1061 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 RIP: 0010:count_memcg_events+0xa5/0x280 mm/memcontrol.c:1033 Code: 4d 8d af 58 07 00 00 4c 89 e8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df 80 3c 08 00 74 08 4c 89 ef e8 df 46 f8 ff 4d 8b 6d 00 <41> 80 fc 17 0f 83 d7 00 00 00 65 4f 01 b4 e5 c8 01 00 00 4c 89 ff RSP: 0018:ffffc90003827bc0 EFLAGS: 00000246 RAX: 1ffff110038df45b RBX: 0000000000000017 RCX: dffffc0000000000 RDX: 0000000000000001 RSI: ffffffff8bdcd7e0 RDI: ffffffff8c2a9260 RBP: 0000000000000000 R08: ffffffff821673a1 R09: ffffffff8e95d260 R10: dffffc0000000000 R11: fffffbfff20677df R12: 0000000000000004 R13: ffffffff9343dfc0 R14: 0000000000000001 R15: ffff88801c6f9b80 count_memcg_events_mm include/linux/memcontrol.h:973 [inline] count_memcg_event_mm+0x14c/0x260 include/linux/memcontrol.h:980 mm_account_fault mm/memory.c:6626 [inline] handle_mm_fault+0x264a/0x3170 mm/memory.c:6787 do_user_addr_fault+0xa73/0x1340 arch/x86/mm/fault.c:1334 handle_page_fault arch/x86/mm/fault.c:1474 [inline] exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1527 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618 RIP: 0033:0x7f415bb5ca16 Code: 74 07 83 0d eb 68 12 00 01 31 c0 c3 0f 1f 84 00 00 00 00 00 81 ef b9 00 00 00 83 ff 0c 0f 87 d1 00 00 00 48 8d 15 8a a8 0d 00 <48> 63 04 ba 48 01 d0 ff e0 90 48 8b 05 81 f4 11 00 48 8b 80 70 02 RSP: 002b:00007ffcc1d6fa38 EFLAGS: 00010297 RAX: 0000000000000005 RBX: 00007f415bd8ba80 RCX: 00007ffcc1d6fa40 RDX: 00007f415bc372a0 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 00007ffcc1d6fd60 R08: ffffffffffffffff R09: 0000000000000000 R10: 00007ffcc1d6fa90 R11: 0000000000000246 R12: fffffffffffffff8 R13: 000000dbbe19029d R14: 0000000000000000 R15: 00007f415bd8d310 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffffffffffffffff pfn:0x61763 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 00000000ffffffff 0000000000000000 raw: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5591, tgid 5591 (rm), ts 57263032271, free_ts 90908293316 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1858 prep_new_page mm/page_alloc.c:1866 [inline] get_page_from_freelist+0x24ba/0x2540 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5226 alloc_slab_page mm/slub.c:3278 [inline] allocate_slab+0x77/0x660 mm/slub.c:3467 new_slab mm/slub.c:3525 [inline] refill_objects+0x339/0x3d0 mm/slub.c:7247 refill_sheaf mm/slub.c:2816 [inline] __prefill_sheaf_pfmemalloc mm/slub.c:4968 [inline] kmem_cache_prefill_sheaf+0x2e1/0x530 mm/slub.c:5057 mt_get_sheaf lib/maple_tree.c:154 [inline] mas_alloc_nodes+0x1c2/0x350 lib/maple_tree.c:1119 mas_preallocate+0x2d6/0x640 lib/maple_tree.c:4961 vma_iter_prealloc mm/vma.h:577 [inline] __split_vma+0x318/0xa40 mm/vma.c:529 vms_gather_munmap_vmas+0x4fa/0x1380 mm/vma.c:1448 __mmap_setup mm/vma.c:2439 [inline] __mmap_region mm/vma.c:2753 [inline] mmap_region+0x856/0x2280 mm/vma.c:2856 do_mmap+0xc39/0x10c0 mm/mmap.c:560 vm_mmap_pgoff+0x2c9/0x4f0 mm/util.c:581 ksys_mmap_pgoff+0x51e/0x760 mm/mmap.c:606 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5961 tgid 5961 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0xbc7/0xd30 mm/page_alloc.c:2943 __slab_free+0x274/0x2c0 mm/slub.c:5605 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x99/0x100 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4569 [inline] slab_alloc_node mm/slub.c:4898 [inline] __do_kmalloc_node mm/slub.c:5291 [inline] __kmalloc_noprof+0x316/0x760 mm/slub.c:5304 kmalloc_noprof include/linux/slab.h:954 [inline] tomoyo_realpath_from_path+0xe3/0x5d0 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x229/0x470 security/tomoyo/file.c:776 security_file_open+0xa9/0x240 security/security.c:2637 do_dentry_open+0x384/0x14e0 fs/open.c:924 vfs_open+0x3b/0x340 fs/open.c:1079 do_open fs/namei.c:4699 [inline] path_openat+0x2e08/0x3860 fs/namei.c:4858 do_file_open+0x23e/0x4a0 fs/namei.c:4887 do_sys_openat2+0x113/0x200 fs/open.c:1364 do_sys_open fs/open.c:1370 [inline] __do_sys_openat fs/open.c:1386 [inline] __se_sys_openat fs/open.c:1381 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1381 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 Memory state around the buggy address: ffff888061763e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888061763f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888061763f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888061764000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888061764080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 4d 8d af 58 07 00 00 lea 0x758(%r15),%r13 7: 4c 89 e8 mov %r13,%rax a: 48 c1 e8 03 shr $0x3,%rax e: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx 15: fc ff df 18: 80 3c 08 00 cmpb $0x0,(%rax,%rcx,1) 1c: 74 08 je 0x26 1e: 4c 89 ef mov %r13,%rdi 21: e8 df 46 f8 ff call 0xfff84705 26: 4d 8b 6d 00 mov 0x0(%r13),%r13 * 2a: 41 80 fc 17 cmp $0x17,%r12b <-- trapping instruction 2e: 0f 83 d7 00 00 00 jae 0x10b 34: 65 4f 01 b4 e5 c8 01 add %r14,%gs:0x1c8(%r13,%r12,8) 3b: 00 00 3d: 4c 89 ff mov %r15,%rdi