CVE-2025-40014: objtool, spi: amd: Fix out-of-bounds stack access in amd_set_spi_freq()
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()
Security readout for executives and security teams
Plain-English summary
This is a Linux kernel memory-safety flaw in the AMD SPI driver. A low SPI speed value can make kernel code read past a stack array boundary. The source rates it high because a local, low-privileged user could potentially affect confidentiality, integrity, and availability on affected kernels.
Executive priority
Treat as a high-priority kernel patching item, especially for shared Linux systems. It is not presented as internet-exploitable in the sources, but kernel memory-safety bugs can have serious impact when local access exists.
Technical view
amd_set_spi_freq() can iterate past amd_spi_freq when speed_hz is below AMD_SPI_MIN_HZ, producing an out-of-bounds stack access. The kernel fix clamps low speed values by stopping at the final array entry. The issue is classified as CWE-129 with CVSS 7.8, local attack vector, low privileges, and no user interaction.
Likely exposure
Exposure is most likely on systems running affected Linux kernel versions identified by the CVE source, especially where the AMD SPI driver code is present. Distribution kernels may backport fixes, so version strings alone are not enough.
Exploitation context
The supplied sources do not report active exploitation, and KEV is false. The CVSS vector requires local access and low privileges. No remote attack path is identified in the provided evidence.
Researcher notes
Evidence is limited to the CVE description, CVSS metadata, affected version data, and stable kernel commits. The vulnerability appears to be a bounds-checking error in frequency selection logic, fixed by clamping low speed values at the final frequency entry.
Mitigation direction
Apply Linux kernel updates containing the referenced stable fixes.
Check distribution vendor advisories for backported fixed packages.
Prioritize affected systems that allow untrusted local users or workloads.
Restrict local access on vulnerable systems until patched.
Monitor vendor guidance for additional mitigation details.
Validation and detection
Inventory Linux kernel versions across servers, endpoints, and appliances.
Confirm whether installed kernel packages include the referenced fixes.
Check whether AMD SPI driver code is built or loaded.
Review distro advisories because fixes may be backported without version changes.
After updating, verify systems boot and SPI-dependent functions still work.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-129: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
1ADP providers
3Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-129 · source CWE mapping
Improper Validation of Array Index
Improper Validation of Array Index represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.