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`.
CVSS Details
- CVSS 3.1 Base Score: 7.8
- CVSS 3.1 Vector: (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Debian | — | Upgrade linux | Jul 27, 2026 | Jul 27, 2026 |
| Ubuntu | — | Upgrade linux-image-realtime-hwe-24.04Upgrade linux-image-generic-64kUpgrade linux-image-oem-24.04Upgrade linux-image-6.11.0-18-generic-64kUpgrade linux-image-raspiUpgrade linux-image-genericUpgrade linux-image-6.11.0-1009-azureUpgrade linux-image-lowlatency-64kUpgrade linux-image-oem-24.04bUpgrade linux-image-6.11.0-1008-raspiUpgrade linux-image-lowlatencyUpgrade linux-image-6.11.0-1009-gcpUpgrade linux-image-6.11.0-1009-azure-fdeUpgrade linux-image-6.11.0-18-genericUpgrade linux-image-azureUpgrade linux-image-6.11.0-1009-awsUpgrade linux-image-oracle-64kUpgrade linux-image-realtimeUpgrade linux-image-oem-24.04aUpgrade linux-image-awsUpgrade linux-image-6.11.0-1015-oemUpgrade linux-image-gcpUpgrade linux-image-virtualUpgrade linux-image-6.11.0-1011-oracleUpgrade linux-image-virtual-hwe-24.04Upgrade linux-image-6.11.0-1010-lowlatency-64kUpgrade linux-image-azure-fdeUpgrade linux-image-6.11.0-1005-realtimeUpgrade linux-image-oracleUpgrade linux-image-generic-hwe-24.04Upgrade linux-image-generic-64k-hwe-24.04Upgrade linux-image-6.11.0-1011-oracle-64kUpgrade linux-image-6.11.0-1010-lowlatency | Feb 20, 2025 | Dec 27, 2024 |
Prioritise with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub