CVE-2026-139250: tcp: tcp_metrics: use the socket netns, not the dst device netns

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

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

tcpgetmetrics(), tcpgetmetricsreq() and tcpmnew() 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 skdstcache until it is checked again, and tcpupdatemetrics() reads it with skdstget() without any dstcheck(). Once dstdevput() has run, the dst device is blackholenetdev and the entry is created in initnet. 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 TIMEWAIT in that window then creates or updates an entry carrying A's addresses and RTT in another netns, where TCPMETRICSCMDGET 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 socknet() for full sockets and request sockets, and pass it to tcpmnew().

Kernel sockets that do not hold a netns reference can still reach tcptimewait() after tcpnetmetricsexitbatch() has flushed the entries of their dismantling netns, and an entry created then would never be flushed and would keep a dangling tcpmnet. Make tcpmnew() refuse to create entries when checknet() fails. Its callers are in an RCU read-side section, and cleanupnet() 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.

Affected Software

1 affected component
Linux Linux kernel

Event History

Nov 30, 2026
CVE Published
via MITRE·01:33 PM
Data Sourced
via MITRE·01:33 PM
Description

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203