================================================================== BUG: KFENCE: use-after-free read in __xfrm_state_lookup_all net/xfrm/xfrm_state.c:-1 [inline] BUG: KFENCE: use-after-free read in xfrm_state_find+0x2820/0x5400 net/xfrm/xfrm_state.c:1499 Use-after-free read at 0xffff88823be92f70 (in kfence-#72): __xfrm_state_lookup_all net/xfrm/xfrm_state.c:-1 [inline] xfrm_state_find+0x2820/0x5400 net/xfrm/xfrm_state.c:1499 xfrm_tmpl_resolve_one net/xfrm/xfrm_policy.c:2522 [inline] xfrm_tmpl_resolve net/xfrm/xfrm_policy.c:2573 [inline] xfrm_resolve_and_create_bundle+0x768/0x2f90 net/xfrm/xfrm_policy.c:2871 xfrm_bundle_lookup net/xfrm/xfrm_policy.c:3106 [inline] xfrm_lookup_with_ifid+0x58a/0x1a70 net/xfrm/xfrm_policy.c:3237 xfrm_lookup net/xfrm/xfrm_policy.c:3336 [inline] xfrm_lookup_route+0x3c/0x1c0 net/xfrm/xfrm_policy.c:3347 ip_route_connect include/net/route.h:355 [inline] __ip4_datagram_connect+0x9a5/0x1270 net/ipv4/datagram.c:49 udp_connect+0x33/0x1f0 net/ipv4/udp.c:2153 __sys_connect_file net/socket.c:2086 [inline] __sys_connect+0x313/0x440 net/socket.c:2105 __do_sys_connect net/socket.c:2111 [inline] __se_sys_connect net/socket.c:2108 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2108 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f kfence-#72: 0xffff88823be92ff8-0xffff88823be92fff, size=8, cache=kmalloc-8 allocated by task 5891 on cpu 1 at 172.994660s (4.399813s ago): kmalloc_noprof include/linux/slab.h:905 [inline] usb_control_msg+0x73/0x3e0 drivers/usb/core/message.c:144 usb_clear_port_feature drivers/usb/core/hub.c:460 [inline] hub_port_reset+0x416/0x1750 drivers/usb/core/hub.c:3106 hub_port_init+0xfb9/0x2800 drivers/usb/core/hub.c:5055 hub_port_connect drivers/usb/core/hub.c:5495 [inline] hub_port_connect_change drivers/usb/core/hub.c:5706 [inline] port_event drivers/usb/core/hub.c:5866 [inline] hub_event+0x2518/0x4a00 drivers/usb/core/hub.c:5948 process_one_work kernel/workqueue.c:3239 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3322 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3403 kthread+0x70e/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 freed by task 5891 on cpu 1 at 172.994822s (4.451908s ago): usb_control_msg+0x2bf/0x3e0 drivers/usb/core/message.c:160 usb_clear_port_feature drivers/usb/core/hub.c:460 [inline] hub_port_reset+0x416/0x1750 drivers/usb/core/hub.c:3106 hub_port_init+0xfb9/0x2800 drivers/usb/core/hub.c:5055 hub_port_connect drivers/usb/core/hub.c:5495 [inline] hub_port_connect_change drivers/usb/core/hub.c:5706 [inline] port_event drivers/usb/core/hub.c:5866 [inline] hub_event+0x2518/0x4a00 drivers/usb/core/hub.c:5948 process_one_work kernel/workqueue.c:3239 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3322 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3403 kthread+0x70e/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 CPU: 0 UID: 0 PID: 7035 Comm: syz.2.306 Not tainted 6.16.0-rc6-next-20250714-syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 RIP: 0010:__xfrm_state_lookup_all net/xfrm/xfrm_state.c:-1 [inline] RIP: 0010:xfrm_state_find+0x2820/0x5400 net/xfrm/xfrm_state.c:1499 Code: 83 e6 0c bf 08 00 00 00 44 89 f6 e8 ba 03 9c f7 4d 8d a5 30 03 00 00 4c 89 e0 48 c1 e8 03 0f b6 04 18 84 c0 0f 85 bc 04 00 00 <45> 0f b6 24 24 41 83 e4 0c bf 08 00 00 00 44 89 e6 e8 8a 03 9c f7 RSP: 0018:ffffc90018ecf500 EFLAGS: 00010246 RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000002 RDX: ffff88802d8ada00 RSI: 0000000000000000 RDI: 0000000000000008 RBP: ffffc90018ecf720 R08: ffff88802d8ada00 R09: 0000000000000002 R10: 000000000000000a R11: 0000000000000002 R12: ffff88823be92f70 R13: ffff88823be92c40 R14: 0000000000000000 R15: 1ffff1100fe31848 FS: 00007f49916756c0(0000) GS:ffff8881257b4000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff88823be92f70 CR3: 0000000033150000 CR4: 00000000003526f0 Call Trace: xfrm_tmpl_resolve_one net/xfrm/xfrm_policy.c:2522 [inline] xfrm_tmpl_resolve net/xfrm/xfrm_policy.c:2573 [inline] xfrm_resolve_and_create_bundle+0x768/0x2f90 net/xfrm/xfrm_policy.c:2871 xfrm_bundle_lookup net/xfrm/xfrm_policy.c:3106 [inline] xfrm_lookup_with_ifid+0x58a/0x1a70 net/xfrm/xfrm_policy.c:3237 xfrm_lookup net/xfrm/xfrm_policy.c:3336 [inline] xfrm_lookup_route+0x3c/0x1c0 net/xfrm/xfrm_policy.c:3347 ip_route_connect include/net/route.h:355 [inline] __ip4_datagram_connect+0x9a5/0x1270 net/ipv4/datagram.c:49 udp_connect+0x33/0x1f0 net/ipv4/udp.c:2153 __sys_connect_file net/socket.c:2086 [inline] __sys_connect+0x313/0x440 net/socket.c:2105 __do_sys_connect net/socket.c:2111 [inline] __se_sys_connect net/socket.c:2108 [inline] __x64_sys_connect+0x7a/0x90 net/socket.c:2108 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f499078e929 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4991675038 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007f49909b5fa0 RCX: 00007f499078e929 RDX: 0000000000000010 RSI: 0000200000000480 RDI: 0000000000000005 RBP: 00007f4990810b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f49909b5fa0 R15: 00007ffdfab49f68 ================================================================== ---------------- Code disassembly (best guess): 0: 83 e6 0c and $0xc,%esi 3: bf 08 00 00 00 mov $0x8,%edi 8: 44 89 f6 mov %r14d,%esi b: e8 ba 03 9c f7 call 0xf79c03ca 10: 4d 8d a5 30 03 00 00 lea 0x330(%r13),%r12 17: 4c 89 e0 mov %r12,%rax 1a: 48 c1 e8 03 shr $0x3,%rax 1e: 0f b6 04 18 movzbl (%rax,%rbx,1),%eax 22: 84 c0 test %al,%al 24: 0f 85 bc 04 00 00 jne 0x4e6 * 2a: 45 0f b6 24 24 movzbl (%r12),%r12d <-- trapping instruction 2f: 41 83 e4 0c and $0xc,%r12d 33: bf 08 00 00 00 mov $0x8,%edi 38: 44 89 e6 mov %r12d,%esi 3b: e8 8a 03 9c f7 call 0xf79c03ca