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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.23% (percentile 8, 2026-11-26)
- **Published:** 2025-10-24T11:44:28.955Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 8a6ecab3847c213ce2855b0378e63ce839085de3; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 421b1ae1574dfdda68b835c15ac4921ec0030182; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 1d79471414d7b9424d699afff2aa79fff322f52d; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 53717f8a4347b78eac6488072ad8e5adbaff38d9; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 8cbe2a21d85727b66d7c591fd5d83df0d8c4f757; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< dc1a481359a72ee7e548f1f5da671282a7c13b8f; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< a343811ef138a265407167294275201621e9ebb2; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 134121bfd99a06d44ef5ba15a9beb075297c0821
- Anyone running Linux 2.6.39

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

## Affected and fixed versions

- Linux: \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 8a6ecab3847c213ce2855b0378e63ce839085de3; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 421b1ae1574dfdda68b835c15ac4921ec0030182; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 1d79471414d7b9424d699afff2aa79fff322f52d; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 53717f8a4347b78eac6488072ad8e5adbaff38d9; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 8cbe2a21d85727b66d7c591fd5d83df0d8c4f757; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< dc1a481359a72ee7e548f1f5da671282a7c13b8f; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< a343811ef138a265407167294275201621e9ebb2; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 134121bfd99a06d44ef5ba15a9beb075297c0821 (cvelist)
- Linux: 2.6.39 (cvelist)

## Mitigation

- Upgrade Linux to 134121bfd99a06d44ef5ba15a9beb075297c0821 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-40018. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-40018.md
Affected: Linux >= 61b1ab4583e275af216c8454b9256de680499b19, < 8a6ecab3847c213ce2855b0378e63ce839085de3; >= 61b1ab4583e275af216c8454b9256de680499b19, < 421b1ae1574dfdda68b835c15ac4921ec0030182; >= 61b1ab4583e275af216c8454b9256de680499b19, < 1d79471414d7b9424d699afff2aa79fff322f52d; >= 61b1ab4583e275af216c845…
Fixed in: Linux 8a6ecab3847c213ce2855b0378e63ce839085de3, Linux 421b1ae1574dfdda68b835c15ac4921ec0030182, Linux 1d79471414d7b9424d699afff2aa79fff322f52d, Linux 53717f8a4347b78eac6488072ad8e5adbaff38d9, Linux 8cbe2a21d85727b66d7c591fd5d83df0d8c4f757, Linux 134121bfd99a06d44ef5ba15a9beb075297c0821

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-40018 being exploited?

There is no confirmed exploitation: CVE-2025-40018 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.23% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-40018?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-40018?

Linux \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 8a6ecab3847c213ce2855b0378e63ce839085de3; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 421b1ae1574dfdda68b835c15ac4921ec0030182; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 1d79471414d7b9424d699afff2aa79fff322f52d; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 53717f8a4347b78eac6488072ad8e5adbaff38d9; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 8cbe2a21d85727b66d7c591fd5d83df0d8c4f757; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< dc1a481359a72ee7e548f1f5da671282a7c13b8f; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< a343811ef138a265407167294275201621e9ebb2; \>= 61b1ab4583e275af216c8454b9256de680499b19, \< 134121bfd99a06d44ef5ba15a9beb075297c0821; Linux 2.6.39.

### Is there a fix for CVE-2025-40018?

Yes. Fixed in Linux 8a6ecab3847c213ce2855b0378e63ce839085de3, Linux 421b1ae1574dfdda68b835c15ac4921ec0030182, Linux 1d79471414d7b9424d699afff2aa79fff322f52d, Linux 53717f8a4347b78eac6488072ad8e5adbaff38d9, Linux 8cbe2a21d85727b66d7c591fd5d83df0d8c4f757, Linux 134121bfd99a06d44ef5ba15a9beb075297c0821. Upgrade Linux to 134121bfd99a06d44ef5ba15a9beb075297c0821 or later.

### How do I check if I'm affected by CVE-2025-40018?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

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

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-40018>

HTML: <https://flawdb.com/CVE-2025-40018> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-40018>
