CVE-2025-39913

Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
01/10/2025
Last modified:
16/01/2026

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> tcp_bpf: Call sk_msg_free() when tcp_bpf_send_verdict() fails to allocate psock-&gt;cork.<br /> <br /> syzbot reported the splat below. [0]<br /> <br /> The repro does the following:<br /> <br /> 1. Load a sk_msg prog that calls bpf_msg_cork_bytes(msg, cork_bytes)<br /> 2. Attach the prog to a SOCKMAP<br /> 3. Add a socket to the SOCKMAP<br /> 4. Activate fault injection<br /> 5. Send data less than cork_bytes<br /> <br /> At 5., the data is carried over to the next sendmsg() as it is<br /> smaller than the cork_bytes specified by bpf_msg_cork_bytes().<br /> <br /> Then, tcp_bpf_send_verdict() tries to allocate psock-&gt;cork to hold<br /> the data, but this fails silently due to fault injection + __GFP_NOWARN.<br /> <br /> If the allocation fails, we need to revert the sk-&gt;sk_forward_alloc<br /> change done by sk_msg_alloc().<br /> <br /> Let&amp;#39;s call sk_msg_free() when tcp_bpf_send_verdict fails to allocate<br /> psock-&gt;cork.<br /> <br /> The "*copied" also needs to be updated such that a proper error can<br /> be returned to the caller, sendmsg. It fails to allocate psock-&gt;cork.<br /> Nothing has been corked so far, so this patch simply sets "*copied"<br /> to 0.<br /> <br /> [0]:<br /> WARNING: net/ipv4/af_inet.c:156 at inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156, CPU#1: syz-executor/5983<br /> Modules linked in:<br /> CPU: 1 UID: 0 PID: 5983 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full)<br /> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025<br /> RIP: 0010:inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156<br /> Code: 0f 0b 90 e9 62 fe ff ff e8 7a db b5 f7 90 0f 0b 90 e9 95 fe ff ff e8 6c db b5 f7 90 0f 0b 90 e9 bb fe ff ff e8 5e db b5 f7 90 0b 90 e9 e1 fe ff ff 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 9f fc<br /> RSP: 0018:ffffc90000a08b48 EFLAGS: 00010246<br /> RAX: ffffffff8a09d0b2 RBX: dffffc0000000000 RCX: ffff888024a23c80<br /> RDX: 0000000000000100 RSI: 0000000000000fff RDI: 0000000000000000<br /> RBP: 0000000000000fff R08: ffff88807e07c627 R09: 1ffff1100fc0f8c4<br /> R10: dffffc0000000000 R11: ffffed100fc0f8c5 R12: ffff88807e07c380<br /> R13: dffffc0000000000 R14: ffff88807e07c60c R15: 1ffff1100fc0f872<br /> FS: 00005555604c4500(0000) GS:ffff888125af1000(0000) knlGS:0000000000000000<br /> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033<br /> CR2: 00005555604df5c8 CR3: 0000000032b06000 CR4: 00000000003526f0<br /> Call Trace:<br /> <br /> __sk_destruct+0x86/0x660 net/core/sock.c:2339<br /> rcu_do_batch kernel/rcu/tree.c:2605 [inline]<br /> rcu_core+0xca8/0x1770 kernel/rcu/tree.c:2861<br /> handle_softirqs+0x286/0x870 kernel/softirq.c:579<br /> __do_softirq kernel/softirq.c:613 [inline]<br /> invoke_softirq kernel/softirq.c:453 [inline]<br /> __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680<br /> irq_exit_rcu+0x9/0x30 kernel/softirq.c:696<br /> instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline]<br /> sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052<br />

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.17 (including) 5.4.300 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.5 (including) 5.10.245 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.11 (including) 5.15.194 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.16 (including) 6.1.153 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.2 (including) 6.6.107 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.7 (including) 6.12.48 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.13 (including) 6.16.8 (excluding)
cpe:2.3:o:linux:linux_kernel:6.17:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.17:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.17:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.17:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.17:rc5:*:*:*:*:*:*
cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*