{"id":"CVE-2024-39462","published":"2024-06-25T14:25:02Z","modified":"2026-05-11T20:21:00Z","title":"clk: bcm: dvp: Assign ->num before accessing ->hws","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\nclk: bcm: dvp: Assign ->num before accessing ->hws\n\nCommit f316cdff8d67 (\"clk: Annotate struct clk_hw_onecell_data with\n__counted_by\") annotated the hws member of 'struct clk_hw_onecell_data'\nwith __counted_by, which informs the bounds sanitizer about the number\nof elements in hws, so that it can warn when hws is accessed out of\nbounds. As noted in that change, the __counted_by member must be\ninitialized with the number of elements before the first array access\nhappens, otherwise there will be a warning from each access prior to the\ninitialization because the number of elements is zero. This occurs in\nclk_dvp_probe() due to ->num being assigned after ->hws has been\naccessed:\n\n  UBSAN: array-index-out-of-bounds in drivers/clk/bcm/clk-bcm2711-dvp.c:59:2\n  index 0 is out of range for type 'struct clk_hw *[] __counted_by(num)' (aka 'struct clk_hw *[]')\n\nMove the ->num initialization to before the first access of ->hws, which\nclears up the warning.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.01013,"percentile":0.64047,"provenance":"source"},"cwes":[{"id":"CWE-400","name":"Uncontrolled Resource Consumption"}],"references":[{"url":"https://git.kernel.org/stable/c/0dc913217fb79096597005bba9ba738e2db5cd02","tags":[]},{"url":"https://git.kernel.org/stable/c/a1dd92fca0d6b58b55ed0484f75d4205dbb77010","tags":[]},{"url":"https://git.kernel.org/stable/c/9368cdf90f52a68120d039887ccff74ff33b4444","tags":[]}],"priority":{"score":19.7,"factors":[{"name":"EPSS percentile","points":12.81},{"name":"CVSS severity","points":6.86}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= f316cdff8d677db9ad9c90acb44c4cd535b0ee27, < 0dc913217fb79096597005bba9ba738e2db5cd02",">= f316cdff8d677db9ad9c90acb44c4cd535b0ee27, < a1dd92fca0d6b58b55ed0484f75d4205dbb77010",">= f316cdff8d677db9ad9c90acb44c4cd535b0ee27, < 9368cdf90f52a68120d039887ccff74ff33b4444"]},{"vendor":"Linux","product":"Linux","versions":["6.6"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2024-06-25T17:03:11.356077Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2024-37987","exploited":false,"provenance":"source"}}