CVE-2026-23026: dmaengine: qcom: gpi: Fix memory leak in gpi_peripheral_config()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: qcom: gpi: Fix memory leak in gpi_peripheral_config()
Fix a memory leak in gpi_peripheral_config() where the original memory pointed to by gchan->config could be lost if krealloc() fails.
The issue occurs when:
1. gchan->config points to previously allocated memory
2. krealloc() fails and returns NULL
3. The function directly assigns NULL to gchan->config, losing the reference to the original memory
4. The original memory becomes unreachable and cannot be freed
Fix this by using a temporary variable to hold the krealloc() result and only updating gchan->config when the allocation succeeds.
Found via static analysis and code review.
The Linux kernel CVE team has assigned CVE-2026-23026 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.11 with commit 5d0c3533a19f48e5e7e73806a3e4b29cd4364130 and fixed in 6.6.122 with commit 6bf4ef078fd11910988889a6c0b3698d2e0c89af Issue introduced in 5.11 with commit 5d0c3533a19f48e5e7e73806a3e4b29cd4364130 and fixed in 6.12.67 with commit 01b1d781394fc9b83015e3a3cd46b17bda842bd8 Issue introduced in 5.11 with commit 5d0c3533a19f48e5e7e73806a3e4b29cd4364130 and fixed in 6.18.7 with commit 55a67ba5ac4cebfd54cc8305d4d57a0f1dfe6a85 Issue introduced in 5.11 with commit 5d0c3533a19f48e5e7e73806a3e4b29cd4364130 and fixed in 6.19-rc6 with commit 3f747004bbd641131d9396d87b5d2d3d1e182728
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-23026
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/dma/qcom/gpi.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/6bf4ef078fd11910988889a6c0b3698d2e0c89af https://git.kernel.org/stable/c/01b1d781394fc9b83015e3a3cd46b17bda842bd8 https://git.kernel.org/stable/c/55a67ba5ac4cebfd54cc8305d4d57a0f1dfe6a85 https://git.kernel.org/stable/c/3f747004bbd641131d9396d87b5d2d3d1e182728