[PATCH] powerpc/lib: Avoid array bounds warnings in vec ops

Gustavo A. R. Silva gustavo at embeddedor.com
Fri Nov 24 02:17:54 AEDT 2023

>> To be honest I don't know how paranoid we want to get, we could end up
>> putting WARN's all over the kernel :)
>> In this case I guess if the size is too large we overflow the buffer on
>> the kernel stack, so we should at least check the size.
>> But does it need a WARN? I'm not sure. If we had a case that was passing
>> a out-of-bound size hopefully we would notice in testing? :)
> You're right, a simpler check should suffice. I will send an updated
> patch.

This[1] patch indeed also makes those -Wstringop-overflow warnings go away. :)

I'm not subscribed to the list but here are my

Reviewed-by: Gustavo A. R. Silva <gustavoars at kernel.org>
Build-tested-by: Gustavo A. R. Silva <gustavoars at kernel.org>

Thank you guys!

[1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2023-November/265936.html

More information about the Linuxppc-dev mailing list