================================================================== BUG: KFENCE: use-after-free read in xfrm_state_lookup_spi_proto net/xfrm/xfrm_state.c:1477 [inline] BUG: KFENCE: use-after-free read in xfrm_alloc_spi+0x3c9/0x11f0 net/xfrm/xfrm_state.c:2302 Use-after-free read at 0xffff88823bd920a0 (in kfence-#200): xfrm_state_lookup_spi_proto net/xfrm/xfrm_state.c:1477 [inline] xfrm_alloc_spi+0x3c9/0x11f0 net/xfrm/xfrm_state.c:2302 pfkey_getspi+0x79a/0xed0 net/key/af_key.c:1385 pfkey_process net/key/af_key.c:2847 [inline] pfkey_sendmsg+0xbed/0x1050 net/key/af_key.c:3698 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 kfence-#200: 0xffff88823bd92000-0xffff88823bd92fff, size=4096, cache=names_cache allocated by task 5157 on cpu 1 at 257.237545s: getname_flags+0xbb/0x500 fs/namei.c:140 vfs_fstatat+0x111/0x1b0 fs/stat.c:298 __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 freed by task 5157 on cpu 1 at 257.237619s: vfs_fstatat+0x134/0x1b0 fs/stat.c:300 __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 CPU: 1 PID: 13472 Comm: syz.1.3186 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 RIP: 0010:xfrm_state_lookup_spi_proto net/xfrm/xfrm_state.c:1477 [inline] RIP: 0010:xfrm_alloc_spi+0x3c9/0x11f0 net/xfrm/xfrm_state.c:2302 Code: c1 08 c1 74 0a e8 07 5f 67 f8 e9 2d 02 00 00 4d 8d a6 a0 00 00 00 4c 89 e0 48 c1 e8 03 42 0f b6 04 38 84 c0 0f 85 b6 01 00 00 <45> 8b 24 24 44 89 e7 89 de e8 59 60 67 f8 41 39 dc 0f 85 eb 00 00 RSP: 0018:ffffc9000c3bf600 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 00000000eaa3a801 RCX: 0000000000080000 RDX: ffffc9000d5aa000 RSI: 00000000000006ae RDI: 00000000000006af RBP: ffffc9000c3bf758 R08: dffffc0000000000 R09: 1ffffffff21b4aa0 R10: dffffc0000000000 R11: fffffbfff21b4aa1 R12: ffff88823bd920a0 R13: 0000000000000100 R14: ffff88823bd92000 R15: dffffc0000000000 FS: 00007ff7173c56c0(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff88823bd920a0 CR3: 000000002e432000 CR4: 00000000003506e0 Call Trace: pfkey_getspi+0x79a/0xed0 net/key/af_key.c:1385 pfkey_process net/key/af_key.c:2847 [inline] pfkey_sendmsg+0xbed/0x1050 net/key/af_key.c:3698 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 RIP: 0033:0x7ff71658ebe9 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:00007ff7173c5038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007ff7167b5fa0 RCX: 00007ff71658ebe9 RDX: 0000000000000000 RSI: 0000200000000040 RDI: 0000000000000003 RBP: 00007ff716611e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ff7167b6038 R14: 00007ff7167b5fa0 R15: 00007fff0e6af3e8 ================================================================== ---------------- Code disassembly (best guess): 0: c1 08 c1 rorl $0xc1,(%rax) 3: 74 0a je 0xf 5: e8 07 5f 67 f8 call 0xf8675f11 a: e9 2d 02 00 00 jmp 0x23c f: 4d 8d a6 a0 00 00 00 lea 0xa0(%r14),%r12 16: 4c 89 e0 mov %r12,%rax 19: 48 c1 e8 03 shr $0x3,%rax 1d: 42 0f b6 04 38 movzbl (%rax,%r15,1),%eax 22: 84 c0 test %al,%al 24: 0f 85 b6 01 00 00 jne 0x1e0 * 2a: 45 8b 24 24 mov (%r12),%r12d <-- trapping instruction 2e: 44 89 e7 mov %r12d,%edi 31: 89 de mov %ebx,%esi 33: e8 59 60 67 f8 call 0xf8676091 38: 41 39 dc cmp %ebx,%r12d 3b: 0f .byte 0xf 3c: 85 eb test %ebp,%ebx