Subject: CVE-2024-47686: ep93xx: clock: Fix off by one in ep93xx_div_recalc_rate()

From: Greg Kroah-Hartman <[email-masked]>

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

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

ep93xx: clock: Fix off by one in ep93xx_div_recalc_rate()

The psc->div[] array has psc->num_div elements.  These values come from
when we call clk_hw_register_div().  It's adc_divisors and
ARRAY_SIZE(adc_divisors)) and so on.  So this condition needs to be >=
instead of > to prevent an out of bounds read.

The Linux kernel CVE team has assigned CVE-2024-47686 to this issue.

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

	Issue introduced in 5.16 with commit 9645ccc7bd7a and fixed in 6.1.113 with commit 7a5bd2fb9238
	Issue introduced in 5.16 with commit 9645ccc7bd7a and fixed in 6.6.54 with commit 66e78ade976d
	Issue introduced in 5.16 with commit 9645ccc7bd7a and fixed in 6.10.13 with commit 27f493e14182
	Issue introduced in 5.16 with commit 9645ccc7bd7a and fixed in 6.11.2 with commit ae59eaf36a1a
	Issue introduced in 5.16 with commit 9645ccc7bd7a and fixed in 6.12-rc1 with commit c7f06284a642

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-2024-47686
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:
	arch/arm/mach-ep93xx/clock.c

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/7a5bd2fb92388c51d267f6ce57c40f1cca8af1e0
	https://git.kernel.org/stable/c/66e78ade976dbd9bea09166aa8d66afc0963cde4
	https://git.kernel.org/stable/c/27f493e141823db052586010c1532b70b164507c
	https://git.kernel.org/stable/c/ae59eaf36a1ad396e9f657ec9b8b52da6206ed5f
	https://git.kernel.org/stable/c/c7f06284a6427475e3df742215535ec3f6cd9662