Bug 2348227 (CVE-2022-49320) - CVE-2022-49320 kernel: dmaengine: zynqmp_dma: In struct zynqmp_dma_chan fix desc_size data type
Summary: CVE-2022-49320 kernel: dmaengine: zynqmp_dma: In struct zynqmp_dma_chan fix d...
Keywords:
Status: NEW
Alias: CVE-2022-49320
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-02-26 03:22 UTC by OSIDB Bzimport
Modified: 2025-02-27 08:03 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-02-26 03:22:03 UTC
In the Linux kernel, the following vulnerability has been resolved:

dmaengine: zynqmp_dma: In struct zynqmp_dma_chan fix desc_size data type

In zynqmp_dma_alloc/free_chan_resources functions there is a
potential overflow in the below expressions.

dma_alloc_coherent(chan->dev, (2 * chan->desc_size *
		   ZYNQMP_DMA_NUM_DESCS),
		   &chan->desc_pool_p, GFP_KERNEL);

dma_free_coherent(chan->dev,(2 * ZYNQMP_DMA_DESC_SIZE(chan) *
                 ZYNQMP_DMA_NUM_DESCS),
                chan->desc_pool_v, chan->desc_pool_p);

The arguments desc_size and ZYNQMP_DMA_NUM_DESCS were 32 bit. Though
this overflow condition is not observed but it is a potential problem
in the case of 32-bit multiplication. Hence fix it by changing the
desc_size data type to size_t.

In addition to coverity fix it also reuse ZYNQMP_DMA_DESC_SIZE macro in
dma_alloc_coherent API argument.

Addresses-Coverity: Event overflow_before_widen.

Comment 1 Avinash Hanwate 2025-02-27 07:56:17 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025022637-CVE-2022-49320-c76e@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.