tcp_bpf: Call sk_msg_free() when tcp_bpf_send_verdict() fails to allocate psock->cork.
In the Linux kernel, the following vulnerability has been resolved: tcp_bpf: Call sk_msg_free() when tcp_bpf_send_verdict() fails to allocate psock->cork. syzbot reported the splat below. [0] The repro does the following: 1. Load a sk_msg prog that calls bpf_msg_cork_bytes(msg, cork_bytes) 2. Attach the prog to a SOCKMAP 3. Add a socket to the SOCKMAP 4. Activate fault injection 5. Send data less than cork_bytes At 5., the data is carried over to the next sendmsg() as it is smaller than the cork_bytes specified by bpf_msg_cork_bytes(). Then, tcp_bpf_send_verdict() tries to allocate psock->cork to hold the data, but this fails silently due to fault injection + __GFP_NOWARN. If the allocation fails, we need to revert the sk->sk_forward_alloc change done by sk_msg_alloc(). Let's call sk_msg_free() when tcp_bpf_send_verdict fails to allocate psock->cork. The "*copied" also needs to be updated such that a proper error can be returned to the caller, sendmsg. It fails to allocate psock->cork. Nothing has been corked so far, so this patch simply sets "*copied" to 0. [0]: WARNING: net/ipv4/af_inet.c:156 at inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156, CPU#1: syz-executor/5983 Modules linked in: CPU: 1 UID: 0 PID: 5983 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 RIP: 0010:inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156 Code: 0f 0b 90 e9 62 fe ff ff e8 7a db b5 f7 90 0f
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.10.245, 5.15.194, 5.4.300, 6.1.153, 6.12.48, 6.16.8, 6.6.107
- CVEs
- CVE-2025-39913
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 2 Nov 2026, 18:25 UTC · Revision 1
Source evidence
tcp_bpf: Call sk_msg_free() when tcp_bpf_send_verdict() fails to allocate psock->cork.
core-osv · Original sourcePublished 1 Oct 2025, 07:44 UTC
In the Linux kernel, the following vulnerability has been resolved: tcp_bpf: Call sk_msg_free() when tcp_bpf_send_verdict() fails to allocate psock->cork. syzbot reported the splat below. [0] The repro does the following: 1. Load a sk_msg prog that calls bpf_msg_cork_bytes(msg, cork_bytes) 2. Attach the prog to a SOCKMAP 3. Add a socket to the SOCKMAP 4. Activate fault injection 5. Send data less than cork_bytes At 5., the data is carried over to the next sendmsg() as it is smaller than the cork_bytes specified by bpf_msg_cork_bytes(). Then, tcp_bpf_send_verdict() tries to allocate psock->cork to hold the data, but this fails silently due to fault injection + __GFP_NOWARN. If the allocation fails, we need to revert the sk->sk_forward_alloc change done by sk_msg_alloc(). Let's call sk_msg_free() when tcp_bpf_send_verdict fails to allocate psock->cork. The "*copied" also needs to be updated such that a proper error can be returned to the caller, sendmsg. It fails to allocate psock->cork. Nothing has been corked so far, so this patch simply sets "*copied" to 0. [0]: WARNING: net/ipv4/af_inet.c:156 at inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156, CPU#1: syz-executor/5983 Modules linked in: CPU: 1 UID: 0 PID: 5983 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 RIP: 0010:inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156 Code: 0f 0b 90 e9 62 fe ff ff e8 7a db b5 f7 90 0f
osv:CVE-2025-39913
Kernel
Fixed versions: 5.4.300, 5.10.245, 5.15.194, 6.1.153, 6.6.107, 6.12.48, 6.16.8
Complete source record
{
"id": "e650fa85954d8bd6020a168d2574c3a0700d3986f548180504ff79f7c76901a4",
"url": "https://osv.dev/vulnerability/CVE-2025-39913",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "tcp_bpf: Call sk_msg_free() when tcp_bpf_send_verdict() fails to allocate psock->cork.",
"summary": "In the Linux kernel, the following vulnerability has been resolved: tcp_bpf: Call sk_msg_free() when tcp_bpf_send_verdict() fails to allocate psock->cork. syzbot reported the splat below. [0] The repro does the following: 1. Load a sk_msg prog that calls bpf_msg_cork_bytes(msg, cork_bytes) 2. Attach the prog to a SOCKMAP 3. Add a socket to the SOCKMAP 4. Activate fault injection 5. Send data less than cork_bytes At 5., the data is carried over to the next sendmsg() as it is smaller than the cork_bytes specified by bpf_msg_cork_bytes(). Then, tcp_bpf_send_verdict() tries to allocate psock->cork to hold the data, but this fails silently due to fault injection + __GFP_NOWARN. If the allocation fails, we need to revert the sk->sk_forward_alloc change done by sk_msg_alloc(). Let's call sk_msg_free() when tcp_bpf_send_verdict fails to allocate psock->cork. The \"*copied\" also needs to be updated such that a proper error can be returned to the caller, sendmsg. It fails to allocate psock->cork. Nothing has been corked so far, so this patch simply sets \"*copied\" to 0. [0]: WARNING: net/ipv4/af_inet.c:156 at inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156, CPU#1: syz-executor/5983 Modules linked in: CPU: 1 UID: 0 PID: 5983 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 RIP: 0010:inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156 Code: 0f 0b 90 e9 62 fe ff ff e8 7a db b5 f7 90 0f",
"evidence": "osv:CVE-2025-39913",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.4.300",
"evidence": "/affected/1/ranges"
},
{
"value": "5.10.245",
"evidence": "/affected/1/ranges"
},
{
"value": "5.15.194",
"evidence": "/affected/1/ranges"
},
{
"value": "6.1.153",
"evidence": "/affected/1/ranges"
},
{
"value": "6.6.107",
"evidence": "/affected/1/ranges"
},
{
"value": "6.12.48",
"evidence": "/affected/1/ranges"
},
{
"value": "6.16.8",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2025-39913",
"aliases": [
"CVE-2025-39913"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "4f738adba30a7cfc006f605707e7aee847ffefa0"
},
{
"fixed": "08f58d10f5abf11d297cc910754922498c921f91"
},
{
"fixed": "05366527f44cf4b884f3d9462ae8009be9665856"
},
{
"fixed": "7429b8b9bfbc276fd304fbaebc405f46b421fedf"
},
{
"fixed": "9c2a6456bdf9794474460d885c359b6c4522d6e3"
},
{
"fixed": "66bcb04a441fbf15d66834b7e3eefb313dd750c8"
},
{
"fixed": "539920180c55f5e13a2488a2339f94e6b8cb69e0"
},
{
"fixed": "de89e58368f8f07df005ecc1c86ad94898a999f2"
},
{
"fixed": "a3967baad4d533dc254c31e0d221e51c8d223d58"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-39913.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "4.17.0"
},
{
"fixed": "5.4.300"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.5.0"
},
{
"fixed": "5.10.245"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.11.0"
},
{
"fixed": "5.15.194"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "6.1.153"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.6.107"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.12.48"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.13.0"
},
{
"fixed": "6.16.8"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-39913.json"
}
}
],
"modified": "2026-10-28T02:30:22.044052669Z",
"provider": "osv",
"references": [
"https://cert-portal.siemens.com/productcert/html/ssa-253495.html",
"https://git.kernel.org/stable/c/05366527f44cf4b884f3d9462ae8009be9665856",
"https://git.kernel.org/stable/c/08f58d10f5abf11d297cc910754922498c921f91",
"https://git.kernel.org/stable/c/539920180c55f5e13a2488a2339f94e6b8cb69e0",
"https://git.kernel.org/stable/c/66bcb04a441fbf15d66834b7e3eefb313dd750c8",
"https://git.kernel.org/stable/c/7429b8b9bfbc276fd304fbaebc405f46b421fedf",
"https://git.kernel.org/stable/c/9c2a6456bdf9794474460d885c359b6c4522d6e3",
"https://git.kernel.org/stable/c/a3967baad4d533dc254c31e0d221e51c8d223d58",
"https://git.kernel.org/stable/c/de89e58368f8f07df005ecc1c86ad94898a999f2",
"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39913.json",
"https://nvd.nist.gov/vuln/detail/CVE-2025-39913",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39913.json"
}
},
"related_cves": [
{
"value": "CVE-2025-39913",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 488355,
"published_at": "2025-10-01T07:44:36.244+00:00"
}