CVE-2024-39462

Source
https://cve.org/CVERecord?id=CVE-2024-39462
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-39462.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2024-39462
Downstream
Related
Published
2024-06-25T14:25:02.196Z
Modified
2026-03-14T12:34:43.097110Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
clk: bcm: dvp: Assign ->num before accessing ->hws
Details

In the Linux kernel, the following vulnerability has been resolved:

clk: bcm: dvp: Assign ->num before accessing ->hws

Commit f316cdff8d67 ("clk: Annotate struct clkhwonecell_data with __countedby") annotated the hws member of 'struct clkhwonecelldata' with __counted_by, 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 clk_hw *[] __countedby(num)' (aka 'struct clkhw *[]')

Move the ->num initialization to before the first access of ->hws, which clears up the warning.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/39xxx/CVE-2024-39462.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
f316cdff8d677db9ad9c90acb44c4cd535b0ee27
Fixed
0dc913217fb79096597005bba9ba738e2db5cd02
Fixed
a1dd92fca0d6b58b55ed0484f75d4205dbb77010
Fixed
9368cdf90f52a68120d039887ccff74ff33b4444

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-39462.json"