# CVE-2025-38277: mtd: nand: ecc-mxic: Fix use of uninitialized variable ret

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.19%, higher than 9% of CVEs (2026-12-01)
- Published: 2025-07-10T07:41:56.916Z
- Modified: 2026-06-17T09:16:32.070Z
- Weaknesses: CWE-908
- Assigned by: Linux

## Description

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

mtd: nand: ecc-mxic: Fix use of uninitialized variable ret

If ctx->steps is zero, the loop processing ECC steps is skipped,
and the variable ret remains uninitialized. It is later checked
and returned, which leads to undefined behavior and may cause
unpredictable results in user space or kernel crashes.

This scenario can be triggered in edge cases such as misconfigured
geometry, ECC engine misuse, or if ctx->steps is not validated
after initialization.

Initialize ret to zero before the loop to ensure correct and safe
behavior regardless of the ctx->steps value.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

(As written by CVE List.)

## Affected

- Linux Linux: from 48e6633a9fa2400b53a964358753769f291a7eb0 before 4d9d6e4be09472aa72953caca3dbefdc27846170; from 48e6633a9fa2400b53a964358753769f291a7eb0 before a0d9d9b5a4634e146ae41cb25667322e5c7d74d2; from 48e6633a9fa2400b53a964358753769f291a7eb0 before 7a23cc510ecaabab4f6df7e9d910d16e279b72ad; from 48e6633a9fa2400b53a964358753769f291a7eb0 before 49482f4a39620f6afedcd3f6aa9e0d558b6a460b; from 48e6633a9fa2400b53a964358753769f291a7eb0 before d95846350aac72303036a70c4cdc69ae314aa26d; 5.18 (not affected: before 5.18; from 6.1.142 up to 6.1.*; from 6.6.94 up to 6.6.*; from 6.12.34 up to 6.12.*; from 6.15.3 up to 6.15.*; from 6.16 up to *)
- linux linux_kernel: from 5.18 before 6.1.142; from 6.2 before 6.6.94; from 6.7 before 6.12.34; from 6.13 before 6.15.3
- debian debian_linux: 11.0

## References

- <https://git.kernel.org/stable/c/4d9d6e4be09472aa72953caca3dbefdc27846170> (patch)
- <https://git.kernel.org/stable/c/a0d9d9b5a4634e146ae41cb25667322e5c7d74d2> (patch)
- <https://git.kernel.org/stable/c/7a23cc510ecaabab4f6df7e9d910d16e279b72ad> (patch)
- <https://git.kernel.org/stable/c/49482f4a39620f6afedcd3f6aa9e0d558b6a460b> (patch)
- <https://git.kernel.org/stable/c/d95846350aac72303036a70c4cdc69ae314aa26d> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html> (mailing-list, third-party-advisory)

## Sources

- CVE List: [CVE-2025-38277](https://www.cve.org/CVERecord?id=CVE-2025-38277), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2025-38277](https://nvd.nist.gov/vuln/detail/CVE-2025-38277), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-38277 · Whole record: https://cve.day/CVE-2025-38277.json · Rebuilt by cve.day 2026-11-25T22:59:01.051Z
