{"id":"CVE-2025-39913","aliases":["CVE-2025-39913"],"related":[],"kind":"vulnerability","state":"published","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:\n\ntcp_bpf: Call sk_msg_free() when tcp_bpf_send_verdict() fails to allocate psock->cork.\n\nsyzbot reported the splat below. [0]\n\nThe repro does the following:\n\n  1. Load a sk_msg prog that calls bpf_msg_cork_bytes(msg, cork_bytes)\n  2. Attach the prog to a SOCKMAP\n  3. Add a socket to the SOCKMAP\n  4. Activate fault injection\n  5. Send data less than cork_bytes\n\nAt 5., the data is carried over to the next sendmsg() as it is\nsmaller than the cork_bytes specified by bpf_msg_cork_bytes().\n\nThen, tcp_bpf_send_verdict() tries to allocate psock->cork to hold\nthe data, but this fails silently due to fault injection + __GFP_NOWARN.\n\nIf the allocation fails, we need to revert the sk->sk_forward_alloc\nchange done by sk_msg_alloc().\n\nLet's call sk_msg_free() when tcp_bpf_send_verdict fails to allocate\npsock->cork.\n\nThe \"*copied\" also needs to be updated such that a proper error can\nbe returned to the caller, sendmsg. It fails to allocate psock->cork.\nNothing has been corked so far, so this patch simply sets \"*copied\"\nto 0.\n\n[0]:\nWARNING: net/ipv4/af_inet.c:156 at inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156, CPU#1: syz-executor/5983\nModules linked in:\nCPU: 1 UID: 0 PID: 5983 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full)\nHardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025\nRIP: 0010:inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156\nCode: 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\nRSP: 0018:ffffc90000a08b48 EFLAGS: 00010246\nRAX: ffffffff8a09d0b2 RBX: dffffc0000000000 RCX: ffff888024a23c80\nRDX: 0000000000000100 RSI: 0000000000000fff RDI: 0000000000000000\nRBP: 0000000000000fff R08: ffff88807e07c627 R09: 1ffff1100fc0f8c4\nR10: dffffc0000000000 R11: ffffed100fc0f8c5 R12: ffff88807e07c380\nR13: dffffc0000000000 R14: ffff88807e07c60c R15: 1ffff1100fc0f872\nFS:  00005555604c4500(0000) GS:ffff888125af1000(0000) knlGS:0000000000000000\nCS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\nCR2: 00005555604df5c8 CR3: 0000000032b06000 CR4: 00000000003526f0\nCall Trace:\n <IRQ>\n __sk_destruct+0x86/0x660 net/core/sock.c:2339\n rcu_do_batch kernel/rcu/tree.c:2605 [inline]\n rcu_core+0xca8/0x1770 kernel/rcu/tree.c:2861\n handle_softirqs+0x286/0x870 kernel/softirq.c:579\n __do_softirq kernel/softirq.c:613 [inline]\n invoke_softirq kernel/softirq.c:453 [inline]\n __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680\n irq_exit_rcu+0x9/0x30 kernel/softirq.c:696\n instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline]\n sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052\n </IRQ>","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ntcp_bpf: Call sk_msg_free() when tcp_bpf_send_verdict() fails to allocate psock->cork.\n\nsyzbot reported the splat below. [0]\n\nThe repro does the following:\n\n  1. Load a sk_msg prog that calls bpf_msg_cork_bytes(msg, cork_bytes)\n  2. Attach the prog to a SOCKMAP\n  3. Add a socket to the SOCKMAP\n  4. Activate fault injection\n  5. Send data less than cork_bytes\n\nAt 5., the data is carried over to the next sendmsg() as it is\nsmaller than the cork_bytes specified by bpf_msg_cork_bytes().\n\nThen, tcp_bpf_send_verdict() tries to allocate psock->cork to hold\nthe data, but this fails silently due to fault injection + __GFP_NOWARN.\n\nIf the allocation fails, we need to revert the sk->sk_forward_alloc\nchange done by sk_msg_alloc().\n\nLet's call sk_msg_free() when tcp_bpf_send_verdict fails to allocate\npsock->cork.\n\nThe \"*copied\" also needs to be updated such that a proper error can\nbe returned to the caller, sendmsg. It fails to allocate psock->cork.\nNothing has been corked so far, so this patch simply sets \"*copied\"\nto 0.\n\n[0]:\nWARNING: net/ipv4/af_inet.c:156 at inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156, CPU#1: syz-executor/5983\nModules linked in:\nCPU: 1 UID: 0 PID: 5983 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full)\nHardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025\nRIP: 0010:inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156\nCode: 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\nRSP: 0018:ffffc90000a08b48 EFLAGS: 00010246\nRAX: ffffffff8a09d0b2 RBX: dffffc0000000000 RCX: ffff888024a23c80\nRDX: 0000000000000100 RSI: 0000000000000fff RDI: 0000000000000000\nRBP: 0000000000000fff R08: ffff88807e07c627 R09: 1ffff1100fc0f8c4\nR10: dffffc0000000000 R11: ffffed100fc0f8c5 R12: ffff88807e07c380\nR13: dffffc0000000000 R14: ffff88807e07c60c R15: 1ffff1100fc0f872\nFS:  00005555604c4500(0000) GS:ffff888125af1000(0000) knlGS:0000000000000000\nCS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\nCR2: 00005555604df5c8 CR3: 0000000032b06000 CR4: 00000000003526f0\nCall Trace:\n <IRQ>\n __sk_destruct+0x86/0x660 net/core/sock.c:2339\n rcu_do_batch kernel/rcu/tree.c:2605 [inline]\n rcu_core+0xca8/0x1770 kernel/rcu/tree.c:2861\n handle_softirqs+0x286/0x870 kernel/softirq.c:579\n __do_softirq kernel/softirq.c:613 [inline]\n invoke_softirq kernel/softirq.c:453 [inline]\n __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680\n irq_exit_rcu+0x9/0x30 kernel/softirq.c:696\n instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline]\n sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052\n </IRQ>","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\ntcp_bpf: Llamar a sk_msg_free() cuando tcp_bpf_send_verdict() falla al asignar psock->cork.\n\nsyzbot informó del error a continuación. [0]\n\nLa reproducción hace lo siguiente:\n\n  1. Cargar un programa sk_msg que llama a bpf_msg_cork_bytes(msg, cork_bytes)\n  2. Adjuntar el programa a un SOCKMAP\n  3. Añadir un socket al SOCKMAP\n  4. Activar la inyección de fallos\n  5. Enviar datos menores que cork_bytes\n\nEn el punto 5., los datos se transfieren al siguiente sendmsg() ya que son menores que los cork_bytes especificados por bpf_msg_cork_bytes().\n\nLuego, tcp_bpf_send_verdict() intenta asignar psock->cork para contener los datos, pero esto falla silenciosamente debido a la inyección de fallos + __GFP_NOWARN.\n\nSi la asignación falla, necesitamos revertir el cambio sk->sk_forward_alloc realizado por sk_msg_alloc().\n\nLlamemos a sk_msg_free() cuando tcp_bpf_send_verdict falla al asignar psock->cork.\n\nEl “*copied” también necesita ser actualizado para que se pueda devolver un error adecuado al llamador, sendmsg. Falla al asignar psock->cork. Nada ha sido retenido hasta ahora, así que este parche simplemente establece “*copied” en 0.\n\n[0]:\nADVERTENCIA: net/ipv4/af_inet.c:156 en inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156, CPU#1: syz-executor/5983\nMódulos enlazados:\nCPU: 1 UID: 0 PID: 5983 Comm: syz-executor No contaminado syzkaller #0 PREEMPT(full)\nNombre del hardware: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025\nRIP: 0010:inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156\nCode: 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\nRSP: 0018:ffffc90000a08b48 EFLAGS: 00010246\nRAX: ffffffff8a09d0b2 RBX: dffffc0000000000 RCX: ffff888024a23c80\nRDX: 0000000000000100 RSI: 0000000000000fff RDI: 0000000000000000\nRBP: 0000000000000fff R08: ffff88807e07c627 R09: 1ffff1100fc0f8c4\nR10: dffffc0000000000 R11: ffffed100fc0f8c5 R12: ffff88807e07c380\nR13: dffffc0000000000 R14: ffff88807e07c60c R15: 1ffff1100fc0f872\nFS: 00005555604c4500(0000) GS:ffff888125af1000(0000) knlGS:0000000000000000\nCS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033\nCR2: 00005555604df5c8 CR3: 0000000032b06000 CR4: 00000000003526f0\nRastreo de llamadas:\n <IRQ>\n __sk_destruct+0x86/0x660 net/core/sock.c:2339\n rcu_do_batch kernel/rcu/tree.c:2605 [inline]\n rcu_core+0xca8/0x1770 kernel/rcu/tree.c:2861\n handle_softirqs+0x286/0x870 kernel/softirq.c:579\n __do_softirq kernel/softirq.c:613 [inline]\n invoke_softirq kernel/softirq.c:453 [inline]\n __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680\n irq_exit_rcu+0x9/0x30 kernel/softirq.c:696\n instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline]\n sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052\n </IRQ>","source":"nvd"}],"published":"2025-10-01T07:44:36.244Z","modified":"2026-10-19T21:10:00.160Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"4f738adba30a7cfc006f605707e7aee847ffefa0","fixed":"08f58d10f5abf11d297cc910754922498c921f91","status":"affected"},{"type":"git","introduced":"4f738adba30a7cfc006f605707e7aee847ffefa0","fixed":"05366527f44cf4b884f3d9462ae8009be9665856","status":"affected"},{"type":"git","introduced":"4f738adba30a7cfc006f605707e7aee847ffefa0","fixed":"7429b8b9bfbc276fd304fbaebc405f46b421fedf","status":"affected"},{"type":"git","introduced":"4f738adba30a7cfc006f605707e7aee847ffefa0","fixed":"9c2a6456bdf9794474460d885c359b6c4522d6e3","status":"affected"},{"type":"git","introduced":"4f738adba30a7cfc006f605707e7aee847ffefa0","fixed":"66bcb04a441fbf15d66834b7e3eefb313dd750c8","status":"affected"},{"type":"git","introduced":"4f738adba30a7cfc006f605707e7aee847ffefa0","fixed":"539920180c55f5e13a2488a2339f94e6b8cb69e0","status":"affected"},{"type":"git","introduced":"4f738adba30a7cfc006f605707e7aee847ffefa0","fixed":"de89e58368f8f07df005ecc1c86ad94898a999f2","status":"affected"},{"type":"git","introduced":"4f738adba30a7cfc006f605707e7aee847ffefa0","fixed":"a3967baad4d533dc254c31e0d221e51c8d223d58","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.17","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.17","status":"unaffected"},{"type":"semver","introduced":"5.4.300","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.245","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.194","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.153","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.107","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.48","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.16.8","lastAffected":"6.16.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.17","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"4.17","fixed":"5.4.300"},{"status":"affected","introduced":"5.5","fixed":"5.10.245"},{"status":"affected","introduced":"5.11","fixed":"5.15.194"},{"status":"affected","introduced":"5.16","fixed":"6.1.153"},{"status":"affected","introduced":"6.2","fixed":"6.6.107"},{"status":"affected","introduced":"6.7","fixed":"6.12.48"},{"status":"affected","introduced":"6.13","fixed":"6.16.8"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"},{"status":"affected","version":"6.17"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/08f58d10f5abf11d297cc910754922498c921f91","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/05366527f44cf4b884f3d9462ae8009be9665856","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7429b8b9bfbc276fd304fbaebc405f46b421fedf","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9c2a6456bdf9794474460d885c359b6c4522d6e3","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/66bcb04a441fbf15d66834b7e3eefb313dd750c8","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/539920180c55f5e13a2488a2339f94e6b8cb69e0","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/de89e58368f8f07df005ecc1c86ad94898a999f2","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a3967baad4d533dc254c31e0d221e51c8d223d58","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-253495.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-06-10T20:41:05.336Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-39913","url":"https://www.cve.org/CVERecord?id=CVE-2025-39913","licence":"CVE Terms of Use","modified":"2026-06-11T18:44:08.579Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-39913","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39913","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:05.390Z","epss":{"score":0.00194,"percentile":0.09504,"date":"2026-12-01T12:00:22.000Z"}}