CVE-2025-38277

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

State
Published
Severity
Not scored
Published
Jul 10, 2025
Updated
May 11, 2026
Reserved
Apr 16, 2025

Read the record on cve.org

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.

Scores

The record has no CVSS score.

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • 48e6633a9fa2400b53a964358753769f291a7eb0 to before 4d9d6e4be09472aa72953caca3dbefdc27846170Affected
  • 48e6633a9fa2400b53a964358753769f291a7eb0 to before a0d9d9b5a4634e146ae41cb25667322e5c7d74d2Affected
  • 48e6633a9fa2400b53a964358753769f291a7eb0 to before 7a23cc510ecaabab4f6df7e9d910d16e279b72adAffected
  • 48e6633a9fa2400b53a964358753769f291a7eb0 to before 49482f4a39620f6afedcd3f6aa9e0d558b6a460bAffected
  • 48e6633a9fa2400b53a964358753769f291a7eb0 to before d95846350aac72303036a70c4cdc69ae314aa26dAffected
LinuxLinux
  • 5.18Affected
  • before 5.18Not affected
  • 6.1.142 through 6.1.*Not affected
  • 6.6.94 through 6.6.*Not affected
  • 6.12.34 through 6.12.*Not affected
  • 6.15.3 through 6.15.*Not affected
  • 6.16 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.