CVE-2024-53192: clk: clk-loongson2: Fix potential buffer overflow in flexible-array member access
In the Linux kernel, the following vulnerability has been resolved:
clk: clk-loongson2: Fix potential buffer overflow in flexible-array member access
Flexible-array member `hws` in `struct clk_hw_onecell_data` is annotated
with the `counted_by()` attribute. This means that when memory is
allocated for this array, the _counter_, which in this case is member
`num` in the flexible structure, should be set to the maximum number of
elements the flexible array can contain, or fewer.
In this case, the total number of elements for the flexible array is
determined by variable `clks_num` when allocating heap space via
`devm_kzalloc()`, as shown below:
289 struct loongson2_clk_provider *clp;
...
296 for (p = data; p->name; p++)
297 clks_num++;
298
299 clp = devm_kzalloc(dev, struct_size(clp, clk_data.hws, clks_num),
300 GFP_KERNEL);
So, `clp->clk_data.num` should be set to `clks_num` or less, and not
exceed `clks_num`, as is currently the case. Otherwise, if data is
written into `clp->clk_data.hws[clks_num]`, the instrumentation
provided by the compiler won't detect the overflow, leading to a
memory corruption bug at runtime.
Fix this issue by setting `clp->clk_data.num` to `clks_num`.
Security readout for executives and security teams
Plain-English summary
A Linux kernel clock driver for Loongson2 systems can misstate an allocated array’s size. A subsequent out-of-bounds write could corrupt kernel memory, potentially causing system compromise or disruption. The risk is significant where the affected driver and hardware are present, but the supplied sources do not establish widespread exposure or exploitation.
Executive priority
Treat this as a high-priority, targeted kernel update for exposed Loongson2 systems, especially multi-user or workload-hosting environments. It is not evidence of an internet-wide emergency because exploitation requires local access and no active exploitation is documented. Quickly determine whether relevant hardware and driver code exist before escalating broadly.
Technical view
The loongson2 clock provider allocated its flexible hws array for clks_num elements but set the counted_by counter, clk_data.num, higher than that allocation. This could prevent compiler instrumentation from detecting access at hws[clks_num], allowing runtime memory corruption. The upstream correction sets num to clks_num. CVSS 3.1 is 7.8 with local, low-privilege access required.
Likely exposure
Exposure is likely limited to affected Linux kernels using the Loongson2 clock driver, principally relevant to corresponding Loongson2 hardware. The supplied affected-version data references 6.10 and later release points through 6.13, but its flattened version representation is ambiguous. Confirm exact affected ranges and downstream backports with the system’s kernel vendor.
Exploitation context
The supplied CVSS vector requires local access and low privileges, with no user interaction. Successful exploitation could affect confidentiality, integrity, and availability through kernel memory corruption. CISA KEV status is false, and no supplied source reports active exploitation or a public exploit. Practical reachability and reliability are not established by this bundle.
Researcher notes
The defect concerns counted_by metadata consistency and a potential out-of-bounds access in clk-loongson2. The sources describe possible runtime memory corruption but do not demonstrate a reachable trigger, exploitation primitive, proof of concept, or observed attacks. Exact affected ranges should be resolved from the CVE record and downstream vendor advisories because the supplied normalized version list is unclear.
Mitigation direction
Upgrade to a vendor-supported kernel containing the cited upstream fix or an equivalent backport.
Prioritize Loongson2 systems where untrusted users or local workloads can execute code.
Consult distribution or appliance vendor guidance for exact fixed versions and reboot requirements.
Restrict unnecessary local access until affected systems are patched.
Validation and detection
Inventory kernel versions, hardware architecture, and whether the Loongson2 clock driver is present.
Compare deployed kernel source or vendor changelogs with the cited stable fixes.
Confirm the corrected code sets clk_data.num to clks_num.
After updating, verify the fixed kernel is running and clock-dependent services operate normally.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-120: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.