CVE-2023-54295
Unknown Unknown - Not Provided

Shift-Out-of-Bounds Vulnerability in Linux Kernel spi-nor Driver

Vulnerability report for CVE-2023-54295, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2025-12-30

Last updated on: 2025-12-30

Assigner: kernel.org

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]

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2025-12-30
Last Modified
2025-12-30
Generated
2026-07-06
AI Q&A
2025-12-30
EPSS Evaluated
2026-07-05
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
linux linux_kernel *

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-UNKNOWN

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is a shift-out-of-bounds error in the Linux kernel's spi_nor_set_erase_type() function, which is part of the SPI NOR flash memory driver. The function was incorrectly handling the masking out of an erase type, causing an invalid shift operation with an excessively large shift exponent. This could lead to undefined behavior or crashes. The fix involves setting the erase size to zero when masking out an erase type, avoiding the erroneous shift and incorrect opcode setting.

Impact Analysis

The vulnerability can cause undefined behavior such as kernel crashes or instability due to the shift-out-of-bounds error in the SPI NOR flash driver. This could potentially affect system reliability or availability on systems using the affected Linux kernel versions.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2023-54295. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart