一、 漏洞 CVE-2025-40014 基础信息
漏洞信息
# objtool, spi: amd: 修复 amd_set_spi_freq() 中的栈溢出访问问题

## 漏洞描述

### 概述
在Linux内核中,`amd_set_spi_freq()` 函数存在栈溢出访问漏洞。当 `speed_hz < AMD_SPI_MIN_HZ` 时,该函数遍历整个 `amd_spi_freq` 数组而没有提前退出,导致索引超出数组边界。

### 影响版本
无具体影响版本信息

### 细节
- 当参数 `speed_hz` 小于常量 `AMD_SPI_MIN_HZ` 时,`amd_set_spi_freq()` 函数会遍历整个 `amd_spi_freq` 数组。
- 目前该函数没有在数组越界前停止迭代,导致索引超出数组边界。
- 修复方法是在到达数组最后一个元素时结束循环,确保 `speed_hz` 值会被限制到不低于 `AMD_SPI_MIN_HZ`。

此漏洞会导致UBSAN(Undefined Behavior Sanitizer)内核报告以下错误:
```
drivers/spi/spi-amd.o: error: objtool: amd_set_spi_freq() falls through to next function amd_spi_set_opcode()
```

### 影响
可能导致栈溢出访问,从而存在潜在的安全风险。
备注
尽管我们采用了先进的大模型技术,但其输出仍可能包含不准确或过时的信息。
神龙会尽力确保数据准确,但也请结合实际情况进行甄别与判断。
神龙祝您一切顺利!
漏洞标题
objtool, spi: amd: Fix out-of-bounds stack access in amd_set_spi_freq()
来源:美国国家漏洞数据库 NVD
漏洞描述信息
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()
来源:美国国家漏洞数据库 NVD
CVSS信息
N/A
来源:美国国家漏洞数据库 NVD
漏洞类别
N/A
来源:美国国家漏洞数据库 NVD
二、漏洞 CVE-2025-40014 的公开POC
# POC 描述 源链接 神龙链接
三、漏洞 CVE-2025-40014 的情报信息