CVE-2024-39461

Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
25/06/2024
Last modified:
03/09/2024

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> clk: bcm: rpi: Assign -&gt;num before accessing -&gt;hws<br /> <br /> Commit f316cdff8d67 ("clk: Annotate struct clk_hw_onecell_data with<br /> __counted_by") annotated the hws member of &amp;#39;struct clk_hw_onecell_data&amp;#39;<br /> with __counted_by, which informs the bounds sanitizer about the number<br /> of elements in hws, so that it can warn when hws is accessed out of<br /> bounds. As noted in that change, the __counted_by member must be<br /> initialized with the number of elements before the first array access<br /> happens, otherwise there will be a warning from each access prior to the<br /> initialization because the number of elements is zero. This occurs in<br /> raspberrypi_discover_clocks() due to -&gt;num being assigned after -&gt;hws<br /> has been accessed:<br /> <br /> UBSAN: array-index-out-of-bounds in drivers/clk/bcm/clk-raspberrypi.c:374:4<br /> index 3 is out of range for type &amp;#39;struct clk_hw *[] __counted_by(num)&amp;#39; (aka &amp;#39;struct clk_hw *[]&amp;#39;)<br /> <br /> Move the -&gt;num initialization to before the first access of -&gt;hws, which<br /> clears up the warning.

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.6 (including) 6.6.34 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.7 (including) 6.9.5 (excluding)