CVE-2026-138980

clk: mvebu: ap-cpu-clk: Assign .num before accessing .hws

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

clk: mvebu: ap-cpu-clk: 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 (UBSAN_BOUNDS)
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 ap_cpu_clock_probe(), which reads .hws[] to skip clusters
that have already been set up and writes it inside the CPU node loop,
but only assigns .num after the loop. With CONFIG_UBSAN_BOUNDS and a
compiler that implements __counted_by (GCC 15.1+ or Clang 20.1+), this
triggers an array-index-out-of-bounds report during probe of the AP806
and AP807 CPU clocks, and with CONFIG_UBSAN_TRAP the first access traps.

Initialize .num with nclusters, the number of elements .hws[] was
allocated with, right after the allocation. For the in-tree AP806 and
AP807 device trees, which list the CPU nodes in ascending order, this is
exactly the value the old assignment produced. It is also the correct
value for any other node order, since of_clk_hw_onecell_get() rejects
indices at or beyond .num.

Analysis

AI-generated

Technical impact

The vulnerability arises when the Linux kernel’s mvebu AP CPU clock driver accesses the .hws[] array before the .num field is initialized. Because the __counted_by annotation informs the bounds sanitizer of the array size, this mismatch triggers an array‑index‑out‑of‑bounds warning and, if UBSAN_TRAP is enabled, an immediate trap that causes a kernel panic. The flaw does not grant code execution or data exfiltration; it simply disrupts kernel operation and can lead to a denial‑of‑service scenario if the kernel crashes during module probe or device tree parsing.

Affected Systems

All Linux kernels that include the mvebu ap_cpu_clk driver compiled with CONFIG_UBSAN_BOUNDS or CONFIG_UBSAN_TRAP and that have the vulnerable code before commit f316cdff8d67 are impacted. The issue is specifically noted for AP806 and AP807 devices, but any kernel that loads this driver will be affected when UBSAN sanitizers are active.

Risk and Exploitability

The CVSS score is not provided and the EPSS score is unavailable, indicating no publicly known exploitation data. The vulnerability is limited to environments where the bounds sanitizer is enabled and the driver is loaded, which is uncommon in production kernels. Consequently, the risk is primarily a local denial‑of‑service via kernel panic rather than a remote exploit. The fuzzing constraint of UBSAN means threat actors would need to force the kernel to load the driver under a sanitizer context, a scenario seldom used in typical production systems.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Patch the kernel to commit f316cdff8d67, which initializes .num before any array access.
  • If a patch cannot be applied immediately, recompile the kernel or the mvebu driver with UBSAN_BOUNDS and UBSAN_TRAP disabled to prevent the sanitizer from reporting or trapping the out‑of‑bounds access.
  • Verify that any custom device trees list CPU nodes in ascending order or adjust the probe logic accordingly to avoid premature array access.

Generated by OpenCVE AI on November 30, 2026 at 18:47 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-119
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: clk: mvebu: ap-cpu-clk: 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 (UBSAN_BOUNDS) 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 ap_cpu_clock_probe(), which reads .hws[] to skip clusters that have already been set up and writes it inside the CPU node loop, but only assigns .num after the loop. With CONFIG_UBSAN_BOUNDS and a compiler that implements __counted_by (GCC 15.1+ or Clang 20.1+), this triggers an array-index-out-of-bounds report during probe of the AP806 and AP807 CPU clocks, and with CONFIG_UBSAN_TRAP the first access traps. Initialize .num with nclusters, the number of elements .hws[] was allocated with, right after the allocation. For the in-tree AP806 and AP807 device trees, which list the CPU nodes in ascending order, this is exactly the value the old assignment produced. It is also the correct value for any other node order, since of_clk_hw_onecell_get() rejects indices at or beyond .num.
Title clk: mvebu: ap-cpu-clk: Assign .num before accessing .hws
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-119

    Improper Restriction of Operations within the Bounds of a Memory Buffer

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:26 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM