dmaengine: mmp_pdma: fix wrong sg length in mmp_pdma_prep_slave_sg()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c8acd6aa6bed3c0fd7898202f4ebc534db9085f2 · < bae65e4925928f77824ca0103122e2ed20ef5802| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel's mmp_pdma DMA driver reads the first scatterlist entry's length for every entry. A multi-entry list can cause out-of-bounds reads when a later entry is shorter, or silent data loss when it is longer. The input does not specify whether an attacker can trigger this remotely, whether authentication is needed, or whether user interaction is required.
Engineers running Linux kernels that use the mmp_pdma driver should check their versions; affected versions are not specified.