Skip to main content

Linux Kernel CVE-2025-38398

MEDIUM
NULL Pointer Dereference (CWE-476)
2025-07-25 416baaa9-dc9f-4396-8d5f-8c081fb06d67
5.5
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain local access to Qualcomm NAND-equipped device
  2. Delivery
    Load or confirm spi-qpic-snand module is active
  3. Exploit
    Initiate MTD flash operation on large-page NAND chip
  4. Execution
    Driver writes past single-codeword BAM transaction buffer
  5. Persist
    Kernel heap memory corrupted
  6. Impact
    Kernel panic or system crash on next DMA or reboot operation

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A10:2025 - Mishandling of Exceptional Conditions
ASVS 5.0
V16 - Security Logging and Error Handling Null pointer safety, defensive checks
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires all of the following concrete conditions: (1) the host system must use a Qualcomm SoC with a QPIC NAND controller (hardware prerequisite - x86, ARM servers, and non-Qualcomm embedded SoCs are entirely unaffected); (2) the spi-qpic-snand kernel module must be loaded and the controller active; (3) the attached NAND flash chip must have a page size that yields more than one ECC codeword per page - larger-page NAND chips (e.g., 4KB or 8KB page devices) are more likely to trigger the overrun than 2KB-page devices; (4) an attacker or process must initiate a NAND read, write, or erase operation that exercises multi-codeword BAM descriptor paths (PR:L per CVSS - standard MTD userspace access is sufficient). The crash may manifest immediately on the failing operation or deferred until next reboot. Non-Qualcomm-NAND systems, systems with only SPI-NOR or eMMC storage, and systems where the module is not loaded are fully exempt.

Impact

The provided CVSS 3.1 vector (AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H, score 5.5) is well-calibrated and consistent with the vulnerability mechanics. Local access vector (AV:L) correctly reflects that exploitation requires physical or shell access to a Qualcomm SoC-based device with NAND storage; the spi-qpic-snand driver is absent from the vast majority of server and desktop Linux deployments. Low-privilege requirement (PR:L) reflects that a non-root user capable of invoking MTD operations can trigger the condition. EPSS of 0.13% at the 3rd percentile strongly corroborates that real-world exploitation is improbable at scale - the hardware prerequisite alone severely limits the vulnerable population. There is no CISA KEV listing and no public exploit code. The only impact is availability (A:H via kernel panic); there is no confidentiality or integrity path from this bug because the out-of-bounds write is not attacker-directed in content, only in extent. Overall, this is a genuine but low-priority, hardware-specific kernel stability bug relevant primarily to embedded and mobile Qualcomm platform maintainers, not a priority for general enterprise or cloud environments.

Exploit ScenarioDerived

A local user with low-privilege shell access on a Qualcomm SoC embedded device (e.g., a router or gateway running OpenWrt) invokes MTD utilities to read or write NAND flash pages on a chip whose page size results in multiple codewords per operation, triggering the out-of-bounds BAM transaction buffer write. The kernel heap corruption manifests either immediately as a swiotlb mapping failure or on the next system reboot as a kernel panic due to spinlock magic corruption or NULL pointer dereference in unrelated subsystems. No public proof-of-concept code exists; the issue was discovered via the in-tree mtd_nandbiterrs test module.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 30, 2026

Out-of-bounds heap write in the Linux kernel's spi-qpic-snand driver corrupts kernel memory on Qualcomm NAND-equipped devices, resulting in kernel panics, swiotlb mapping failures, and spinlock corruption. The flaw triggers whenever NAND flash operations require more than one codeword - a quantity determined by the chip's page size that is unknown at probe time - causing the BAM transaction buffer, allocated for only a single codeword, to be overrun. Real-world impact is denial of service via kernel crash; EPSS is 0.13% (3rd percentile), no public exploit exists, and the vulnerability is not listed in CISA KEV.

RemediationAI

Apply the upstream stable-tree patches committed at https://git.kernel.org/stable/c/86fb36de1132b560f9305f0c78fa69f459fa0980 and https://git.kernel.org/stable/c/d85d0380292a7e618915069c3579ae23c7c80339. Distribution maintainers for Qualcomm-targeted embedded Linux (e.g., OpenWrt, Yocto-based BSPs) should backport these commits to their respective stable branches. A specific patched kernel release tag is not independently confirmed from available data - only upstream git commits are referenced. As a compensating control, blacklisting or not loading the spi-qpic-snand kernel module (echo 'blacklist spi-qpic-snand' >> /etc/modprobe.d/qpic.conf) will prevent the vulnerable code from executing, but will entirely disable NAND flash access on affected hardware, making this suitable only for systems where NAND storage is non-essential. Systems not based on Qualcomm QPIC NAND hardware require no action regardless of kernel version.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The affected code is the Qualcomm QPIC (Qualcomm Peripheral Image Controller) Serial NAND driver in the Linux kernel SPI subsystem, identified by CPE as cpe:2.3:o:linux:linux_kernel across multiple stable branches through 6.16-rc4. The driver uses BAM (Bus Access Manager), Qualcomm's DMA engine, to issue batched descriptor transactions to NAND flash. BAM transactions are represented as a dynamically allocated structure that must be sized to hold all descriptor entries for the worst-case flash operation. During probe (qcom_nandc_alloc()), the NAND chip's page size and resulting codeword count are unknown, so the allocation covers only a single codeword. Once the NAND chip is identified and multi-codeword operations commence (e.g., full-page reads or writes), the driver indexes past the end of the allocated buffer, corrupting adjacent heap memory. The assigned CWE-476 (NULL Pointer Dereference) is an imprecise classification - the root cause is a heap out-of-bounds write (CWE-787), with NULL pointer dereference appearing only as a downstream symptom of the corrupted kernel state after reboot.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 5.5 MEDIUM
AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 5.5 MEDIUM

Local vector and low privilege confirmed by hardware-specific driver context; availability-only impact as heap corruption causes kernel crashes with no attacker-controlled data disclosure or write.

3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
4.0 AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE 7.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

DescriptionNVD

In the Linux kernel, the following vulnerability has been resolved:

spi: spi-qpic-snand: reallocate BAM transactions

Using the mtd_nandbiterrs module for testing the driver occasionally results in weird things like below.

  1. swiotlb mapping fails with the following message:

[ 85.926216] qcom_snand 79b0000.spi: swiotlb buffer is full (sz: 4294967294 bytes), total 512 (slots), used 0 (slots) [ 85.932937] qcom_snand 79b0000.spi: failure in mapping desc [ 87.999314] qcom_snand 79b0000.spi: failure to write raw page [ 87.999352] mtd_nandbiterrs: error: write_oob failed (-110)

Rebooting the board after this causes a panic due to a NULL pointer dereference.

  1. If the swiotlb mapping does not fail, rebooting the board may result

in a different panic due to a bad spinlock magic:

[ 256.104459] BUG: spinlock bad magic on CPU#3, procd/2241 [ 256.104488] Unable to handle kernel paging request at virtual address ffffffff0000049b ...

Investigating the issue revealed that these symptoms are results of memory corruption which is caused by out of bounds access within the driver.

The driver uses a dynamically allocated structure for BAM transactions, which structure must have enough space for all possible variations of different flash operations initiated by the driver. The required space heavily depends on the actual number of 'codewords' which is calculated from the pagesize of the actual NAND chip.

Although the qcom_nandc_alloc() function allocates memory for the BAM transactions during probe, but since the actual number of 'codewords' is not yet know the allocation is done for one 'codeword' only.

Because of this, whenever the driver does a flash operation, and the number of the required transactions exceeds the size of the allocated arrays the driver accesses memory out of the allocated range.

To avoid this, change the code to free the initially allocated BAM transactions memory, and allocate a new one once the actual number of 'codewords' required for a given NAND chip is known.

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Prevalence
Low
hardware-specific driver for Qualcomm QPIC NAND SoC platforms only
Data Quality
3 sources
Confidence: Low

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

28
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

A null pointer dereference occurs when a program attempts to access memory through a pointer that has been set to NULL (address 0x0).

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)NVD

cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.16:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.16:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.16:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.16:rc4:*:*:*:*:*:*

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise High Availability Extension 15 SP7 Not-Affected
SUSE Linux Enterprise High Availability Extension 15 SP7 Not-Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Not-Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy