# mm/ksm: fix flag-dropping behavior in ksm_madvise

CVE record · `CVE-2025-40040`

- **Identifiers:** `CVE-2025-40040`
- **State:** Confirmed
- **Severity:** CVSS 7.8 High
- **Critical:** No
- **CNA:** Linux
- **Technologies:** [Linux kernel](https://agentprime.io/advisories/technology/linux-kernel.md)
- **Published:** 28 Oct 2025
- **Updated:** 15 Oct 2026
- **Reviewed by a person:** No

Published by the CVE Program (CNA: Linux) at 28 Oct 2025, 11:48 UTC. agentprime has not analysed this yet, so whether it affects any app is not known. This CVE names a vendor and product rather than a package, so the lockfile check doesn’t match it.

## Affected products, as the CNA wrote them

- Vendor: Linux. Product: Linux.
  - affected: `63c17fb8e5a46a16e10e82005748837fd11a2024 to before 850f1ea245bdc0ce6a3fd36bfb80d8cf9647cb71` (git)
  - affected: `63c17fb8e5a46a16e10e82005748837fd11a2024 to before 788e5385d0ff69cdba1cabccb9dab8d9647b9239` (git)
  - affected: `63c17fb8e5a46a16e10e82005748837fd11a2024 to before b69f19244c2b6475c8a6eb72f0fb0d53509e48cd` (git)
  - affected: `63c17fb8e5a46a16e10e82005748837fd11a2024 to before 41cb9fd904fe0c39d52e82dd84dc3c96b7aa9693` (git)
  - affected: `63c17fb8e5a46a16e10e82005748837fd11a2024 to before 92b82e232b8d8b116ac6e57aeae7a6033db92c60` (git)
  - affected: `63c17fb8e5a46a16e10e82005748837fd11a2024 to before ac50c6e0a8f91a02b681af81abb2362fbb67cc18` (git)
  - affected: `63c17fb8e5a46a16e10e82005748837fd11a2024 to before 76385629f45740b7888f8fcd83bde955b10f61fe` (git)
  - affected: `63c17fb8e5a46a16e10e82005748837fd11a2024 to before f04aad36a07cc17b7a5d5b9a2d386ce6fae63e93` (git)
  - Other versions: unaffected
- Vendor: Linux. Product: Linux.
  - affected: `4.6`
  - unaffected: `before 4.6` (semver)
  - unaffected: `5.4.302 to 5.4.*, inclusive` (semver)
  - unaffected: `5.10.247 to 5.10.*, inclusive` (semver)
  - unaffected: `5.15.197 to 5.15.*, inclusive` (semver)
  - unaffected: `6.1.158 to 6.1.*, inclusive` (semver)
  - unaffected: `6.6.114 to 6.6.*, inclusive` (semver)
  - unaffected: `6.12.55 to 6.12.*, inclusive` (semver)
  - unaffected: `6.17.3 to 6.17.*, inclusive` (semver)
  - unaffected: `6.18 to *, inclusive` (original_commit_for_fix)
  - Other versions: affected

## Not analysed yet

We haven’t published our own analysis of this CVE. If a person reviews it, this page will say what’s affected and what has to be true for it to matter.

## Severity and exploitation

- 7.8 High, CVSS 3.1: `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`, from CNA (Linux)

- **CISA KEV:** Not listed.
- **EPSS:** 0.0039, the 33rd percentile, on 19 Nov 2026: FIRST’s estimate of the chance of exploitation in the next 30 days.

## Timeline

This record came from the full history of the CVE Program, published 28 Oct 2025. New records show when each source confirmed them.

## Sources

- [CVE List: CVE-2025-40040](https://www.cve.org/CVERecord?id=CVE-2025-40040)
- [NVD: CVE-2025-40040](https://nvd.nist.gov/vuln/detail/CVE-2025-40040)

### References from the CNA

- <https://git.kernel.org/stable/c/850f1ea245bdc0ce6a3fd36bfb80d8cf9647cb71>
- <https://git.kernel.org/stable/c/788e5385d0ff69cdba1cabccb9dab8d9647b9239>
- <https://git.kernel.org/stable/c/b69f19244c2b6475c8a6eb72f0fb0d53509e48cd>
- <https://git.kernel.org/stable/c/41cb9fd904fe0c39d52e82dd84dc3c96b7aa9693>
- <https://git.kernel.org/stable/c/92b82e232b8d8b116ac6e57aeae7a6033db92c60>
- <https://git.kernel.org/stable/c/ac50c6e0a8f91a02b681af81abb2362fbb67cc18>
- <https://git.kernel.org/stable/c/76385629f45740b7888f8fcd83bde955b10f61fe>
- <https://git.kernel.org/stable/c/f04aad36a07cc17b7a5d5b9a2d386ce6fae63e93>

Facts on this page come from the CVE List as the CNA published them, with CVSS from the sources named above, CISA KEV and FIRST EPSS. Vendors, products and versions are shown as the CNA wrote them. We don’t reproduce the CVE’s description.

## Check whether this affects you

This CVE names a vendor and product rather than a package, so the lockfile check doesn’t match it. Compare the affected versions above with what you run.

- With the agentprime MCP server (<https://api.agentprime.io/mcp>), `get_advisory` returns this record and `search_advisories` finds related ones. Setup: <https://agentprime.io/mcp.md>
- As JSON: <https://api.agentprime.io/v1/advisories/CVE-2025-40040>
- Everything that needs attention now: <https://agentprime.io/advisories/critical.md>

---

The web page: <https://agentprime.io/advisories/CVE-2025-40040/>. Everything for agents: <https://agentprime.io/llms.txt>.
