[lvc-project] [PATCH] of: cpu: add check in __of_find_n_match_cpu_property()
Rob Herring (Arm)
robh at kernel.org
Wed May 6 22:51:44 MSK 2026
On Wed, 29 Apr 2026 23:14:39 +0300, Sergey Shtylyov wrote:
> In __of_find_n_match_cpu_property(), checking the variable ac for 0 won't
> prevent a possible overflow when multiplying it by sizeof(*cell). Besides,
> of_read_number() (called in the *for* loop) can't return correct result if
> that variable (which equals the #address-cells prop's value) exceeds 2, so
> additionally checking for that seems logical...
>
> Found by Linux Verification Center (linuxtesting.org) with the Svace static
> analysis tool.
>
> Fixes: f3cea45a77c8 ("of: Fix iteration bug over CPU reg properties")
> Signed-off-by: Sergey Shtylyov <s.shtylyov at auroraos.dev>
>
> ---
> The patch is against the dt/linus branch of Rob Herring's linux.git repo...
>
> drivers/of/cpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Applied, thanks!
More information about the lvc-project
mailing list