CVE-2023-52857: drm/mediatek: Fix coverity issue with unintentional integer overflow
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
drm/mediatek: Fix coverity issue with unintentional integer overflow
1. Instead of multiplying 2 variable of different types. Change to assign a value of one variable and then multiply the other variable.
2. Add a int variable for multiplier calculation instead of calculating different types multiplier with dma_addr_t variable directly.
The Linux kernel CVE team has assigned CVE-2023-52857 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.14 with commit 1a64a7aff8da and fixed in 6.5.12 with commit 0d8a1df39d3f Issue introduced in 5.14 with commit 1a64a7aff8da and fixed in 6.6.2 with commit 96312a251d4d Issue introduced in 5.14 with commit 1a64a7aff8da and fixed in 6.7 with commit b0b0d811eac6 Issue introduced in 5.13.12 with commit 73e81f7219aa
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-2023-52857
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/gpu/drm/mediatek/mtk_drm_gem.c
drivers/gpu/drm/mediatek/mtk_drm_plane.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/0d8a1df39d3fc34560e2cc663b5c340d06a25396 https://git.kernel.org/stable/c/96312a251d4dcee5d36e32edba3002bfde0ddd9c https://git.kernel.org/stable/c/b0b0d811eac6b4c52cb9ad632fa6384cf48869e7