Vulnerability · Published Dec 30, 2025 · Assigned by Linux
CVE-2023-54295mtd: spi-nor: Fix shift-out-of-bounds in spi_nor_set_erase_type
Unrated
In plain English
A security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 10% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: mtd: spi-nor: Fix shift-out-of-bounds in spi_nor_set_erase_type spi_nor_set_erase_type() was used either to set or to mask out an erase type. When we used it to mask out an erase type a shift-out-of-bounds was hit: UBSAN: shift-out-of-bounds in drivers/mtd/spi-nor/core.c:2237:24 shift exponent 4294967295 is too large for 32-bit type 'int' The setting of the size_{shift, mask} and of the opcode are unnecessary when the erase size is zero, as throughout the code just the erase size is considered to determine whether an erase type is supported or not. Setting the opcode to 0xFF was wrong too as nobody guarantees that 0xFF is an unused opcode. Thus when masking out an erase type, just set the erase size to zero. This will fix the shift-out-of-bounds. [ta: refine changes, new commit message, fix compilation error]
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.20-1 | DEBIAN-CVE-2023-54295 |
| Debian:13 | linux | 6.1.20-1 | DEBIAN-CVE-2023-54295 |
| Debian:14 | linux | 6.1.20-1 | DEBIAN-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux | 5.15.0-75.82 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1038.43 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1040.47 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1041.48.1 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1036.44 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1036.41 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1022.27 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:24.04:LTS | linux-hwe-6.11 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1032.35 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1033.38 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1035.40 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-75.82 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:24.04:LTS | linux-lowlatency-hwe-6.11 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1027.27 | UBUNTU-CVE-2023-54295 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1015.15 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1037.43 | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1032.35 | UBUNTU-CVE-2023-54295 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:24.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:24.04:LTS | linux-riscv-6.14 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2023-54295 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2023-54295 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 5390a8df769ec9ba9c995191bb0867430f602ebb – before e6409208c13f7c56adc12dd795abf4141e3d5e645390a8df769ec9ba9c995191bb0867430f602ebb – before 61d44a4db2f54dbac7d22c2541574ea5755e04685390a8df769ec9ba9c995191bb0867430f602ebb – before 53b2916ebde741c657a857fa1936c0d9fcb591705390a8df769ec9ba9c995191bb0867430f602ebb – before 99341b8aee7b5b4255b339345bbcaa35867dfd0c5390a8df769ec9ba9c995191bb0867430f602ebb – before f0f0cfdc3a024e21161714f2e05f0df3b84d42ad |
| Linux | Linux | 4.20 |
References
- https://git.kernel.org/stable/c/e6409208c13f7c56adc12dd795abf4141e3d5e64
- https://git.kernel.org/stable/c/61d44a4db2f54dbac7d22c2541574ea5755e0468
- https://git.kernel.org/stable/c/53b2916ebde741c657a857fa1936c0d9fcb59170
- https://git.kernel.org/stable/c/99341b8aee7b5b4255b339345bbcaa35867dfd0c
- https://git.kernel.org/stable/c/f0f0cfdc3a024e21161714f2e05f0df3b84d42ad