clk: samsung: Fix UBSAN panic in samsung_clk_init()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e620a1e061c4738e26c3edf2abaae7842532cd80 · < a1500b98cd81a32fdfb9bc63c33bb9f0c2a0a1bf| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
clk: samsung: Fix UBSAN panic in samsung_clk_init()
With UBSAN_ARRAY_BOUNDS=y, I'm hitting the below panic due to dereferencing `ctx->clk_data.hws` before setting `ctx->clk_data.num = nr_clks`. Move that up to fix the crash.
UBSAN: array index out of bounds: 00000000f2005512 [#1] PREEMPT SMP <snip> Call trace: samsung_clk_init+0x110/0x124 (P) samsung_clk_init+0x48/0x124 (L) samsung_cmu_register_one+0x3c/0xa0 exynos_arm64_register_cmu+0x54/0x64 __gs101_cmu_top_of_clk_init_declare+0x28/0x60 ...
From the CVE record · Linux
The Linux kernel’s Samsung clock initialization code can trigger an array-bounds panic when UBSAN_ARRAY_BOUNDS is enabled because it accesses clock data before setting the clock count. The input does not describe an attacker path, authentication requirement, or user interaction.
Engineers running Linux kernels with Samsung clock initialization and UBSAN_ARRAY_BOUNDS enabled should check their deployments; affected versions are not specified.