CVE-2026-64525 in Linux
Summary
by MITRE • 07/25/2026
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.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 07/25/2026
This vulnerability represents a critical performance degradation and potential system instability issue within the Linux kernel's IPsec implementation, specifically affecting the xfrm subsystem responsible for managing security policies. The problem stems from improper handling of RCU (Read-Copy-Update) synchronization primitives during network namespace cleanup operations, creating serial bottlenecks that can lead to system hangs and resource exhaustion.
The technical flaw manifests in how the xfrm subsystem manages policy cleanup when network namespaces are destroyed. The original implementation placed synchronize_rcu() calls within the pernet_operations .exit handler, which is explicitly discouraged by kernel documentation in include/net/net_namespace.h. This approach forces each namespace cleanup to wait for a full RCU grace period sequentially, creating a linear scalability issue where the time required to clean up N namespaces grows proportionally with N rather than remaining constant.
The operational impact of this vulnerability becomes particularly severe under high-frequency namespace creation and destruction workloads, as demonstrated in the affected Linux 6.18 environment where unshare(CLONE_NEWNET) operations occurred at approximately 13 times per second. Under these conditions, the cleanup_net() function became blocked indefinitely in xfrm_policy_fini()'s synchronize_rcu() calls, leading to accumulation of over 300,000 struct net instances in the cleanup queue. This resulted in excessive memory consumption with Percpu allocations reaching 130+ GB on 256-CPU systems, ultimately triggering memory cgroup OOM conditions that could compromise system stability.
The solution implemented addresses this by properly utilizing the documented pre_exit/exit handler split mechanism within the kernel's pernet_operations framework. By moving the policy flush operations and workqueue drains to a new .pre_exit handler while keeping the actual hash table freeing in the .exit handler, the implementation achieves O(1) RCU grace periods per batch rather than O(N) serial waits. This change leverages the guaranteed synchronize_rcu_expedited() call between pre_exit and exit phases that cleanup_net() provides, eliminating the sequential blocking behavior that caused system hangs.
This vulnerability aligns with CWE-691: Insufficient Control Flow Management and represents a classic example of improper resource management in concurrent systems. The fix directly addresses ATT&CK technique T1484.001: Valid Accounts, by preventing system instability that could lead to service disruption, though the primary impact is on system availability rather than direct privilege escalation. The remediation ensures proper kernel scalability under high-concurrency workloads while maintaining the semantic correctness of RCU synchronization guarantees.
The resolution demonstrates the importance of following kernel documentation guidelines for pernet_operations implementation and highlights how seemingly minor deviations from established patterns can create significant performance bottlenecks. This issue affects all Linux versions using the problematic xfrm policy cleanup implementation and could potentially impact security-critical systems relying on IPsec and frequent namespace operations, making the fix essential for maintaining system stability under load.