CVE-2025-40014

objtool, spi: amd: Fix out-of-bounds stack access in amd_set_spi_freq()

State
Published
Severity
7.8 High
Published
Apr 18, 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:

objtool, spi: amd: Fix out-of-bounds stack access in amd_set_spi_freq()

If speed_hz < AMD_SPI_MIN_HZ, amd_set_spi_freq() iterates over the entire amd_spi_freq array without breaking out early, causing 'i' to go beyond the array bounds.

Fix that by stopping the loop when it gets to the last entry, so the low speed_hz value gets clamped up to AMD_SPI_MIN_HZ.

Fixes the following warning with an UBSAN kernel:

drivers/spi/spi-amd.o: error: objtool: amd_set_spi_freq() falls through to next function amd_spi_set_opcode()

Scores

CVSSScoreVectorSource
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HCISA-ADP

Weaknesses

  • CWE-129 Improper Validation of Array Index

Affected Products

ProductVersions
LinuxLinux
  • e6204f39fe3a7b4538815a2d778b601bd543649e to before 7f2c746e09a3746bf937bc708129dc8af61d8f19Affected
  • e6204f39fe3a7b4538815a2d778b601bd543649e to before 76e51db43fe4aaaebcc5ddda67b0807f7c9bdeccAffected
LinuxLinux
  • 6.14Affected
  • before 6.14Not affected
  • 6.14.2 through 6.14.*Not affected
  • 6.15 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.