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

- Severity: High 7.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/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.26%, higher than 19% of CVEs (2026-12-01)
- Published: 2025-04-18T07:01:40.151Z
- Modified: 2026-06-17T09:21:07.303Z
- Weaknesses: CWE-129
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Linux

## 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()

(As written by CVE List.)

## Affected

- Linux Linux: from e6204f39fe3a7b4538815a2d778b601bd543649e before 7f2c746e09a3746bf937bc708129dc8af61d8f19; from e6204f39fe3a7b4538815a2d778b601bd543649e before 76e51db43fe4aaaebcc5ddda67b0807f7c9bdecc; 6.14 (not affected: before 6.14; from 6.14.2 up to 6.14.*; from 6.15 up to *)
- linux linux_kernel: from 6.14 before 6.14.2

## Every score

- CISA-ADP: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://git.kernel.org/stable/c/7f2c746e09a3746bf937bc708129dc8af61d8f19> (patch)
- <https://git.kernel.org/stable/c/76e51db43fe4aaaebcc5ddda67b0807f7c9bdecc> (patch)

## Sources

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

---

Page: https://cve.day/CVE-2025-40014 · Whole record: https://cve.day/CVE-2025-40014.json · Rebuilt by cve.day 2026-11-25T22:58:56.764Z
