CVE-2023-54295 json
mtd: spi-nor: Fix shift-out-of-bounds in spi_nor_set_erase_type
published 2025-12-30 10 mo ago modified 2026-06-17 4 mo ago also EUVD-2023-60509
- cvss
- —
- not scored
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 10%
- public exploits
- 0
- none known
Summary
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]
Patch / fix
- Linux Linux 5.10.173, 5.15.99, 6.1.16, 6.2.3, 6.3
- linux Debian 14, Debian 13, Debian 12 6.1.20-1
debian advisories DEBIAN-CVE-2023-54295
- linux Ubuntu 22.04 LTS 5.15.0-75.82
- linux-aws Ubuntu 22.04 LTS 5.15.0-1038.43
- linux-gcp Ubuntu 22.04 LTS 5.15.0-1036.44
- linux-gke Ubuntu 22.04 LTS 5.15.0-1036.41
- linux-ibm Ubuntu 22.04 LTS 5.15.0-1032.35
- linux-kvm Ubuntu 22.04 LTS 5.15.0-1035.40
- linux-azure Ubuntu 22.04 LTS 5.15.0-1040.47
- linux-gkeop Ubuntu 22.04 LTS 5.15.0-1022.27
ubuntu advisories UBUNTU-CVE-2023-54295
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-64kb SLES 15 SP4-LTSS, SLE High Performance Computing 15 SP4-LTSS, SLE High Performance Computing 15 SP4-ESPOS 5.14.21-150400.24.194.1
- kernel-syms SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE High Performance Computing 15 SP4-LTSS +1 more 5.14.21-150400.24.194.1
- kernel-source SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE High Performance Computing 15 SP4-LTSS +1 more 5.14.21-150400.24.194.1
- kernel-default SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE Micro 5.4 +5 more 5.14.21-150400.24.194.1
- kernel-obs-build SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE High Performance Computing 15 SP4-LTSS +1 more 5.14.21-150400.24.194.1
- kernel-default-base SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE Micro 5.4 +3 more 5.14.21-150400.24.194.1.150400.24.98.3
- kernel-rt SLE Micro 5.4, SLE Micro 5.3 5.14.21-150400.15.142.1
- kernel-source-rt SLE Micro 5.4, SLE Micro 5.3 5.14.21-150400.15.142.1
suse advisories SUSE-SU-2026:0617-1SUSE-SU-2026:0411-1SUSE-SU-2026:0317-1SUSE-SU-2026:0263-1
- git.kernel.org/stable/c/e6409208c13f7c56adc12dd795abf4141e3d5e64 commit
- git.kernel.org/stable/c/61d44a4db2f54dbac7d22c2541574ea5755e0468 commit
- git.kernel.org/stable/c/53b2916ebde741c657a857fa1936c0d9fcb59170 commit
- git.kernel.org/stable/c/99341b8aee7b5b4255b339345bbcaa35867dfd0c commit
- git.kernel.org/stable/c/f0f0cfdc3a024e21161714f2e05f0df3b84d42ad commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2023-54295 updated cvss 4.1
kernel: mtd: spi-nor: Fix shift-out-of-bounds in spi_nor_set_erase_type
-
Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 moreaffected: no fix available “Fix deferred”
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 10 kernelnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
0.20% chance of exploitation in the next 30 days, higher than 10% of all scored CVEs (FIRST EPSS, 2026-11-08).
Affected products
- Linux Linux
Classification
- Technology feeds
References
- git.kernel.org /stable/c/e6409208c13f7c56adc12dd795abf4141e3d5e64
- git.kernel.org /stable/c/61d44a4db2f54dbac7d22c2541574ea5755e0468
- git.kernel.org /stable/c/53b2916ebde741c657a857fa1936c0d9fcb59170
- git.kernel.org /stable/c/99341b8aee7b5b4255b339345bbcaa35867dfd0c
- git.kernel.org /stable/c/f0f0cfdc3a024e21161714f2e05f0df3b84d42ad
Sources
- CVE List CVE-2023-54295
- NVD CVE-2023-54295
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.