CVE-2026-139098

tcp: avoid double destroy in tcp_abort() of an unaccepted child

Published Nov 30, 2026 CVSS 3.1 · 7.8 High EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

tcp: avoid double destroy in tcp_abort() of an unaccepted child

tcp_abort() checks for TCP_CLOSE while only owning the socket lock,
then grabs the BH lock before calling tcp_done_with_error().

For a child still sitting in a listener accept queue (which can be
reached via SOCK_DESTROY or bpf_sock_destroy()), inet_csk_listen_stop()
can run in this window: it only holds the child BH lock, and calls
inet_child_forget(), which disconnects, orphans and destroys the child.

tcp_abort() then calls tcp_done_with_error() -> tcp_done(), which sees
SOCK_DEAD and calls inet_csk_destroy_sock() a second time, leading to
a double sock_put() and a use-after-free.

Recheck TCP_CLOSE after acquiring the BH lock, unless we just closed
a listener ourselves, in which case tcp_done_with_error() must still
run to report the error.

Note that the WARN_ON(sock_owned_by_user(child)) in
inet_csk_listen_stop() can still trigger in this window.

[edumazet: recheck TCP_CLOSE under the BH lock instead of moving the test, smaller diff]

Analysis

AI-generated

Technical impact

The vulnerability resides in the Linux kernel’s TCP stack. A double destruction of an unaccepted child socket occurs when tcp_abort() flags a socket for closure while holding only the socket lock, then later rechecks the state after acquiring the bottom‑half lock. This sequence allows tcp_done_with_error() to be called twice, invoking sock_put() on a socket that has already been freed. The resulting use‑after‑free can cause kernel memory corruption that may lead to a system crash.

Affected Systems

This flaw affects the Linux kernel itself, and is applicable to all kernel versions where the affected implementation resides. No specific version range is listed in the advisory, so any kernel build derived from the mainline source until this patch is applied is potentially vulnerable.

Risk and Exploitability

The vulnerability has no publicly reported exploit so far (EPSS score not available), and it is not listed in CISA’s KEV catalog. The attack requires the ability to create or manipulate sockets that remain in the accept queue and trigger a tcp_abort() while the socket is in a specific race condition with inet_csk_listen_stop(). This generally demands local or privileged access. In the absence of a confirmed exploit, the risk is high for systems that run the affected kernel and handle unaccepted child sockets, since a use‑after‑free can destabilize the kernel and potentially cause a crash.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel patch that corrects the double socket destruction in tcp_abort()
  • Upgrade to a kernel version that includes this fix; if unavailable, rebuild the kernel from a source tree that incorporates the commit from the provided git references
  • Restrict or monitor the use of "bpf_sock_destroy" and other socket destruction paths in applications to reduce exposure to the race condition
  • If immediate upgrade is not possible, isolate critical services that perform high‑volume socket accept operations to minimize the attack surface

Generated by OpenCVE AI on December 1, 2026 at 08:57 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Linux linux
Vendors & Products Linux linux
Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: tcp: avoid double destroy in tcp_abort() of an unaccepted child tcp_abort() checks for TCP_CLOSE while only owning the socket lock, then grabs the BH lock before calling tcp_done_with_error(). For a child still sitting in a listener accept queue (which can be reached via SOCK_DESTROY or bpf_sock_destroy()), inet_csk_listen_stop() can run in this window: it only holds the child BH lock, and calls inet_child_forget(), which disconnects, orphans and destroys the child. tcp_abort() then calls tcp_done_with_error() -> tcp_done(), which sees SOCK_DEAD and calls inet_csk_destroy_sock() a second time, leading to a double sock_put() and a use-after-free. Recheck TCP_CLOSE after acquiring the BH lock, unless we just closed a listener ourselves, in which case tcp_done_with_error() must still run to report the error. Note that the WARN_ON(sock_owned_by_user(child)) in inet_csk_listen_stop() can still trigger in this window. [edumazet: recheck TCP_CLOSE under the BH lock instead of moving the test, smaller diff]
Title tcp: avoid double destroy in tcp_abort() of an unaccepted child
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-1341

    Multiple Releases of Same Resource or Handle

  • CWE-416

    Use After Free

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Dec 1, 2026, 5:41 AM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Dec 1, 2026, 6:17 AM
Severity
Moderate
Public date
Nov 30, 2026, 1:31 PM