CVE-2022-50540: dmaengine: qcom-adm: fix wrong sizeof config in slave_config
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: qcom-adm: fix wrong sizeof config in slave_config
Fix broken slave_config function that uncorrectly compare the peripheral_size with the size of the config pointer instead of the size of the config struct. This cause the crci value to be ignored and cause a kernel panic on any slave that use adm driver.
To fix this, compare to the size of the struct and NOT the size of the pointer.
The Linux kernel CVE team has assigned CVE-2022-50540 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.17 with commit 03de6b273805b3c552ff158f8688555937375926 and fixed in 5.19.17 with commit f1dd45a6585a1689e1e8906b3f9e302b9d40c715 Issue introduced in 5.17 with commit 03de6b273805b3c552ff158f8688555937375926 and fixed in 6.0.3 with commit 7490274b41a432824f7df5071ace3df2ab59caa7 Issue introduced in 5.17 with commit 03de6b273805b3c552ff158f8688555937375926 and fixed in 6.1 with commit 7c8765308371be30f50c1b5b97618b731514b207
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-2022-50540
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/qcom_adm.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/f1dd45a6585a1689e1e8906b3f9e302b9d40c715 https://git.kernel.org/stable/c/7490274b41a432824f7df5071ace3df2ab59caa7 https://git.kernel.org/stable/c/7c8765308371be30f50c1b5b97618b731514b207