Re: [PATCH] string: Adjust strtomem_pad() logic to allow for smaller sources

2023-10-18 Thread Arnd Bergmann
On Wed, Oct 18, 2023, at 20:07, Kees Cook wrote: > Arnd noticed we have a case where a shorter source string is being copied > into a destination byte array, but this results in a strnlen() call that > exceeds the size of the source. This is seen with -Wstringop-overread: > > In file included from

[PATCH] string: Adjust strtomem_pad() logic to allow for smaller sources

2023-10-18 Thread Kees Cook
Arnd noticed we have a case where a shorter source string is being copied into a destination byte array, but this results in a strnlen() call that exceeds the size of the source. This is seen with -Wstringop-overread: In file included from ../include/linux/uuid.h:11, from ../inclu