CVE-2025-40018
Description
In the Linux kernel, the following vulnerability has been resolved:
ipvs: Defer ip_vs_ftp unregister during netns cleanup
On the netns cleanup path, __ip_vs_ftp_exit() may unregister ip_vs_ftp before connections with valid cp->app pointers are flushed, leading to a use-after-free.
Fix this by introducing a global exiting_module flag, set to true in ip_vs_ftp_exit() before unregistering the pernet subsystem. In __ip_vs_ftp_exit(), skip ip_vs_ftp unregister if called during netns cleanup (when exiting_module is false) and defer it to __ip_vs_cleanup_batch(), which unregisters all apps after all connections are flushed. If called during module exit, unregister ip_vs_ftp immediately.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A use-after-free in Linux kernel IPVS FTP helper due to premature unregistration during netns cleanup; fixed by deferring unregister until after connections are flushed.
Vulnerability
In the Linux kernel's IPVS subsystem, the ip_vs_ftp helper module could be unregistered during network namespace (netns) cleanup before all connections with valid cp->app pointers were flushed. This ordering issue led to a use-after-free condition when the connection cleanup code later attempted to access the already-freed app structure [1].
Exploitation
The vulnerability is triggered on the netns cleanup path. When a netns is being torn down, __ip_vs_ftp_exit() may call the unregister function for ip_vs_ftp while active connections still reference the helper. No special privileges are required beyond the ability to trigger netns cleanup (e.g., by removing a network namespace), and the attack surface is local to the kernel [1].
Impact
An attacker who can trigger netns cleanup while ip_vs_ftp connections are active could cause a use-after-free, potentially leading to memory corruption, system crash (denial of service), or possibly privilege escalation. The issue is classified as a high-severity memory safety bug [1].
Mitigation
The fix introduces a global exiting_module flag. During module exit, ip_vs_ftp is unregistered immediately; during netns cleanup, the unregister is deferred to __ip_vs_cleanup_batch(), which runs after all connections are flushed. The patch has been applied to the stable kernel tree [1][2][3]. Users should update to a patched kernel version.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
88a6ecab3847c421b1ae1574d1d79471414d753717f8a43478cbe2a21d857dc1a481359a7a343811ef138134121bfd99aVulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- git.kernel.org/stable/c/134121bfd99a06d44ef5ba15a9beb075297c0821nvd
- git.kernel.org/stable/c/1d79471414d7b9424d699afff2aa79fff322f52dnvd
- git.kernel.org/stable/c/421b1ae1574dfdda68b835c15ac4921ec0030182nvd
- git.kernel.org/stable/c/53717f8a4347b78eac6488072ad8e5adbaff38d9nvd
- git.kernel.org/stable/c/8a6ecab3847c213ce2855b0378e63ce839085de3nvd
- git.kernel.org/stable/c/8cbe2a21d85727b66d7c591fd5d83df0d8c4f757nvd
- git.kernel.org/stable/c/a343811ef138a265407167294275201621e9ebb2nvd
- git.kernel.org/stable/c/dc1a481359a72ee7e548f1f5da671282a7c13b8fnvd
News mentions
0No linked articles in our index yet.