==================================================================
BUG: KASAN: use-after-free in mcp2221_raw_event+0xf94/0x1030 drivers/hid/hid-mcp2221.c:944
Read of size 1 at addr ffff888056783fff by task sed/6359
CPU: 0 UID: 0 PID: 6359 Comm: sed Not tainted syzkaller #0 PREEMPT(full)
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
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+0xf94/0x1030 drivers/hid/hid-mcp2221.c:944
__hid_input_report.constprop.0+0x311/0x450 drivers/hid/hid-core.c:2130
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+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+0x216/0x8e0 kernel/softirq.c:579
__do_softirq kernel/softirq.c:613 [inline]
invoke_softirq kernel/softirq.c:453 [inline]
__irq_exit_rcu+0x109/0x170 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+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1050
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:lock_acquire+0x62/0x350 kernel/locking/lockdep.c:5872
Code: a9 3e 12 83 f8 07 0f 87 bc 02 00 00 89 c0 48 0f a3 05 52 84 13 0f 0f 82 74 02 00 00 8b 35 0a b6 13 0f 85 f6 0f 85 8d 00 00 00 <48> 8b 44 24 30 65 48 2b 05 a9 a8 3e 12 0f 85 c7 02 00 00 48 83 c4
RSP: 0000:ffffc9000c1afa60 EFLAGS: 00000206
RAX: 0000000000000046 RBX: ffff8880b8433340 RCX: ffffffff93e31c00
RDX: 0000000000000000 RSI: ffffffff8de2ace0 RDI: ffffffff8c162900
RBP: 0000000000000000 R08: 65e71314f7a92863 R09: 0000000000000001
R10: 0000000000000003 R11: 0000000000000000 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
local_lock_acquire include/linux/local_lock_internal.h:38 [inline]
__folio_batch_add_and_move+0x6b3/0xc90 mm/swap.c:192
folio_add_lru_vma+0xb0/0x100 mm/swap.c:529
wp_page_copy mm/memory.c:3620 [inline]
do_wp_page+0x16c7/0x4f00 mm/memory.c:4013
handle_pte_fault mm/memory.c:6068 [inline]
__handle_mm_fault+0x1b2d/0x2a50 mm/memory.c:6195
handle_mm_fault+0x589/0xd10 mm/memory.c:6364
do_user_addr_fault+0x60c/0x1370 arch/x86/mm/fault.c:1336
handle_page_fault arch/x86/mm/fault.c:1476 [inline]
exc_page_fault+0x5c/0xb0 arch/x86/mm/fault.c:1532
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0033:0x7f28ede9f8ec
Code: 1f 80 00 00 00 00 48 8b 31 8b 51 08 4c 01 fe 48 83 fa 26 74 0a 48 83 fa 08 0f 85 ef 3c ff ff 48 8b 51 10 48 83 c1 18 4c 01 fa <48> 89 16 48 39 d9 72 d4 4d 8b 9a 08 02 00 00 4d 85 db 0f 84 ec 0b
RSP: 002b:00007fff39db65e0 EFLAGS: 00010206
RAX: 00007f28eddc7cd0 RBX: 00007f28eddd1280 RCX: 00007f28eddcdd40
RDX: 00007f28eddd7a00 RSI: 00007f28ede840f0 RDI: 00007f28eddd54c8
RBP: 00007fff39db6700 R08: 00007f28eddd2f90 R09: 00007f28eddd54c8
R10: 00007f28ede880c0 R11: 0000000000000000 R12: 00007fff39db6690
R13: 00007fff39db6690 R14: 00007f28ede880c0 R15: 00007f28eddc6000
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x56783
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 13, tgid 13 (kworker/u8:1), ts 67793357079, free_ts 81869054325
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851
prep_new_page mm/page_alloc.c:1859 [inline]
get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858
__alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148
alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416
alloc_slab_page mm/slub.c:2487 [inline]
allocate_slab mm/slub.c:2655 [inline]
new_slab+0x247/0x330 mm/slub.c:2709
___slab_alloc+0xcf2/0x1740 mm/slub.c:3891
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3981
__slab_alloc_node mm/slub.c:4056 [inline]
slab_alloc_node mm/slub.c:4217 [inline]
kmem_cache_alloc_node_noprof+0xf5/0x3b0 mm/slub.c:4281
kmalloc_reserve+0x18b/0x2c0 net/core/skbuff.c:578
__alloc_skb+0x166/0x380 net/core/skbuff.c:669
alloc_skb include/linux/skbuff.h:1336 [inline]
nlmsg_new include/net/netlink.h:1055 [inline]
inet6_rt_notify+0x1e0/0x4b0 net/ipv6/route.c:6347
fib6_add_rt2node+0x24ba/0x3670 net/ipv6/ip6_fib.c:1275
fib6_add+0x628/0x1d90 net/ipv6/ip6_fib.c:1528
__ip6_ins_rt net/ipv6/route.c:1351 [inline]
ip6_ins_rt+0xb5/0x110 net/ipv6/route.c:1361
__ipv6_ifa_notify+0xa73/0xd60 net/ipv6/addrconf.c:6283
ipv6_ifa_notify net/ipv6/addrconf.c:6322 [inline]
addrconf_dad_completed+0x19a/0x10d0 net/ipv6/addrconf.c:4320
page last free pid 5866 tgid 5866 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
__free_frozen_pages+0x7d5/0x10f0 mm/page_alloc.c:2895
discard_slab mm/slub.c:2753 [inline]
__put_partials+0x165/0x1c0 mm/slub.c:3218
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:340
kasan_slab_alloc include/linux/kasan.h:250 [inline]
slab_post_alloc_hook mm/slub.c:4180 [inline]
slab_alloc_node mm/slub.c:4229 [inline]
kmem_cache_alloc_node_noprof+0x1d5/0x3b0 mm/slub.c:4281
__alloc_skb+0x2b2/0x380 net/core/skbuff.c:659
alloc_skb include/linux/skbuff.h:1336 [inline]
alloc_skb_with_frags+0xe0/0x860 net/core/skbuff.c:6665
sock_alloc_send_pskb+0x7fb/0x990 net/core/sock.c:2980
unix_dgram_sendmsg+0x3e9/0x17f0 net/unix/af_unix.c:2153
sock_sendmsg_nosec net/socket.c:714 [inline]
__sock_sendmsg net/socket.c:729 [inline]
sock_write_iter+0x4ff/0x5b0 net/socket.c:1179
new_sync_write fs/read_write.c:593 [inline]
vfs_write+0x7d0/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/0x4c0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff888056783e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888056783f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888056783f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888056784000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888056784080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 3e 12 83 f8 07 0f 87 ds adc -0x78f0f808(%rbx),%al
7: bc 02 00 00 89 mov $0x89000002,%esp
c: c0 48 0f a3 rorb $0xa3,0xf(%rax)
10: 05 52 84 13 0f add $0xf138452,%eax
15: 0f 82 74 02 00 00 jb 0x28f
1b: 8b 35 0a b6 13 0f mov 0xf13b60a(%rip),%esi # 0xf13b62b
21: 85 f6 test %esi,%esi
23: 0f 85 8d 00 00 00 jne 0xb6
* 29: 48 8b 44 24 30 mov 0x30(%rsp),%rax <-- trapping instruction
2e: 65 48 2b 05 a9 a8 3e sub %gs:0x123ea8a9(%rip),%rax # 0x123ea8df
35: 12
36: 0f 85 c7 02 00 00 jne 0x303
3c: 48 rex.W
3d: 83 .byte 0x83
3e: c4 .byte 0xc4