Out-of-Bounds Stack Access in Linux Kernel's SPI Functionality

linux Updated 02 Oct 2025

Summary

18/04/2025
N/A
No i
High
7.8

CVE-2025-40014: 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_sp... Affects linux versions 6.1.106-1 – 6.9.9-1. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Linux kernel is a core component of many operating systems, providing essential services for hardware and software interaction. It is known for its stability, performance, and extensive support for various hardware architectures. The kernel's SPI (Serial Peripheral Interface) subsystem facilitates communication between the CPU and peripheral devices. However, a recent vulnerability has been identified in the SPI functionality related to AMD devices, which could lead to critical security issues if not addressed.

Vulnerability Detail

The vulnerability, identified as CVE-2025-40014, arises from an out-of-bounds stack access in the function amd_set_spi_freq(). When the speed_hz parameter is less than AMD_SPI_MIN_HZ, the function iterates through the entire amd_spi_freq array without an appropriate termination condition. This oversight allows the loop index 'i' to exceed the bounds of the array, potentially leading to memory corruption or crashes. The issue was detected using the Undefined Behavior Sanitizer (UBSAN) in the kernel, which flagged the function for falling through to the next function without a proper return.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, users can manually check the speed_hz parameter before calling the amd_set_spi_freq() function to ensure it does not fall below AMD_SPI_MIN_HZ. This can prevent the function from entering the problematic loop.

Conclusion

CVE-2025-40014 represents a significant vulnerability in the Linux kernel's SPI functionality, necessitating prompt action from users to mitigate potential risks. By updating to the patched version of the kernel and implementing suggested workarounds, users can protect their systems from exploitation.

See every vulnerability recorded for linux →

Share this vulnerability

FAQ

CVE-2025-40014 is a vulnerability in the Linux kernel's SPI functionality that allows for out-of-bounds stack access, potentially leading to memory corruption.

You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected by this vulnerability.

The risks include potential memory corruption, system crashes, and exploitation by malicious actors to execute arbitrary code.

Yes, a patch has been released for the Linux kernel that addresses CVE-2025-40014. Users are encouraged to update their systems.

If an immediate update is not possible, implement the suggested workaround by validating the speed_hz parameter before invoking the affected function.

Related vulnerabilities

Recent vulnerabilities recorded for linux.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback