In the Linux kernel, the following vulnerability has been resolved:
tcpbpf: Call skmsgfree() when tcpbpfsendverdict() fails to allocate psock->cork.
syzbot reported the splat below. [0]
The repro does the following:
At 5., the data is carried over to the next sendmsg() as it is smaller than the corkbytes specified by bpfmsgcorkbytes().
Then, tcpbpfsendverdict() 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->skforwardalloc change done by skmsgalloc().
Let's call skmsgfree() when tcpbpfsend_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.
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:inetsockdestruct+0x623/0x730 net/ipv4/afinet.c:156 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 <0f> 0b 90 e9 e1 fe ff ff 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 9f fc RSP: 0018:ffffc90000a08b48 EFLAGS: 00010246 RAX: ffffffff8a09d0b2 RBX: dffffc0000000000 RCX: ffff888024a23c80 RDX: 0000000000000100 RSI: 0000000000000fff RDI: 0000000000000000 RBP: 0000000000000fff R08: ffff88807e07c627 R09: 1ffff1100fc0f8c4 R10: dffffc0000000000 R11: ffffed100fc0f8c5 R12: ffff88807e07c380 R13: dffffc0000000000 R14: ffff88807e07c60c R15: 1ffff1100fc0f872 FS: 00005555604c4500(0000) GS:ffff888125af1000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005555604df5c8 CR3: 0000000032b06000 CR4: 00000000003526f0 Call Trace: <IRQ> _skdestruct+0x86/0x660 net/core/sock.c:2339 rcudobatch kernel/rcu/tree.c:2605 [inline] rcucore+0xca8/0x1770 kernel/rcu/tree.c:2861 handlesoftirqs+0x286/0x870 kernel/softirq.c:579 _dosoftirq kernel/softirq.c:613 [inline] invokesoftirq kernel/softirq.c:453 [inline] _irqexitrcu+0xca/0x1f0 kernel/softirq.c:680 irqexitrcu+0x9/0x30 kernel/softirq.c:696 instrsysvecapictimerinterrupt arch/x86/kernel/apic/apic.c:1052 [inline] sysvecapictimerinterrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052 </IRQ>
[
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@539920180c55f5e13a2488a2339f94e6b8cb69e0",
"digest": {
"length": 2229.0,
"function_hash": "245166772026327712693541150840844075295"
},
"signature_type": "Function",
"deprecated": false,
"target": {
"function": "tcp_bpf_send_verdict",
"file": "net/ipv4/tcp_bpf.c"
},
"id": "CVE-2025-39913-0333c531"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@66bcb04a441fbf15d66834b7e3eefb313dd750c8",
"digest": {
"threshold": 0.9,
"line_hashes": [
"203825876234495798076868175748086359539",
"174696678292612869243263137907797520484",
"311679792394404351851405206622198098808",
"82224822216774104320019036320667574973",
"53844870988474771254031559049781600121"
]
},
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"id": "CVE-2025-39913-0941d35b"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9c2a6456bdf9794474460d885c359b6c4522d6e3",
"digest": {
"threshold": 0.9,
"line_hashes": [
"203825876234495798076868175748086359539",
"174696678292612869243263137907797520484",
"311679792394404351851405206622198098808",
"82224822216774104320019036320667574973",
"53844870988474771254031559049781600121"
]
},
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"id": "CVE-2025-39913-0f834d54"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@66bcb04a441fbf15d66834b7e3eefb313dd750c8",
"digest": {
"length": 2229.0,
"function_hash": "245166772026327712693541150840844075295"
},
"signature_type": "Function",
"deprecated": false,
"target": {
"function": "tcp_bpf_send_verdict",
"file": "net/ipv4/tcp_bpf.c"
},
"id": "CVE-2025-39913-2a42c6ba"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@08f58d10f5abf11d297cc910754922498c921f91",
"digest": {
"length": 2196.0,
"function_hash": "209800581882207315049404905931888290621"
},
"signature_type": "Function",
"deprecated": false,
"target": {
"function": "tcp_bpf_send_verdict",
"file": "net/ipv4/tcp_bpf.c"
},
"id": "CVE-2025-39913-52732710"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@de89e58368f8f07df005ecc1c86ad94898a999f2",
"digest": {
"threshold": 0.9,
"line_hashes": [
"203825876234495798076868175748086359539",
"174696678292612869243263137907797520484",
"311679792394404351851405206622198098808",
"82224822216774104320019036320667574973",
"53844870988474771254031559049781600121"
]
},
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"id": "CVE-2025-39913-62dd17d2"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@539920180c55f5e13a2488a2339f94e6b8cb69e0",
"digest": {
"threshold": 0.9,
"line_hashes": [
"203825876234495798076868175748086359539",
"174696678292612869243263137907797520484",
"311679792394404351851405206622198098808",
"82224822216774104320019036320667574973",
"53844870988474771254031559049781600121"
]
},
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"id": "CVE-2025-39913-71e8662b"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9c2a6456bdf9794474460d885c359b6c4522d6e3",
"digest": {
"length": 2229.0,
"function_hash": "245166772026327712693541150840844075295"
},
"signature_type": "Function",
"deprecated": false,
"target": {
"function": "tcp_bpf_send_verdict",
"file": "net/ipv4/tcp_bpf.c"
},
"id": "CVE-2025-39913-7587916a"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@de89e58368f8f07df005ecc1c86ad94898a999f2",
"digest": {
"length": 2229.0,
"function_hash": "245166772026327712693541150840844075295"
},
"signature_type": "Function",
"deprecated": false,
"target": {
"function": "tcp_bpf_send_verdict",
"file": "net/ipv4/tcp_bpf.c"
},
"id": "CVE-2025-39913-7d2703d9"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@08f58d10f5abf11d297cc910754922498c921f91",
"digest": {
"threshold": 0.9,
"line_hashes": [
"203825876234495798076868175748086359539",
"174696678292612869243263137907797520484",
"311679792394404351851405206622198098808",
"82224822216774104320019036320667574973",
"53844870988474771254031559049781600121"
]
},
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "net/ipv4/tcp_bpf.c"
},
"id": "CVE-2025-39913-a1788fd7"
}
]