Linux kernel ap-cpu-clk: .num assigned after .hws access in probe
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from CNA.
Summary
In the Linux kernel's mvebu ap-cpu-clk driver, ap_cpu_clock_probe() reads .hws[] inside the CPU node loop but sets .num only after the loop. Because .hws is annotated with __counted_by, the bounds sanitizer sees zero elements until then. With CONFIG_UBSAN_BOUNDS and GCC 15.1+ or Clang 20.1+, probing the AP806 and AP807 CPU clocks triggers an array-index-out-of-bounds report, and with CONFIG_UBSAN_TRAP the first access traps. The issue affects Linux from 6.6; CISA has not added it to KEV, and Red Hat rates it Moderate.
Written with Claude Haiku 5.5 from the sources below · 2026-12-01
Description from the CNA
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
Remediation
Install a kernel that includes the fix: 6.6.163, 6.12.117, 6.18.63, 7.3.4, or 7.4-rc1. The fix sets .num to nclusters right after .hws[] is allocated, before the CPU node loop reads it.
Written with Claude Haiku 5.5 from the sources below · 2026-12-01
- Fix · CNA Linux (Linux) Fixed in 6.6.163, 6.12.117, 6.18.63, 7.3.4, 7.4-rc1
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
Not affected: 7 products
- Red Hat Enterprise Linux 10
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat OpenShift Container Platform 4
- Red Hat OpenShift Container Platform 5
Timeline
- 2026-11-30 Threatist record created from CVE-2026-138980
- 2026-11-30 Alias added: GHSA-cgw5-cq3f-p7h2
- 2026-12-01 Affected versions changed · Red Hat
- 2026-12-01 CVSS score added · Red Hat
References
Other 5
- https://git.kernel.org/stable/c/e8c7d3adf65b440bb5afd6de986b612664bda073
- https://git.kernel.org/stable/c/45b45ad6a42d8e8252f132977edc23b0d66679bc
- https://git.kernel.org/stable/c/aba82b403719fca667b031d3154164cb5f694647
- https://git.kernel.org/stable/c/604f050c77c30893af5bf4113aca922d1fa1f891
- https://git.kernel.org/stable/c/b4243850393f2f24e21b9f4b2c56233e60c904b4
More Linux vulnerabilities
- TI-2025-26358 Zero-length TLS records mishandled on rx_list in Linux kernel KEVCVSS 3.1CRITICAL 9.8
- TI-2026-38352 Out-of-bounds write in Linux kernel ebtables SNAT ARP rewrite KEVCVSS 3.1HIGH 8.8
- TI-2021-02452 Overlayfs flaw in Linux kernel lets attackers gain elevated privileges KEVCVSS 3.1HIGH 8.8
- TI-2013-05264 Missing address checks in Linux kernel get_user and put_user on ARM KEVCVSS 3.1HIGH 8.8
- TI-2022-00125 Heap overflow in Linux kernel lets local users escalate privileges KEVCVSS 3.1HIGH 8.4
- TI-2013-01864 Wrong integer type in Linux kernel perf_swevent_init KEVCVSS 3.1HIGH 8.4
Sources
- CVE-2026-138980 · CVE Program
- CVE-2026-138980 · NVD
- GHSA-cgw5-cq3f-p7h2 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-138980 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences