]> git.dujemihanovic.xyz Git - u-boot.git/commit
rockchip: avoid out-of-bounds when computing cpuid
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>
Mon, 11 Mar 2024 12:01:44 +0000 (13:01 +0100)
committerKever Yang <kever.yang@rock-chips.com>
Wed, 13 Mar 2024 10:14:19 +0000 (18:14 +0800)
commit2871dee83336cdafc38140dc6edd517eb5cac4b7
tree1035d4af531bf1a829079b7240cd5012e34f0078
parent20a0ce574d6642e0dfe651467159039fac48cc4f
rockchip: avoid out-of-bounds when computing cpuid

The expected length of the cpuid, as passed with cpuid_length,
determines the size of cpuid_str string. Therefore, care should be taken
to make sure nothing is accessing data out-of-bounds.

Instead of using hardcoded values, derive them from cpuid_length.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
arch/arm/mach-rockchip/misc.c