# CVE-2025-40245: nios2: ensure that memblock.current\_limit is set when setting pfn limits

> 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 9, 2026-11-26)
- **Published:** 2025-12-04T15:31:34.142Z
- **Modified:** 2026-10-19T19:10:00.130Z

## Who should check

- Anyone running Linux \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< 25f09699edd360b534ccae16bc276c3b52c471f3; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< 5c3e38a367822f036227dd52bac82dc4a05157e2; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< b1ec9faef7e36269ca3ec890972a78effbaeb975; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< 90f5f715550e07cd6a51f80fc3f062d832c8c997; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< 8912814f14e298b83df072fecc1f7ed1b63b1b2c; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< a20b83cf45be2057f3d073506779e52c7fa17f94
- Anyone running Linux 5.12

## Description

In the Linux kernel, the following vulnerability has been resolved:

nios2: ensure that memblock.current\_limit is set when setting pfn limits

On nios2, with CONFIG\_FLATMEM set, the kernel relies on
memblock\_get\_current\_limit() to determine the limits of mem\_map, in
particular for max\_low\_pfn.
Unfortunately, memblock.current\_limit is only default initialized to
MEMBLOCK\_ALLOC\_ANYWHERE at this point of the bootup, potentially leading
to situations where max\_low\_pfn can erroneously exceed the value of
max\_pfn and, thus, the valid range of available DRAM.

This can in turn cause kernel-level paging failures, e.g.:

\[   76.900000\] Unable to handle kernel paging request at virtual address 20303000
\[   76.900000\] ea = c0080890, ra = c000462c, cause = 14
\[   76.900000\] Kernel panic - not syncing: Oops
\[   76.900000\] ---\[ end Kernel panic - not syncing: Oops \]---

This patch fixes this by pre-calculating memblock.current\_limit
based on the upper limits of the available memory ranges via
adjust\_lowmem\_bounds, a simplified version of the equivalent
implementation within the arm architecture.

## Affected and fixed versions

- Linux: \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< 25f09699edd360b534ccae16bc276c3b52c471f3; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< 5c3e38a367822f036227dd52bac82dc4a05157e2; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< b1ec9faef7e36269ca3ec890972a78effbaeb975; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< 90f5f715550e07cd6a51f80fc3f062d832c8c997; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< 8912814f14e298b83df072fecc1f7ed1b63b1b2c; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< a20b83cf45be2057f3d073506779e52c7fa17f94 (cvelist)
- Linux: 5.12 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-40245.md
Affected: Linux >= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, < 25f09699edd360b534ccae16bc276c3b52c471f3; >= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, < 5c3e38a367822f036227dd52bac82dc4a05157e2; >= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, < b1ec9faef7e36269ca3ec890972a78effbaeb975; >= 7f7bc20bc41a4fbcd2db75b…
Fixed in: Linux 25f09699edd360b534ccae16bc276c3b52c471f3, Linux 5c3e38a367822f036227dd52bac82dc4a05157e2, Linux 90f5f715550e07cd6a51f80fc3f062d832c8c997, Linux 8912814f14e298b83df072fecc1f7ed1b63b1b2c

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-40245 being exploited?

There is no confirmed exploitation: CVE-2025-40245 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-40245?

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

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

Linux \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< 25f09699edd360b534ccae16bc276c3b52c471f3; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< 5c3e38a367822f036227dd52bac82dc4a05157e2; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< b1ec9faef7e36269ca3ec890972a78effbaeb975; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< 90f5f715550e07cd6a51f80fc3f062d832c8c997; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< 8912814f14e298b83df072fecc1f7ed1b63b1b2c; \>= 7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae, \< a20b83cf45be2057f3d073506779e52c7fa17f94; Linux 5.12.

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

Yes. Fixed in Linux 25f09699edd360b534ccae16bc276c3b52c471f3, Linux 5c3e38a367822f036227dd52bac82dc4a05157e2, Linux 90f5f715550e07cd6a51f80fc3f062d832c8c997, Linux 8912814f14e298b83df072fecc1f7ed1b63b1b2c. No fix listed yet: follow the vendor advisory.

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

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/25f09699edd360b534ccae16bc276c3b52c471f3>
- other: <https://git.kernel.org/stable/c/5c3e38a367822f036227dd52bac82dc4a05157e2>
- other: <https://git.kernel.org/stable/c/b1ec9faef7e36269ca3ec890972a78effbaeb975>
- other: <https://git.kernel.org/stable/c/90f5f715550e07cd6a51f80fc3f062d832c8c997>
- other: <https://git.kernel.org/stable/c/8912814f14e298b83df072fecc1f7ed1b63b1b2c>
- other: <https://git.kernel.org/stable/c/a20b83cf45be2057f3d073506779e52c7fa17f94>

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

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