# CVE-2026-64525: xfrm: move policy_bydst RCU sync from per-netns .exit to .pre_exit

> A Linux kernel flaw in xfrm policy cleanup causes excessive RCU grace periods during namespace deletion, leading to memory exhaustion and system denial of service.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 25 Jul 2026
- **Updated:** 25 Jul 2026
- **Also known as:** AZL-93803, BELL-CVE-2026-64525, DEBIAN-CVE-2026-64525, GHSA-phmc-55j6-972r, ROOT-OS-UBUNTU-2204-CVE-2026-64525, UBUNTU-CVE-2026-64525

## What is CVE-2026-64525?

CVE-2026-64525 is a denial of service vulnerability in Linux, published on 25 Jul 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

In the Linux kernel, the following vulnerability has been resolved:

xfrm: move policy_bydst RCU sync from per-netns .exit to .pre_exit

The struct pernet_operations docstring in include/net/net_namespace.h
explicitly warns against blocking RCU primitives in .exit handlers:

    Exit methods using blocking RCU primitives, such as
    synchronize_rcu(), should be implemented via exit_batch.
    [...]
    Please, avoid synchronize_rcu() at all, where it's possible.

    Note that a combination of pre_exit() and exit() can
    be used, since a synchronize_rcu() is guaranteed between
    the calls.

xfrm_policy_fini() violates this: it calls synchronize_rcu() before
freeing the policy_bydst hash tables (so no RCU reader is mid-
traversal at free time), but runs from xfrm_net_ops.exit -- once per
namespace -- so a cleanup_net() of N namespaces pays N full RCU
grace periods serially.

Use the documented pre_exit/exit split. Move the policy flush (and
the workqueue drains it depends on) into a new .pre_exit handler;
xfrm_policy_fini() then runs in .exit and frees the hash tables
after the synchronize_rcu_expedited() that cleanup_net() guarantees
between the two phases. Providing O(1) RCU grace periods per batch
instead of O(N).

Observed on Linux 6.18 with a workload doing unshare(CLONE_NEWNET)
at ~13/sec sustained: cleanup_net() and the netns_wq rescuer kthread
both stuck in xfrm_policy_fini()'s synchronize_rcu(), >300k struct
net accumulated in the cleanup queue, Percpu in /proc/meminfo climbed
to 130+ GB on 256-CPU hosts, and memcg OOMs followed. setup_net and
__put_net counts were balanced, ruling out a refcount leak.

## Which versions are affected by CVE-2026-64525?


## How do I fix CVE-2026-64525?

Apply the vendor's patch.

## Is CVE-2026-64525 being exploited?

There is no known exploitation of CVE-2026-64525 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-64525 and fix it if it is affected.

What it is: CVE-2026-64525 is a denial of service vulnerability in Linux, published on 25 Jul 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-64525 in the wild and no public exploit code.

Affected product: Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-64525/ (Markdown: https://insights.sbomify.com/CVE-2026-64525/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-64525
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-64525
- OSV: https://osv.dev/vulnerability/CVE-2026-64525

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-64525/
Summaries are generated and may contain mistakes; the official description above is the record.
