summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2026-05-08 18:32:56 +0300
committerSudeep Holla <sudeep.holla@kernel.org>2026-05-12 17:29:11 +0300
commitae4a088f13debc1d7bbb6a9b265a31d25b60ddd4 (patch)
tree86c92a41814bff19775e7f79a6a4b3c328b3aded /include/linux
parent4848d07ea9fc5e4c2239e10b3eb9fe7e647aaa12 (diff)
downloadlinux-ae4a088f13debc1d7bbb6a9b265a31d25b60ddd4.tar.xz
firmware: arm_scmi: Fix bound iterators returning too many items
When using a bound-iterator with an upper bound, commands are sent, and responses are received, until the upper bound is reached. However, it is up to the SCMI provider implementation to decide how many rates are returned in response to a single CLOCK_DESCRIBE_RATES command. If the last response contains rates beyond the specified upper bound, they are still passed up for further processing. This may lead to buffer overflows in unprepared callsites. While the imprecise bound handling may have been intentional (it was mentioned in the commit message introducing the code), it is still confusing for users, and may cause hard to debug crashes. Fix this by strictly enforcing the upper bound. Note that this may cause an increase in the number of CLOCK_DESCRIBE_RATES commands issued, as retrieving the last rate may no longer be done inadvertentently, but require its own command. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20260508153300.2224715-12-cristian.marussi@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions