CVE-2024-39462: clk: bcm: dvp: Assign ->num before accessing ->hws
In the Linux kernel, the following vulnerability has been resolved:
clk: bcm: dvp: Assign ->num before accessing ->hws
Commit f316cdff8d67 ("clk: Annotate struct clkhwonecelldata with countedby") annotated the hws member of 'struct clkhwonecelldata' with countedby, which informs the bounds sanitizer about the number of elements in hws, so that it can warn when hws is accessed out of bounds. As noted in that change, the countedby member must be initialized with the number of elements before the first array access happens, otherwise there will be a warning from each access prior to the initialization because the number of elements is zero. This occurs in clkdvpprobe() due to ->num being assigned after ->hws has been accessed:
UBSAN: array-index-out-of-bounds in drivers/clk/bcm/clk-bcm2711-dvp.c:59:2 index 0 is out of range for type 'struct clkhw [] countedby(num)' (aka 'struct clkhw []')
Move the ->num initialization to before the first access of ->hws, which clears up the warning.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-39462?
CVE-2024-39462 is classified as a medium severity vulnerability in the Linux kernel.
What software versions are affected by CVE-2024-39462?
CVE-2024-39462 affects Linux kernel versions 5.10.223-1, 5.10.226-1, 6.1.123-1, 6.1.128-1, 6.12.12-1, and 6.12.13-1.
How do I fix CVE-2024-39462?
To mitigate CVE-2024-39462, upgrade to an unaffected version of the Linux kernel.
What components of the Linux kernel does CVE-2024-39462 impact?
CVE-2024-39462 impacts the clk subsystem and specifically the struct clk_hw_onecell_data.
Was CVE-2024-39462 publicly disclosed?
CVE-2024-39462 was resolved through a kernel commit and is documented in the Linux kernel change logs.