HIGH
nvmem ZynqMP Buffer Overflow
CVE-2026-31743
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: nvmem: zynqmp_nvmem: Fix buffer size in DMA and memcpy Buffer size used in dma allocation and memcpy is wrong. It can lead to undersized DMA buffer access and possible memory corruption. use correct buffer size in dma_alloc_coherent and memcpy.
02KernelScan AI Analysis
Risk summary
A buffer overflow vulnerability in the ZynqMP NVMEM driver can cause memory corruption when accessing eFuse data. The driver allocates undersized DMA buffers due to incorrect size calculations, potentially allowing out-of-bounds memory access. This could lead to system instability, data corruption, or potential privilege escalation on affected ZynqMP-based systems.
Vulnerability analysis
Root Cause: The zynqmp_nvmem driver incorrectly used sizeof(bytes) instead of bytes when allocating DMA buffers and performing memory operations. Since bytes is a size_t variable, sizeof(bytes) returns the size of the size_t type (typically 8 bytes on 64-bit systems) rather than the actual buffer size needed. This results in undersized DMA buffer allocations that can lead to out-of-bounds memory access and corruption.
Attack Surface: This vulnerability affects local access to the ZynqMP eFuse NVMEM interface. An attacker would need local access with sufficient privileges to interact with the NVMEM subsystem. The bug is triggered when reading or writing eFuse data through the standard NVMEM interface, making it accessible to any process with appropriate device permissions.
Fix Mechanism: The patch corrects three instances of incorrect buffer sizing: (1) changes dma_alloc_coherent allocation from sizeof(bytes) to bytes, (2) changes dma_free_coherent deallocation from sizeof(bytes) to bytes, and (3) changes memcpy operation from copying bytes to copying sizeof(value) for the specific case of copying to an integer variable. Additionally, the value variable type is changed from int to unsigned int for consistency.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 6.12 | 6.12.81 | 2f6e5b9964d0 |
| 6.18 | 6.18.22 | 784ed4abded1 |
| 6.19 | 6.19.12 | 6c01e7f11f5e |
| mainline | 7.0 | f9b88613ff40 |