Skip to contentSkip to conversation

CVE-2022-49186: clk: visconti: prevent array overflow in visconti_clk_register_gates()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Feb 26, 2025

lore
Share & tools
lore
#0 lore raw

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

clk: visconti: prevent array overflow in visconti_clk_register_gates()

This code was using -1 to represent that there was no reset function. Unfortunately, the -1 was stored in u8 so the if (clks[i].rs_id >= 0) condition was always true. This lead to an out of bounds access in visconti_clk_register_gates().

The Linux kernel CVE team has assigned CVE-2022-49186 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.17 with commit b4cbe606dc3674b25cb661e7cd1a1c6ddaaafaaa and fixed in 5.17.2 with commit 2723543c1d60278d5aef1c4ad732dbad24b84a81
	Issue introduced in 5.17 with commit b4cbe606dc3674b25cb661e7cd1a1c6ddaaafaaa and fixed in 5.18 with commit c5601e0720ce1a3ad895f94a5838530edde01ed3

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2022-49186

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:

	drivers/clk/visconti/clkc-tmpv770x.c
	drivers/clk/visconti/clkc.c
	drivers/clk/visconti/clkc.h

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/2723543c1d60278d5aef1c4ad732dbad24b84a81
	https://git.kernel.org/stable/c/c5601e0720ce1a3ad895f94a5838530edde01ed3