CVE-2024-39462
JSON

9.8critical

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

Severity
9.8critical CVSS:3.1 by CISA-ADP
Exploit likelihood
1.01% (higher than 64% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: clk: bcm: dvp: Assign ->num before accessing ->hws Commit f316cdff8d67 ("clk: Annotate struct clk_hw_onecell_data with __counted_by") annotated the hws member of 'struct clk_hw_onecell_data' 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 __counted_by 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 clk_dvp_probe() 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 *[] __counted_by(num)' (aka 'struct clk_hw *[]') Move the ->num initialization to before the first access of ->hws, which clears up the warning.

Affected

Product or packageVersionsReported by
Linux Linuxfrom f316cdff8d677db9ad9c90acb44c4cd535b0ee27 before 0dc913217fb79096597005bba9ba738e2db5cd02, from f316cdff8d677db9ad9c90acb44c4cd535b0ee27 before a1dd92fca0d6b58b55ed0484f75d4205dbb77010, from f316cdff8d677db9ad9c90acb44c4cd535b0ee27 before 9368cdf90f52a68120d039887ccff74ff33b4444, 6.6
Not affected: before 6.6, from 6.6.34 up to 6.6.*, from 6.9.5 up to 6.9.*, from 6.10 up to *
CVE List
linux linux_kernel6.6, from f316cdff8d67 before 0dc913217fb7, from f316cdff8d67 before a1dd92fca0d6, from f316cdff8d67 before 9368cdf90f52, from 6.6 before 6.6.34, from 6.7 before 6.9.5
Not affected: before 6.6, from 6.6.34 up to 6.7, from 6.9.5 up to 6.10, 6.10-rc1
CVE List, NVD

Classification

CWE-400

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: clk: bcm: dvp: Assign ->num before accessing ->hws Commit f316cdff8d67 ("clk: Annotate struct clk_hw_onecell_data with __counted_by") annotated the hws member of 'struct clk_hw_onecell_data' 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 __counted_by 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 clk_dvp_probe() 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 *[] __counted_by(num)' (aka 'struct clk_hw *[]') Move the ->num initialization to before the first access of ->hws, which clears up the warning.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: clk: bcm: dvp: Assign ->num before accessing ->hws Commit f316cdff8d67 ("clk: Annotate struct clk_hw_onecell_data with __counted_by") anotó el miembro hws de 'struct clk_hw_onecell_data' con __counted_by, que informa al sanitizante de los límites sobre la cantidad de elementos en hws, para que pueda advertir cuando se accede a hws fuera de los límites. Como se señaló en ese cambio, el miembro __counted_by debe inicializarse con la cantidad de elementos antes de que ocurra el primer acceso a la matriz; de lo contrario, habrá una advertencia de cada acceso antes de la inicialización porque la cantidad de elementos es cero. Esto ocurre en clk_dvp_probe() debido a que ->num se asigna después de que se haya accedido a ->hws: UBSAN: array-index-out-of-bounds in drivers/clk/bcm/clk-bcm2711-dvp.c:59:2 El índice 0 está fuera del rango para el tipo 'struct clk_hw *[] __counted_by(num)' (también conocido como 'struct clk_hw *[]'). Mueva la inicialización ->num antes del primer acceso de ->hws, lo que borra la advertencia. .

References

Sources

SourceRecordLicence
CVE ListCVE-2024-39462 changed 2026-05-11CVE Terms of Use
NVDCVE-2024-39462 changed 2026-06-17Public domain