{"api_version":"1","generated_at":"2026-11-30T18:58:07+00:00","cve":"CVE-2026-138980","urls":{"html":"https://cve.report/CVE-2026-138980","api":"https://cve.report/api/cve/CVE-2026-138980.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-138980","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-138980"},"summary":{"title":"clk: mvebu: ap-cpu-clk: Assign .num before accessing .hws","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nclk: mvebu: ap-cpu-clk: 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 (UBSAN_BOUNDS)\nabout the number of elements in .hws[], so that it can warn when .hws[]\nis accessed out of bounds. As noted in that change, the __counted_by\nmember must be initialized with the number of elements before the first\narray access happens, otherwise there will be a warning from each access\nprior to the initialization because the number of elements is zero.\nThis occurs in ap_cpu_clock_probe(), which reads .hws[] to skip clusters\nthat have already been set up and writes it inside the CPU node loop,\nbut only assigns .num after the loop. With CONFIG_UBSAN_BOUNDS and a\ncompiler that implements __counted_by (GCC 15.1+ or Clang 20.1+), this\ntriggers an array-index-out-of-bounds report during probe of the AP806\nand AP807 CPU clocks, and with CONFIG_UBSAN_TRAP the first access traps.\n\nInitialize .num with nclusters, the number of elements .hws[] was\nallocated with, right after the allocation. For the in-tree AP806 and\nAP807 device trees, which list the CPU nodes in ascending order, this is\nexactly the value the old assignment produced. It is also the correct\nvalue for any other node order, since of_clk_hw_onecell_get() rejects\nindices at or beyond .num.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:18:00","updated_at":"2026-11-30 14:18:00"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/aba82b403719fca667b031d3154164cb5f694647","name":"https://git.kernel.org/stable/c/aba82b403719fca667b031d3154164cb5f694647","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/45b45ad6a42d8e8252f132977edc23b0d66679bc","name":"https://git.kernel.org/stable/c/45b45ad6a42d8e8252f132977edc23b0d66679bc","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/e8c7d3adf65b440bb5afd6de986b612664bda073","name":"https://git.kernel.org/stable/c/e8c7d3adf65b440bb5afd6de986b612664bda073","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/604f050c77c30893af5bf4113aca922d1fa1f891","name":"https://git.kernel.org/stable/c/604f050c77c30893af5bf4113aca922d1fa1f891","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/b4243850393f2f24e21b9f4b2c56233e60c904b4","name":"https://git.kernel.org/stable/c/b4243850393f2f24e21b9f4b2c56233e60c904b4","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-138980","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138980","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f316cdff8d677db9ad9c90acb44c4cd535b0ee27 e8c7d3adf65b440bb5afd6de986b612664bda073 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f316cdff8d677db9ad9c90acb44c4cd535b0ee27 45b45ad6a42d8e8252f132977edc23b0d66679bc git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f316cdff8d677db9ad9c90acb44c4cd535b0ee27 aba82b403719fca667b031d3154164cb5f694647 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f316cdff8d677db9ad9c90acb44c4cd535b0ee27 604f050c77c30893af5bf4113aca922d1fa1f891 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f316cdff8d677db9ad9c90acb44c4cd535b0ee27 b4243850393f2f24e21b9f4b2c56233e60c904b4 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.6","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.163 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.117 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.63 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.4 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["drivers/clk/mvebu/ap-cpu-clk.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"e8c7d3adf65b440bb5afd6de986b612664bda073","status":"affected","version":"f316cdff8d677db9ad9c90acb44c4cd535b0ee27","versionType":"git"},{"lessThan":"45b45ad6a42d8e8252f132977edc23b0d66679bc","status":"affected","version":"f316cdff8d677db9ad9c90acb44c4cd535b0ee27","versionType":"git"},{"lessThan":"aba82b403719fca667b031d3154164cb5f694647","status":"affected","version":"f316cdff8d677db9ad9c90acb44c4cd535b0ee27","versionType":"git"},{"lessThan":"604f050c77c30893af5bf4113aca922d1fa1f891","status":"affected","version":"f316cdff8d677db9ad9c90acb44c4cd535b0ee27","versionType":"git"},{"lessThan":"b4243850393f2f24e21b9f4b2c56233e60c904b4","status":"affected","version":"f316cdff8d677db9ad9c90acb44c4cd535b0ee27","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["drivers/clk/mvebu/ap-cpu-clk.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"6.6"},{"lessThan":"6.6","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.163","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.117","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.63","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.4","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.163","versionStartIncluding":"6.6","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.117","versionStartIncluding":"6.6","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.63","versionStartIncluding":"6.6","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.4","versionStartIncluding":"6.6","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"6.6","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nclk: mvebu: ap-cpu-clk: 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 (UBSAN_BOUNDS)\nabout the number of elements in .hws[], so that it can warn when .hws[]\nis accessed out of bounds. As noted in that change, the __counted_by\nmember must be initialized with the number of elements before the first\narray access happens, otherwise there will be a warning from each access\nprior to the initialization because the number of elements is zero.\nThis occurs in ap_cpu_clock_probe(), which reads .hws[] to skip clusters\nthat have already been set up and writes it inside the CPU node loop,\nbut only assigns .num after the loop. With CONFIG_UBSAN_BOUNDS and a\ncompiler that implements __counted_by (GCC 15.1+ or Clang 20.1+), this\ntriggers an array-index-out-of-bounds report during probe of the AP806\nand AP807 CPU clocks, and with CONFIG_UBSAN_TRAP the first access traps.\n\nInitialize .num with nclusters, the number of elements .hws[] was\nallocated with, right after the allocation. For the in-tree AP806 and\nAP807 device trees, which list the CPU nodes in ascending order, this is\nexactly the value the old assignment produced. It is also the correct\nvalue for any other node order, since of_clk_hw_onecell_get() rejects\nindices at or beyond .num."}],"providerMetadata":{"dateUpdated":"2026-11-30T13:26:45.880Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/e8c7d3adf65b440bb5afd6de986b612664bda073"},{"url":"https://git.kernel.org/stable/c/45b45ad6a42d8e8252f132977edc23b0d66679bc"},{"url":"https://git.kernel.org/stable/c/aba82b403719fca667b031d3154164cb5f694647"},{"url":"https://git.kernel.org/stable/c/604f050c77c30893af5bf4113aca922d1fa1f891"},{"url":"https://git.kernel.org/stable/c/b4243850393f2f24e21b9f4b2c56233e60c904b4"}],"title":"clk: mvebu: ap-cpu-clk: Assign .num before accessing .hws","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-138980","datePublished":"2026-11-30T13:26:45.880Z","dateReserved":"2026-11-30T13:22:15.907Z","dateUpdated":"2026-11-30T13:26:45.880Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:18:00","lastModifiedDate":"2026-11-30 14:18:00","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"138980","Ordinal":"1","Title":"clk: mvebu: ap-cpu-clk: Assign .num before accessing .hws","CVE":"CVE-2026-138980","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"138980","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nclk: mvebu: ap-cpu-clk: 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 (UBSAN_BOUNDS)\nabout the number of elements in .hws[], so that it can warn when .hws[]\nis accessed out of bounds. As noted in that change, the __counted_by\nmember must be initialized with the number of elements before the first\narray access happens, otherwise there will be a warning from each access\nprior to the initialization because the number of elements is zero.\nThis occurs in ap_cpu_clock_probe(), which reads .hws[] to skip clusters\nthat have already been set up and writes it inside the CPU node loop,\nbut only assigns .num after the loop. With CONFIG_UBSAN_BOUNDS and a\ncompiler that implements __counted_by (GCC 15.1+ or Clang 20.1+), this\ntriggers an array-index-out-of-bounds report during probe of the AP806\nand AP807 CPU clocks, and with CONFIG_UBSAN_TRAP the first access traps.\n\nInitialize .num with nclusters, the number of elements .hws[] was\nallocated with, right after the allocation. For the in-tree AP806 and\nAP807 device trees, which list the CPU nodes in ascending order, this is\nexactly the value the old assignment produced. It is also the correct\nvalue for any other node order, since of_clk_hw_onecell_get() rejects\nindices at or beyond .num.","Type":"Description","Title":"clk: mvebu: ap-cpu-clk: Assign .num before accessing .hws"}]}}}