In the Linux kernel, the following vulnerability has been resolved:
dmaengine: zynqmpdma: In struct zynqmpdmachan fix descsize data type
In zynqmpdmaalloc/freechanresources functions there is a potential overflow in the below expressions.
dmaalloccoherent(chan->dev, (2 * chan->descsize * ZYNQMPDMANUMDESCS), &chan->descpoolp, GFP_KERNEL);
dmafreecoherent(chan->dev,(2 * ZYNQMPDMADESCSIZE(chan) * ZYNQMPDMANUMDESCS), chan->descpoolv, chan->descpoolp);
The arguments descsize and ZYNQMPDMANUMDESCS 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 descsize data type to sizet.
In addition to coverity fix it also reuse ZYNQMPDMADESCSIZE macro in dmaalloc_coherent API argument.
Addresses-Coverity: Event overflowbeforewiden.
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49320.json"
}[
{
"signature_version": "v1",
"id": "CVE-2022-49320-10aa6861",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7b5488f4721fed6e121e661e165bab06ae2f8675",
"signature_type": "Line",
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"15745459993968034187081617612726760275",
"118405136351451998698787752175732939254",
"132278025114178657816069807602964453230",
"118694287056036514248712628551265941802",
"32353791803560743044108910403448387214",
"89737756666215951980236040375344314876",
"64107384619075976456175612651754899504",
"170373996375411365822072169907616122143"
]
},
"target": {
"file": "drivers/dma/xilinx/zynqmp_dma.c"
}
},
{
"signature_version": "v1",
"id": "CVE-2022-49320-1d457a0b",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7b5488f4721fed6e121e661e165bab06ae2f8675",
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1208.0,
"function_hash": "329091866080619965846505508273174874897"
},
"target": {
"function": "zynqmp_dma_alloc_chan_resources",
"file": "drivers/dma/xilinx/zynqmp_dma.c"
}
},
{
"signature_version": "v1",
"id": "CVE-2022-49320-1f7ffe17",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@95a0ba85c1b51b36e909841c02d205cd223ab753",
"signature_type": "Line",
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"15745459993968034187081617612726760275",
"118405136351451998698787752175732939254",
"132278025114178657816069807602964453230",
"118694287056036514248712628551265941802",
"32353791803560743044108910403448387214",
"89737756666215951980236040375344314876",
"64107384619075976456175612651754899504",
"170373996375411365822072169907616122143"
]
},
"target": {
"file": "drivers/dma/xilinx/zynqmp_dma.c"
}
},
{
"signature_version": "v1",
"id": "CVE-2022-49320-26ab2bc5",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@83960276ffc9bf5570d4106490346b61e61be5f3",
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1208.0,
"function_hash": "329091866080619965846505508273174874897"
},
"target": {
"function": "zynqmp_dma_alloc_chan_resources",
"file": "drivers/dma/xilinx/zynqmp_dma.c"
}
},
{
"signature_version": "v1",
"id": "CVE-2022-49320-53436ca1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@90aefae2e3a770a6909d339f5d8a988c0b0ceaf0",
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1208.0,
"function_hash": "329091866080619965846505508273174874897"
},
"target": {
"function": "zynqmp_dma_alloc_chan_resources",
"file": "drivers/dma/xilinx/zynqmp_dma.c"
}
},
{
"signature_version": "v1",
"id": "CVE-2022-49320-6b69510d",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@83960276ffc9bf5570d4106490346b61e61be5f3",
"signature_type": "Line",
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"15745459993968034187081617612726760275",
"118405136351451998698787752175732939254",
"132278025114178657816069807602964453230",
"118694287056036514248712628551265941802",
"32353791803560743044108910403448387214",
"89737756666215951980236040375344314876",
"64107384619075976456175612651754899504",
"170373996375411365822072169907616122143"
]
},
"target": {
"file": "drivers/dma/xilinx/zynqmp_dma.c"
}
},
{
"signature_version": "v1",
"id": "CVE-2022-49320-86e0da57",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@90aefae2e3a770a6909d339f5d8a988c0b0ceaf0",
"signature_type": "Line",
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"15745459993968034187081617612726760275",
"118405136351451998698787752175732939254",
"132278025114178657816069807602964453230",
"118694287056036514248712628551265941802",
"32353791803560743044108910403448387214",
"89737756666215951980236040375344314876",
"64107384619075976456175612651754899504",
"170373996375411365822072169907616122143"
]
},
"target": {
"file": "drivers/dma/xilinx/zynqmp_dma.c"
}
},
{
"signature_version": "v1",
"id": "CVE-2022-49320-b0ae0e25",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4838969e4d95d2bd2995d1605b20d3144fcb3e74",
"signature_type": "Line",
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"15745459993968034187081617612726760275",
"118405136351451998698787752175732939254",
"132278025114178657816069807602964453230",
"118694287056036514248712628551265941802",
"32353791803560743044108910403448387214",
"89737756666215951980236040375344314876",
"64107384619075976456175612651754899504",
"170373996375411365822072169907616122143"
]
},
"target": {
"file": "drivers/dma/xilinx/zynqmp_dma.c"
}
},
{
"signature_version": "v1",
"id": "CVE-2022-49320-b21f5228",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4838969e4d95d2bd2995d1605b20d3144fcb3e74",
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1208.0,
"function_hash": "329091866080619965846505508273174874897"
},
"target": {
"function": "zynqmp_dma_alloc_chan_resources",
"file": "drivers/dma/xilinx/zynqmp_dma.c"
}
},
{
"signature_version": "v1",
"id": "CVE-2022-49320-d6b38a73",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@95a0ba85c1b51b36e909841c02d205cd223ab753",
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1208.0,
"function_hash": "329091866080619965846505508273174874897"
},
"target": {
"function": "zynqmp_dma_alloc_chan_resources",
"file": "drivers/dma/xilinx/zynqmp_dma.c"
}
},
{
"signature_version": "v1",
"id": "CVE-2022-49320-e43c4175",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f9a9f43a62a04ec3183fb0da9226c7706eed0115",
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1208.0,
"function_hash": "329091866080619965846505508273174874897"
},
"target": {
"function": "zynqmp_dma_alloc_chan_resources",
"file": "drivers/dma/xilinx/zynqmp_dma.c"
}
},
{
"signature_version": "v1",
"id": "CVE-2022-49320-eb856b7f",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f9a9f43a62a04ec3183fb0da9226c7706eed0115",
"signature_type": "Line",
"deprecated": false,
"digest": {
"threshold": 0.9,
"line_hashes": [
"15745459993968034187081617612726760275",
"118405136351451998698787752175732939254",
"132278025114178657816069807602964453230",
"118694287056036514248712628551265941802",
"32353791803560743044108910403448387214",
"89737756666215951980236040375344314876",
"64107384619075976456175612651754899504",
"170373996375411365822072169907616122143"
]
},
"target": {
"file": "drivers/dma/xilinx/zynqmp_dma.c"
}
}
]