CVE-2024-35922: fbmon: prevent division by zero in fb_videomode_from_videomode()
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
fbmon: prevent division by zero in fb_videomode_from_videomode()
The expression htotal * vtotal can have a zero value on overflow. It is necessary to prevent division by zero like in fb_var_to_videomode().
Found by Linux Verification Center (linuxtesting.org) with Svace.
The Linux kernel CVE team has assigned CVE-2024-35922 to this issue.
Affected and fixed versions
===========================
Fixed in 4.19.312 with commit 1fb52bc1de55 Fixed in 5.4.274 with commit 72d091b7515e Fixed in 5.10.215 with commit 951838fee462 Fixed in 5.15.155 with commit 48d6bcfc3175 Fixed in 6.1.86 with commit 664206ff8b01 Fixed in 6.6.27 with commit 3d4b909704bf Fixed in 6.8.6 with commit 1b107d637fed Fixed in 6.9 with commit c2d953276b8b
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-2024-35922
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/video/fbdev/core/fbmon.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/1fb52bc1de55e9e0bdf71fe078efd4da0889710f https://git.kernel.org/stable/c/72d091b7515e0532ee015e144c906f3bcfdd6270 https://git.kernel.org/stable/c/951838fee462aa01fa2a6a91d56f9a495082e7f0 https://git.kernel.org/stable/c/48d6bcfc31751ca2e753d901a2d82f27edf8a029 https://git.kernel.org/stable/c/664206ff8b019bcd1e55b10b2eea3add8761b971 https://git.kernel.org/stable/c/3d4b909704bf2114f64f87363fa22b5ef8ac4a33 https://git.kernel.org/stable/c/1b107d637fed68a787da77a3514ad06e57abd0b4 https://git.kernel.org/stable/c/c2d953276b8b27459baed1277a4fdd5dd9bd4126