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 <gustavo...@kernel.org>
Build-tested-by: Gustavo A. R. Silva <gustavo...@kernel.org>

Thank you guys!
--
Gustavo

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

Reply via email to