{"id":"CVE-2025-21791","state":"PUBLISHED","title":"vrf: use RCU protection in l3mdev_l3_out()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nvrf: use RCU protection in l3mdev_l3_out()\n\nl3mdev_l3_out() can be called without RCU being held:\n\nraw_sendmsg()\n ip_push_pending_frames()\n  ip_send_skb()\n   ip_local_out()\n    __ip_local_out()\n     l3mdev_ip_out()\n\nAdd rcu_read_lock() / rcu_read_unlock() pair to avoid\na potential UAF.","publishedAt":"2025-02-27T02:18:29.014Z","updatedAt":"2026-10-15T01:04:25.820Z","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":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"6ccaa5797f5362a2aad6baa6ddaf4715ac2dd51e","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"20a3489b396764cc9376e32a9172bee26a89dc3b","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"5bb4228c32261d06e4fbece37ec3828bcc005b6b","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"c7574740be8ce68a57d0aece24987b9be2114c3c","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"c40cb5c03e37552d6eff963187109e2c3f78ef6f","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"022cac1c693add610ae76ede03adf4d9d5a2cf21","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"7b81425b517accefd46bee854d94954f5c57e019","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"6d0ce46a93135d96b7fa075a94a88fe0da8e8773","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/net/l3mdev.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.9","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.9","versionType":"semver"},{"version":"5.4.291","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.235","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.179","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.129","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.79","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.16","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.4","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/net/l3mdev.h"]}],"references":["https://git.kernel.org/stable/c/6ccaa5797f5362a2aad6baa6ddaf4715ac2dd51e","https://git.kernel.org/stable/c/20a3489b396764cc9376e32a9172bee26a89dc3b","https://git.kernel.org/stable/c/5bb4228c32261d06e4fbece37ec3828bcc005b6b","https://git.kernel.org/stable/c/c7574740be8ce68a57d0aece24987b9be2114c3c","https://git.kernel.org/stable/c/c40cb5c03e37552d6eff963187109e2c3f78ef6f","https://git.kernel.org/stable/c/022cac1c693add610ae76ede03adf4d9d5a2cf21","https://git.kernel.org/stable/c/7b81425b517accefd46bee854d94954f5c57e019","https://git.kernel.org/stable/c/6d0ce46a93135d96b7fa075a94a88fe0da8e8773","https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html","https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html","https://cert-portal.siemens.com/productcert/html/ssa-784472.html"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:08:39.238Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/21xxx/CVE-2025-21791.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-21791","state":"PUBLISHED","datePublished":"2025-02-27T02:18:29.014Z","dateUpdated":"2026-10-15T01:04:25.820Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-29T08:45:45.766Z"},"containers":{"cna":{"title":"vrf: use RCU protection in l3mdev_l3_out()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nvrf: use RCU protection in l3mdev_l3_out()\n\nl3mdev_l3_out() can be called without RCU being held:\n\nraw_sendmsg()\n ip_push_pending_frames()\n  ip_send_skb()\n   ip_local_out()\n    __ip_local_out()\n     l3mdev_ip_out()\n\nAdd rcu_read_lock() / rcu_read_unlock() pair to avoid\na potential UAF."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"6ccaa5797f5362a2aad6baa6ddaf4715ac2dd51e","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"20a3489b396764cc9376e32a9172bee26a89dc3b","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"5bb4228c32261d06e4fbece37ec3828bcc005b6b","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"c7574740be8ce68a57d0aece24987b9be2114c3c","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"c40cb5c03e37552d6eff963187109e2c3f78ef6f","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"022cac1c693add610ae76ede03adf4d9d5a2cf21","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"7b81425b517accefd46bee854d94954f5c57e019","versionType":"git"},{"version":"a8e3e1a9f02094145580ea7920c6a1d9aabd5539","status":"affected","lessThan":"6d0ce46a93135d96b7fa075a94a88fe0da8e8773","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/net/l3mdev.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.9","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.9","versionType":"semver"},{"version":"5.4.291","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.235","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.179","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.129","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.79","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.16","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.4","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/net/l3mdev.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/6ccaa5797f5362a2aad6baa6ddaf4715ac2dd51e"},{"url":"https://git.kernel.org/stable/c/20a3489b396764cc9376e32a9172bee26a89dc3b"},{"url":"https://git.kernel.org/stable/c/5bb4228c32261d06e4fbece37ec3828bcc005b6b"},{"url":"https://git.kernel.org/stable/c/c7574740be8ce68a57d0aece24987b9be2114c3c"},{"url":"https://git.kernel.org/stable/c/c40cb5c03e37552d6eff963187109e2c3f78ef6f"},{"url":"https://git.kernel.org/stable/c/022cac1c693add610ae76ede03adf4d9d5a2cf21"},{"url":"https://git.kernel.org/stable/c/7b81425b517accefd46bee854d94954f5c57e019"},{"url":"https://git.kernel.org/stable/c/6d0ce46a93135d96b7fa075a94a88fe0da8e8773"}],"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 - Both halves of the race are driven from the local system — a `sendmsg()` on a local socket for the read side, and RTNL link operations (VRF delete/unenslave) for the free side. A remote peer cannot induce the VRF teardown that arms the use-after-free.\nAC:L - The attacker controls both sides of the race and can loop them indefinitely: one thread sends UDP/raw packets out a VRF-enslaved device while another repeatedly unenslaves/deletes the VRF master, with preemption pressure raised at will. `do_vrf_del_slave()` widens the window further by unlinking the adjacency before clearing `IFF_L3MDEV_SLAVE`.\nPR:L - The transmit side needs no privileges at all (ordinary UDP sendmsg), and the VRF create/enslave/delete side needs only CAP_NET_ADMIN within a network namespace, which an unprivileged user obtains via `unshare -Urn`.\nUI:N - The attacker's own threads perform every step — socket sends and netlink link operations — with no victim action required.\nS:U - The use-after-free and its consequences are confined to the kernel's own security authority; no VM, IOMMU, or other trust boundary is crossed.\nC:H - The freed `netdev_adjacent` sits in a general kmalloc cache and is readily groomed, letting the attacker supply `upper->dev`, after which `master->l3mdev_ops` and `->l3mdev_l3_out` are read from an attacker-chosen address — an arbitrary kernel read primitive.\nI:H - The same reclaimed object yields an indirect call through an attacker-controlled function pointer with `master` as the first argument, giving control-flow hijack and thus arbitrary kernel-state modification.\nA:H - Even unweaponized, dereferencing a stale adjacency entry and calling through garbage function pointers reliably oopses or panics the kernel, and the attacker can retrigger it at will."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:54:28.163Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.9","versionEndExcluding":"5.4.291"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.9","versionEndExcluding":"5.10.235"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.9","versionEndExcluding":"5.15.179"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.9","versionEndExcluding":"6.1.129"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.9","versionEndExcluding":"6.6.79"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.9","versionEndExcluding":"6.12.16"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.9","versionEndExcluding":"6.13.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.9","versionEndExcluding":"6.14"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2025-21791","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-02-27T17:57:16.236835Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","type":"CWE","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-02-27T18:02:26.723Z"}},{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T20:59:34.647Z"}},{"affected":[{"vendor":"Siemens","product":"SIMATIC S7-1500 TM MFP - GNU/Linux subsystem","defaultStatus":"unknown","versions":[{"version":"0","status":"affected","lessThan":"*","versionType":"custom"}]}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-784472.html"}],"providerMetadata":{"shortName":"siemens-SADP","orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","dateUpdated":"2026-10-15T01:04:25.820Z"},"x_adpType":"supplier"}]}}}