CVE-2026-142860: clk: mstar: msc313-mpll: fix off-by-one in clock array allocation
In the Linux kernel, the following vulnerability has been resolved:
clk: mstar: msc313-mpll: fix off-by-one in clock array allocation
The hws array of mpll->clkdata is allocated with structsize() using ARRAYSIZE(outputdividers) as the element count, giving it 7 elements. But the probe function stores the MPLL clock at hws[0] and one fixed-factor clock for each output divider at hws[i + 1] for i in [0, ARRAYSIZE(outputdividers)), writing 8 elements in total. The final write to hws[7] is past the end of the allocation.
clkdata->num is also set to NUMOUTPUTS (8), so the clock framework reads hws[0..7], again accessing hws[7] out of bounds.
Use NUMOUTPUTS as the element count so the allocation matches the number of clocks actually stored and exposed.
Found by smatch: drivers/clk/mstar/clk-msc313-mpll.c:134 msc313mpllprobe() error: buffer overflow 'mpll->clkdata->hws' 7 <= 7
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.226 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Compensating control
In Linux driver drivers/clk/mstar/clk-msc313-mpll.c, use NUMOUTPUTS as the hws array allocation element count so it can hold all 8 clocks, including hws[7].
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
The issue is in the Linux kernel's MStar MSC313 MPLL clock driver. It affects kernels that include and use this driver; the provided data does not identify affected kernel versions or default configuration status.
How can I determine whether my kernel contains the vulnerable code?
Inspect drivers/clk/mstar/clk-msc313-mpll.c. The vulnerable code allocates the hws array using ARRAY_SIZE(output_dividers), while registering NUMOUTPUTS clocks and writing through hws[7]; the corrected code allocates the array using NUMOUTPUTS.
What remediation is available?
Apply the upstream stable fix referenced by the provided kernel commits. The fix changes the clock-array allocation count to NUMOUTPUTS so it matches the eight clock entries stored and exposed to the clock framework.