objtool, spi: amd: Fix out-of-bounds stack access in amd_set_spi_freq()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
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()
From the CVE record · Linux
The Linux kernel's AMD SPI driver can access the stack out of bounds when amd_set_spi_freq() receives a speed below AMD_SPI_MIN_HZ. The input does not establish how an attacker could trigger this condition or whether network access, authentication, or user interaction is required.
Engineers running the Linux kernel should check whether their kernel includes the affected AMD SPI code; affected versions are not specified.