CVE-2023-54295: mtd: spi-nor: Fix shift-out-of-bounds in spi_nor_set_erase_type
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]
Security readout for executives and security teams
Plain-English summary
This Linux kernel issue is a driver bug in SPI NOR flash handling. A malformed internal erase-type state could trigger undefined shift behavior when an erase type is disabled. The sources do not describe business impact, remote reachability, or privilege requirements, so urgency depends on whether affected kernels and SPI NOR paths exist in your estate.
Executive priority
Treat this as a kernel maintenance item with unknown severity. Prioritize embedded, appliance, and hardware-facing Linux assets first, especially where SPI NOR flash is used or kernel update lag is high.
Technical view
The flaw is in drivers/mtd/spi-nor/core.c, where spi_nor_set_erase_type() could shift by an out-of-bounds exponent while masking out an erase type. The fix avoids setting size shifts, masks, or opcode when erase size is zero, and only clears erase size.
Likely exposure
Exposure is most plausible on Linux systems using the MTD SPI NOR driver. The bundle lists Linux as affected and references stable kernel fixes, but it does not provide CVSS, CWE, exploit prerequisites, or distribution-specific package status.
Exploitation context
No active exploitation is supported by the bundle. KEV is false, and the provided sources describe a resolved kernel bug rather than observed attacks, public exploit use, or a remote attack path.
Researcher notes
Evidence is limited to the CVE description and upstream stable commits. The bundle does not establish exploitability, attacker control, crash impact, privilege boundary crossing, or affected downstream packages. Avoid assigning higher severity without additional vendor analysis.
Mitigation direction
Check vendor or distribution advisories for kernels containing the referenced stable fixes.
Prioritize systems using SPI NOR flash or MTD functionality.
Plan kernel updates through normal maintenance windows unless local risk evidence is higher.
Avoid assuming non-Linux products are affected without vendor confirmation.
Validation and detection
Inventory running Linux kernel versions across servers, appliances, and embedded systems.
Identify systems with SPI NOR or MTD driver usage enabled.
Compare deployed kernel builds against vendor-fixed releases or referenced upstream commits.
Review kernel logs for related UBSAN shift-out-of-bounds reports if UBSAN is enabled.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2023-54295 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
0CVSS vectors
3Timeline events
0ADP providers
6Source links
Vulnerability timeline
Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.
CVE reservedCVE Program
The CVE ID was reserved by the assigning CNA.
CVE publishedCVE Program
The CVE record was published.
Dec 30, 2025, 12:23 UTC (UTC+00:00)
CVE updatedCVE Program
The CVE record metadata indicates this as the latest update time.