summaryrefslogtreecommitdiff
path: root/include/linux/timerqueue.h
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2026-05-08 18:32:59 +0300
committerSudeep Holla <sudeep.holla@kernel.org>2026-05-12 17:29:12 +0300
commit4a07036d615976354ac806017f23ea800f1fc489 (patch)
tree9525ea6bbfb8a4cae40898574e5832ff28b2a55b /include/linux/timerqueue.h
parent26d04d592a47890d409d1bf77b9cbf5920f2efc8 (diff)
downloadlinux-4a07036d615976354ac806017f23ea800f1fc489.tar.xz
firmware: arm_scmi: Fix OOB in scmi_clock_describe_rates_get_lazy()
Lazy discovery of discrete rates works as follows: A. Grab the first three rates, B. Grab the last rate, if there are more than three rates. It is up to the SCMI provider implementation to decide how many rates are returned in response to a single CLOCK_DESCRIBE_RATES command. Each rate received is stored in the scmi_clock_rates.rates[] array, and .num_rates is updated accordingly. When more than 3 rates have been received after step A, the last rate may have been received already, and stored in scmi_clock_rates.rates[] (which has space for scmi_clock_desc.tot_rates entries). Hence grabbing the last rate again will store it a second time, beyond the end of the array. Fix this by only grabbing the last rate when we don't already have it. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Link: https://patch.msgid.link/20260508153300.2224715-15-cristian.marussi@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions