Skip to contentSkip to conversation

CVE-2026-98298: dmaengine: mmp_pdma: fix wrong sg length in mmp_pdma_prep_slave_sg()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Oct 6

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

dmaengine: mmp_pdma: fix wrong sg length in mmp_pdma_prep_slave_sg()

In mmp_pdma_prep_slave_sg(), for_each_sg() iterates the scatterlist putting each entry into 'sg', but the entry length is read from 'sgl' (the list head) instead of 'sg' (the current entry):

    for_each_sg(sgl, sg, sg_len, i) {
        addr = sg_dma_address(sg);
        avail = sg_dma_len(sgl);   /* should be 'sg' */

Consequently 'avail' is always the length of the first entry. For multi-sg lists this causes out-of-bounds reads when a later entry is shorter than the first, and silent data loss when it is longer. Single-sg or uniformly-sized lists happen to mask the issue.

The Linux kernel CVE team has assigned CVE-2026-98298 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 3.7 with commit c8acd6aa6bed3c0fd7898202f4ebc534db9085f2 and fixed in 5.10.271 with commit f448a5f5bd10d792440a1b08cf2e8f311767032d
	Issue introduced in 3.7 with commit c8acd6aa6bed3c0fd7898202f4ebc534db9085f2 and fixed in 5.15.222 with commit 2148db529f082d6e3ca95413bf943442f4ef30cc
	Issue introduced in 3.7 with commit c8acd6aa6bed3c0fd7898202f4ebc534db9085f2 and fixed in 6.1.189 with commit d920c07aa6d89ec11afdb6976aafaee9563a5234
	Issue introduced in 3.7 with commit c8acd6aa6bed3c0fd7898202f4ebc534db9085f2 and fixed in 6.6.158 with commit 4a33886057e6d127555efb022879c583e966acc5
	Issue introduced in 3.7 with commit c8acd6aa6bed3c0fd7898202f4ebc534db9085f2 and fixed in 6.12.112 with commit 88a505330eb06128f7ce79a4c5e4832b7601b3d1
	Issue introduced in 3.7 with commit c8acd6aa6bed3c0fd7898202f4ebc534db9085f2 and fixed in 6.18.54 with commit bae65e4925928f77824ca0103122e2ed20ef5802
	Issue introduced in 3.7 with commit c8acd6aa6bed3c0fd7898202f4ebc534db9085f2 and fixed in 7.2.8 with commit 54ccc01012a240476edf641bf1a2b8bff54fe6ae
	Issue introduced in 3.7 with commit c8acd6aa6bed3c0fd7898202f4ebc534db9085f2 and fixed in 7.3-rc4 with commit 075bc7b1d3dde5ed43fbaabbc1a69f09b7fc3a47

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-98298

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/mmp_pdma.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/f448a5f5bd10d792440a1b08cf2e8f311767032d
	https://git.kernel.org/stable/c/2148db529f082d6e3ca95413bf943442f4ef30cc
	https://git.kernel.org/stable/c/d920c07aa6d89ec11afdb6976aafaee9563a5234
	https://git.kernel.org/stable/c/4a33886057e6d127555efb022879c583e966acc5
	https://git.kernel.org/stable/c/88a505330eb06128f7ce79a4c5e4832b7601b3d1
	https://git.kernel.org/stable/c/bae65e4925928f77824ca0103122e2ed20ef5802
	https://git.kernel.org/stable/c/54ccc01012a240476edf641bf1a2b8bff54fe6ae
	https://git.kernel.org/stable/c/075bc7b1d3dde5ed43fbaabbc1a69f09b7fc3a47