CVE-2026-139250

tcp: tcp_metrics: use the socket netns, not the dst device netns

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

tcp: tcp_metrics: use the socket netns, not the dst device netns

tcp_get_metrics(), __tcp_get_metrics_req() and tcpm_new() look up and
create metrics entries in the netns of the cached dst device rather than
in the netns of the socket.

These usually match, but not after the device has been moved to another
netns or unregistered: a socket can keep a stale dst in sk_dst_cache
until it is checked again, and tcp_update_metrics() reads it with
__sk_dst_get() without any dst_check(). Once dst_dev_put() has run, the
dst device is blackhole_netdev and the entry is created in init_net.
Before that, for instance for routes through nexthop objects whose
cached dsts are released from a nested RCU callback, it is the netns the
device has just been moved to.

A TCP socket of netns A that enters TIME_WAIT in that window then
creates or updates an entry carrying A's addresses and RTT in another
netns, where TCP_METRICS_CMD_GET can dump it and where new connections
to the same peer inherit those metrics.

The metrics belong to the netns of the socket, so use sock_net() for
full sockets and request sockets, and pass it to tcpm_new().

Kernel sockets that do not hold a netns reference can still reach
tcp_time_wait() after tcp_net_metrics_exit_batch() has flushed the
entries of their dismantling netns, and an entry created then would
never be flushed and would keep a dangling tcpm_net. Make tcpm_new()
refuse to create entries when check_net() fails. Its callers are in
an RCU read-side section, and cleanup_net() waits for a grace period
between the refcount reaching zero and the flush, so an entry added
after a successful check is always seen by the flush.

Analysis

AI-generated

Technical impact

In the Linux kernel, the tcp_metrics subsystem incorrectly stores metrics entries in the namespace of a cached destination device instead of the owning socket. When a device is moved between network namespaces or deregistered, a socket can retain a stale destination cached in sk_dst_cache until it is revalidated. The code then creates or updates metrics in a different netns, such as the global init_net. A user can use the TCP metrics dump interface to read metrics data that belong to another namespace, exposing round‑trip time values and address information that should be isolated, thereby leaking traffic patterns or host‑communication details. This flaw is a classic instance of information exposure where data protected by a network namespace boundary is inadvertently revealed.

Affected Systems

Any Linux kernel build that has not incorporated the commit correcting the namespace selection for tcp_metrics is affected. This includes all distributions or custom kernel versions running the buggy code, regardless of release level, until the patch is applied.

Risk and Exploitability

Based on the description, it is inferred that the vulnerability requires local access to the TCP metrics interface, which is typically available to regular users. No EPSS score is available and the vulnerability is not listed in the CISA KEV catalog, suggesting no publicly known exploit yet. Based on the description, it is inferred that the flaw can be abused by a local attacker with sufficient privileges, leading to high‑severity information disclosure. The CVSS base score is not provided, but the impact on confidentiality could be significant given the isolation violation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest stable kernel update that includes the tcp_metrics namespace fix and reboot the system to load the updated kernel.
  • Restart services that rely on TCP metrics to ensure they operate under the updated kernel.
  • Restrict local access to the TCP metrics interface by implementing SELinux/AppArmor policies or by removing read permissions from /proc/sys/net/ipv4/tcp_metrics_cmd, thereby limiting ordinary users from triggering the dump.
  • Monitor system logs for unexpected tcp_metrics dumps or mismatched RTT values that may indicate cross‑namespace leakage.

Generated by OpenCVE AI on December 1, 2026 at 09:24 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-524
References
Metrics threat_severity

None

cvssV3_1

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

threat_severity

Low

Type Values Removed Values Added
Weaknesses CWE-200
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: tcp: tcp_metrics: use the socket netns, not the dst device netns tcp_get_metrics(), __tcp_get_metrics_req() and tcpm_new() look up and create metrics entries in the netns of the cached dst device rather than in the netns of the socket. These usually match, but not after the device has been moved to another netns or unregistered: a socket can keep a stale dst in sk_dst_cache until it is checked again, and tcp_update_metrics() reads it with __sk_dst_get() without any dst_check(). Once dst_dev_put() has run, the dst device is blackhole_netdev and the entry is created in init_net. Before that, for instance for routes through nexthop objects whose cached dsts are released from a nested RCU callback, it is the netns the device has just been moved to. A TCP socket of netns A that enters TIME_WAIT in that window then creates or updates an entry carrying A's addresses and RTT in another netns, where TCP_METRICS_CMD_GET can dump it and where new connections to the same peer inherit those metrics. The metrics belong to the netns of the socket, so use sock_net() for full sockets and request sockets, and pass it to tcpm_new(). Kernel sockets that do not hold a netns reference can still reach tcp_time_wait() after tcp_net_metrics_exit_batch() has flushed the entries of their dismantling netns, and an entry created then would never be flushed and would keep a dangling tcpm_net. Make tcpm_new() refuse to create entries when check_net() fails. Its callers are in an RCU read-side section, and cleanup_net() waits for a grace period between the refcount reaching zero and the flush, so an entry added after a successful check is always seen by the flush.
Title tcp: tcp_metrics: use the socket netns, not the dst device netns
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-200

    Exposure of Sensitive Information to an Unauthorized Actor

  • CWE-524

    Use of Cache Containing Sensitive Information

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:33 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM
Severity
Low
Public date
Nov 30, 2026, 1:33 PM