Look up another CVE · open CVE-2025-22057 in the interactive tracker
CVE-2025-22057
net: decrease cached dst counters in dst_release
Published 2025-04-16 (18 months ago) by the Linux kernel CNA. Subsystem net/core. Debian urgency: not yet assigned.
What to do, per Debian release
Debian's own status for CVE-2025-22057 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source
| Release | Status | Version | What this means |
|---|---|---|---|
| Debian 12bookworm | vulnerable | 6.1.190-1 | No fix published anywhere yet, neither in Debian nor upstream for the series bookworm tracks. Watch the Debian tracker page for this CVE. Advisories for bookworm have historically landed a median of 23 days after publication. |
| Debian 13trixie | fixed | 6.12.25-1 | Update the kernel and reboot. Fixed in 6.12.25-1. A running kernel keeps the old code until the machine restarts. |
| Debian 14forky | fixed | 6.12.25-1 | Update the kernel and reboot. Fixed in 6.12.25-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 6.12.25-1 | Update the kernel and reboot. Fixed in 6.12.25-1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
Upstream fix ac888d58869b ("net: do not delay dst_entries_add() in dst_release()") moved decrementing the dst count from dst_destroy to dst_release to avoid accessing already freed data in case of netns dismantle. However in case CONFIG_DST_CACHE is enabled and OvS+tunnels are used, this fix is incomplete as the same issue will be seen for cached dsts: Unable to handle kernel paging request at virtual address ffff5aabf6b5c000 Call trace: percpu_counter_add_batch+0x3c/0x160 (P) dst_release+0xec/0x108 dst_cache_destroy+0x68/0xd8 dst_destroy+0x13c/0x168 dst_destroy_rcu+0x1c/0xb0 rcu_do_batch+0x18c/0x7d0 rcu_core+0x174/0x378 rcu_core_si+0x18/0x30 Fix this by invalidating the cache, and thus decrementing cached dst counters, in dst_release too.
Where it lives
The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.
net/core/dst.c
- What this is
- NETWORKING [GENERAL]MAINTAINERS section matched on net/ · netdev@vger.kernel.org · Maintained
Show whether Debian builds this, per release
Debian builds this code. Every release below compiles the affected file into the kernels it ships.
- bookworm, trixie, forky, sidy
- y
- built into the kernel image on every flavour - only a patch removes it
From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS Debian linux-config packages
Signals
- Published
- 2025-04-16 (18 months ago)source
- CVSS
- 7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:Hsource recompute it - Attack vector
- local (AV:L)source
- EPSS
- 0.21%, higher than 10.8% of all CVEssource
- CISA KEV
- not listedthe KEV catalogue
- Debian urgency
- not yet assignedsource
- Subsystem
- net/core
Upstream fixes
The versions the CNA records as introducing and fixing this, and the commit for each. source
| Introduced | Fixed in | Commit |
|---|---|---|
| 4.6 | 6.6.87 | ccc331fd5bca |
| 4.6 | 6.12.23 | 92a5c1851311 |
| 4.6 | 6.13.11 | 836415a8405c |
| 4.6 | 6.14.2 | e833e7ad64eb |
| 4.6 | 6.15 | 3a0a3ff6593d |
Why the CNA scored it this way
Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source
- AV:LAttack vector, local
- Triggering requires local configuration of a metadata tunnel (tc `action tunnel_key set`, nft tunnel object, or OVS set_tunnel) via netlink plus a network-namespace dismantle; received packets alone cannot populate the dst_cache since RX-allocated tun_dsts have no cache initialized.
- AC:LAttack complexity, low
- The attacker controls both sides — they configure the cached tunnel dst and they trigger the netns teardown that frees the percpu counter — and `cleanup_net()` performs no rcu_barrier() between device-op exit (which queues dst_destroy_rcu) and ip6_route_net_exit(), so the window is wide and the whole sequence can be repeated in a loop until it lands.
- PR:LPrivileges required, low
- tc actions, nftables tunnel objects, tunnel device creation and netns teardown are all gated by `netlink_net_capable(skb, CAP_NET_ADMIN)`, which checks against `sock_net(sk)->user_ns`, so an unprivileged local user obtains everything needed via `unshare -Urn`.
- UI:NUser interaction, none
- The attacker performs the entire sequence — namespace creation, tunnel/action setup, traffic generation, and namespace destruction — with no action by any other user.
- S:UScope, unchanged
- The use-after-free corrupts kernel memory within the same kernel security authority; no VM, IOMMU, or hypervisor boundary is crossed.
- C:HConfidentiality impact, high
- `percpu_counter_add_batch()` reads freed percpu memory through the dangling `fbc->counters` pointer and folds that value into a kernel counter; per use-after-free scoring this yields potential disclosure of reclaimed kernel heap contents.
- I:HIntegrity impact, high
- The stale `this_cpu_write()` performs a use-after-free write into a freed percpu chunk that other percpu allocations can reclaim, corrupting unrelated kernel state (e.g. counters/refcounts) in an attacker-groomable way.
- A:HAvailability impact, high
- The reported failure is a fatal kernel paging fault in `percpu_counter_add_batch()` from an RCU softirq callback, which panics or oopses the machine in unrecoverable context.