{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-40170","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2025-04-16T07:20:57.176Z","datePublished":"2025-11-12T10:46:52.014Z","dateUpdated":"2026-08-05T12:08:15.716Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T12:08:15.716Z"},"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()."}],"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."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","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"],"versions":[{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","lessThan":"5d1be493d1110c9e720b4c51a6e587bb2fb4ac12","status":"affected","versionType":"git"},{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","lessThan":"a805729c0091073d8f0415cfa96c7acd1bc17a48","status":"affected","versionType":"git"},{"version":"4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36","lessThan":"99a2ace61b211b0be861b07fbaa062fca4b58879","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","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"],"versions":[{"version":"4.13","status":"affected"},{"version":"0","lessThan":"4.13","status":"unaffected","versionType":"semver"},{"version":"6.12.64","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.17.3","lessThanOrEqual":"6.17.*","status":"unaffected","versionType":"semver"},{"version":"6.18","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"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"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/5d1be493d1110c9e720b4c51a6e587bb2fb4ac12"},{"url":"https://git.kernel.org/stable/c/a805729c0091073d8f0415cfa96c7acd1bc17a48"},{"url":"https://git.kernel.org/stable/c/99a2ace61b211b0be861b07fbaa062fca4b58879"}],"title":"net: use dst_dev_rcu() in sk_setup_caps()","x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"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"}}}],"title":"CISA ADP Vulnrichment","providerMetadata":{"orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","shortName":"CISA-ADP","dateUpdated":"2026-06-16T19:33:20.303Z"}}]}}