{"id":"CVE-2025-40170","state":"PUBLISHED","title":"net: use dst_dev_rcu() in sk_setup_caps()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: use dst_dev_rcu() in sk_setup_caps()\n\nUse RCU to protect accesses to dst->dev from sk_setup_caps()\nand sk_dst_gso_max_size().\n\nAlso use dst_dev_rcu() in ip6_dst_mtu_maybe_forward(),\nand ip_dst_mtu_maybe_forward().\n\nip4_dst_hoplimit() can use dst_dev_net_rcu().","publishedAt":"2025-11-12T10:46:52.014Z","updatedAt":"2026-10-30T12:22:55.694Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","status":"affected","lessThan":"13b0e14bfa7e6d506d8d6426b9e6d7feef01ded3","versionType":"git"},{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","status":"affected","lessThan":"9f22b5f7f1a32f8bbcc82bf34e34ea63523fcd02","versionType":"git"},{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","status":"affected","lessThan":"5d1be493d1110c9e720b4c51a6e587bb2fb4ac12","versionType":"git"},{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","status":"affected","lessThan":"a805729c0091073d8f0415cfa96c7acd1bc17a48","versionType":"git"},{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","status":"affected","lessThan":"99a2ace61b211b0be861b07fbaa062fca4b58879","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/net/ip.h","include/net/ip6_route.h","include/net/route.h","net/core/sock.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.13","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.13","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.64","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.17.3","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/net/ip.h","include/net/ip6_route.h","include/net/route.h","net/core/sock.c"]}],"references":["https://git.kernel.org/stable/c/13b0e14bfa7e6d506d8d6426b9e6d7feef01ded3","https://git.kernel.org/stable/c/9f22b5f7f1a32f8bbcc82bf34e34ea63523fcd02","https://git.kernel.org/stable/c/5d1be493d1110c9e720b4c51a6e587bb2fb4ac12","https://git.kernel.org/stable/c/a805729c0091073d8f0415cfa96c7acd1bc17a48","https://git.kernel.org/stable/c/99a2ace61b211b0be861b07fbaa062fca4b58879"],"weaknesses":[],"ingestedAt":"2026-10-30T12:40:04.423Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/40xxx/CVE-2025-40170.json","commit":"db8103c5921aac81d5d90efcf3745980dafabf49","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-40170","state":"PUBLISHED","datePublished":"2025-11-12T10:46:52.014Z","dateUpdated":"2026-10-30T12:22:55.694Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T07:20:57.176Z"},"containers":{"cna":{"title":"net: use dst_dev_rcu() in sk_setup_caps()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: use dst_dev_rcu() in sk_setup_caps()\n\nUse RCU to protect accesses to dst->dev from sk_setup_caps()\nand sk_dst_gso_max_size().\n\nAlso use dst_dev_rcu() in ip6_dst_mtu_maybe_forward(),\nand ip_dst_mtu_maybe_forward().\n\nip4_dst_hoplimit() can use dst_dev_net_rcu()."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","status":"affected","lessThan":"13b0e14bfa7e6d506d8d6426b9e6d7feef01ded3","versionType":"git"},{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","status":"affected","lessThan":"9f22b5f7f1a32f8bbcc82bf34e34ea63523fcd02","versionType":"git"},{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","status":"affected","lessThan":"5d1be493d1110c9e720b4c51a6e587bb2fb4ac12","versionType":"git"},{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","status":"affected","lessThan":"a805729c0091073d8f0415cfa96c7acd1bc17a48","versionType":"git"},{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","status":"affected","lessThan":"99a2ace61b211b0be861b07fbaa062fca4b58879","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/net/ip.h","include/net/ip6_route.h","include/net/route.h","net/core/sock.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.13","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.13","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.64","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.17.3","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/net/ip.h","include/net/ip6_route.h","include/net/route.h","net/core/sock.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/13b0e14bfa7e6d506d8d6426b9e6d7feef01ded3"},{"url":"https://git.kernel.org/stable/c/9f22b5f7f1a32f8bbcc82bf34e34ea63523fcd02"},{"url":"https://git.kernel.org/stable/c/5d1be493d1110c9e720b4c51a6e587bb2fb4ac12"},{"url":"https://git.kernel.org/stable/c/a805729c0091073d8f0415cfa96c7acd1bc17a48"},{"url":"https://git.kernel.org/stable/c/99a2ace61b211b0be861b07fbaa062fca4b58879"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The unprotected `sk_setup_caps()` reader is reached from process-context syscalls (connect/sendmsg/SCTP output), and the racing `dst_dev_put()`/netdev-unregister side requires local netns and link/route manipulation; the remote-triggered call site (`tcp_v4_syn_recv_sock`) runs BH-disabled and is implicitly RCU-protected.\nAC:L - The attacker controls both sides of the race — one thread loops connect()/sendmsg() on sockets holding the dst while another deletes the veth/route in its own netns — and can retry indefinitely until the window is hit.\nPR:L - An unprivileged local account suffices; CAP_NET_ADMIN needed for link/route teardown is obtainable without real root via user namespaces (`unshare -Urn`), and the socket side needs no privilege at all.\nUI:N - Exploitation is entirely driven by the attacker's own threads issuing socket syscalls and netlink link/route operations; no victim action is required.\nS:U - The use-after-free is on a kernel `struct net_device` and its effects stay within the kernel's own security authority, with no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - This is a use-after-free read of a freed, heap-sprayable `net_device`; its contents are loaded into `sk_route_caps`, `sk_gso_max_size` and `sk_gso_max_segs`, which observably alter TCP segmentation and thus leak freed-memory contents, and per UAF guidance this is High.\nI:H - Values read from freed memory are written into persistent socket state and then drive packet construction — bogus SG/HW_CSUM/GSO feature bits and an underflowed multi-gigabyte `sk_gso_max_size` corrupt the TX path, and a UAF on a sprayable object is treatable as an arbitrary-write primitive.\nA:H - Dereferencing a freed `net_device` can oops outright, and the resulting garbage GSO sizes/segment counts produce oversized skb allocations and inconsistent offload state that crash the transmit path and drivers."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-30T12:22:55.694Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.13","versionEndExcluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.13","versionEndExcluding":"6.6.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.13","versionEndExcluding":"6.12.64"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.13","versionEndExcluding":"6.17.3"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.13","versionEndExcluding":"6.18"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-06-16T19:33:10.426175Z","id":"CVE-2025-40170","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-06-16T19:33:20.303Z"}}]}}}