{"id":"CVE-2026-139250","state":"PUBLISHED","title":"tcp: tcp_metrics: use the socket netns, not the dst device netns","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ntcp: tcp_metrics: use the socket netns, not the dst device netns\n\ntcp_get_metrics(), __tcp_get_metrics_req() and tcpm_new() look up and\ncreate metrics entries in the netns of the cached dst device rather than\nin the netns of the socket.\n\nThese usually match, but not after the device has been moved to another\nnetns or unregistered: a socket can keep a stale dst in sk_dst_cache\nuntil it is checked again, and tcp_update_metrics() reads it with\n__sk_dst_get() without any dst_check(). Once dst_dev_put() has run, the\ndst device is blackhole_netdev and the entry is created in init_net.\nBefore that, for instance for routes through nexthop objects whose\ncached dsts are released from a nested RCU callback, it is the netns the\ndevice has just been moved to.\n\nA TCP socket of netns A that enters TIME_WAIT in that window then\ncreates or updates an entry carrying A's addresses and RTT in another\nnetns, where TCP_METRICS_CMD_GET can dump it and where new connections\nto the same peer inherit those metrics.\n\nThe metrics belong to the netns of the socket, so use sock_net() for\nfull sockets and request sockets, and pass it to tcpm_new().\n\nKernel sockets that do not hold a netns reference can still reach\ntcp_time_wait() after tcp_net_metrics_exit_batch() has flushed the\nentries of their dismantling netns, and an entry created then would\nnever be flushed and would keep a dangling tcpm_net. Make tcpm_new()\nrefuse to create entries when check_net() fails. Its callers are in\nan RCU read-side section, and cleanup_net() waits for a grace period\nbetween the refcount reaching zero and the flush, so an entry added\nafter a successful check is always seen by the flush.","publishedAt":"2026-11-30T13:33:00.603Z","updatedAt":"2026-11-30T13:33:00.603Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"92735a5a10a69a4d695d3466500b9f69ff88c81e","versionType":"git"},{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"1bff258a5b6d2f0ef1c249166c73b689c263fc91","versionType":"git"},{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"bd2e8296521cc9b05795973f5de1776602c35c26","versionType":"git"},{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"b841bbfd532c35fd0165c8422783eb4b67e99ece","versionType":"git"},{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"34319db5bf8f678969225a79051151de8a983747","versionType":"git"},{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"61076edd5def44417d16ce405c636a02c933555e","versionType":"git"},{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"504bdcb8c1566a6f887f9accebe1aa99b502ae97","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/tcp_metrics.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.6","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/tcp_metrics.c"]}],"references":["https://git.kernel.org/stable/c/92735a5a10a69a4d695d3466500b9f69ff88c81e","https://git.kernel.org/stable/c/1bff258a5b6d2f0ef1c249166c73b689c263fc91","https://git.kernel.org/stable/c/bd2e8296521cc9b05795973f5de1776602c35c26","https://git.kernel.org/stable/c/b841bbfd532c35fd0165c8422783eb4b67e99ece","https://git.kernel.org/stable/c/34319db5bf8f678969225a79051151de8a983747","https://git.kernel.org/stable/c/61076edd5def44417d16ce405c636a02c933555e","https://git.kernel.org/stable/c/504bdcb8c1566a6f887f9accebe1aa99b502ae97"],"weaknesses":[],"ingestedAt":"2026-11-30T13:46:04.484Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139250.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139250","state":"PUBLISHED","datePublished":"2026-11-30T13:33:00.603Z","dateUpdated":"2026-11-30T13:33:00.603Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.922Z"},"containers":{"cna":{"title":"tcp: tcp_metrics: use the socket netns, not the dst device netns","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ntcp: tcp_metrics: use the socket netns, not the dst device netns\n\ntcp_get_metrics(), __tcp_get_metrics_req() and tcpm_new() look up and\ncreate metrics entries in the netns of the cached dst device rather than\nin the netns of the socket.\n\nThese usually match, but not after the device has been moved to another\nnetns or unregistered: a socket can keep a stale dst in sk_dst_cache\nuntil it is checked again, and tcp_update_metrics() reads it with\n__sk_dst_get() without any dst_check(). Once dst_dev_put() has run, the\ndst device is blackhole_netdev and the entry is created in init_net.\nBefore that, for instance for routes through nexthop objects whose\ncached dsts are released from a nested RCU callback, it is the netns the\ndevice has just been moved to.\n\nA TCP socket of netns A that enters TIME_WAIT in that window then\ncreates or updates an entry carrying A's addresses and RTT in another\nnetns, where TCP_METRICS_CMD_GET can dump it and where new connections\nto the same peer inherit those metrics.\n\nThe metrics belong to the netns of the socket, so use sock_net() for\nfull sockets and request sockets, and pass it to tcpm_new().\n\nKernel sockets that do not hold a netns reference can still reach\ntcp_time_wait() after tcp_net_metrics_exit_batch() has flushed the\nentries of their dismantling netns, and an entry created then would\nnever be flushed and would keep a dangling tcpm_net. Make tcpm_new()\nrefuse to create entries when check_net() fails. Its callers are in\nan RCU read-side section, and cleanup_net() waits for a grace period\nbetween the refcount reaching zero and the flush, so an entry added\nafter a successful check is always seen by the flush."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"92735a5a10a69a4d695d3466500b9f69ff88c81e","versionType":"git"},{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"1bff258a5b6d2f0ef1c249166c73b689c263fc91","versionType":"git"},{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"bd2e8296521cc9b05795973f5de1776602c35c26","versionType":"git"},{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"b841bbfd532c35fd0165c8422783eb4b67e99ece","versionType":"git"},{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"34319db5bf8f678969225a79051151de8a983747","versionType":"git"},{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"61076edd5def44417d16ce405c636a02c933555e","versionType":"git"},{"version":"51c5d0c4b169bf762f09e0d5b283a7f0b2a45739","status":"affected","lessThan":"504bdcb8c1566a6f887f9accebe1aa99b502ae97","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/tcp_metrics.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.6","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/ipv4/tcp_metrics.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/92735a5a10a69a4d695d3466500b9f69ff88c81e"},{"url":"https://git.kernel.org/stable/c/1bff258a5b6d2f0ef1c249166c73b689c263fc91"},{"url":"https://git.kernel.org/stable/c/bd2e8296521cc9b05795973f5de1776602c35c26"},{"url":"https://git.kernel.org/stable/c/b841bbfd532c35fd0165c8422783eb4b67e99ece"},{"url":"https://git.kernel.org/stable/c/34319db5bf8f678969225a79051151de8a983747"},{"url":"https://git.kernel.org/stable/c/61076edd5def44417d16ce405c636a02c933555e"},{"url":"https://git.kernel.org/stable/c/504bdcb8c1566a6f887f9accebe1aa99b502ae97"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:00.603Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"5.15.226"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}