Re: [PATCH] drm/amd/pm: Replace all non-returning strlcpy with strscpy

2023-05-22 Thread Kees Cook
On Mon, 22 May 2023 15:52:45 +, Azeem Shaikh wrote: > strlcpy() reads the entire source buffer first. > This read may exceed the destination size limit. > This is both inefficient and can lead to linear read > overflows if a source string is not NUL-terminated [1]. > In an effort to remove

RE: [PATCH] drm/amd/pm: Replace all non-returning strlcpy with strscpy

2023-05-22 Thread Deucher, Alexander
t; ; Pan, Xinhui ; David > Airlie ; Daniel Vetter ; dri- > de...@lists.freedesktop.org > Subject: Re: [PATCH] drm/amd/pm: Replace all non-returning strlcpy with > strscpy > > On Mon, May 22, 2023 at 03:52:45PM +, Azeem Shaikh wrote: > > strlcpy() reads the enti

Re: [PATCH] drm/amd/pm: Replace all non-returning strlcpy with strscpy

2023-05-22 Thread Kees Cook
On Mon, May 22, 2023 at 03:52:45PM +, Azeem Shaikh wrote: > strlcpy() reads the entire source buffer first. > This read may exceed the destination size limit. > This is both inefficient and can lead to linear read > overflows if a source string is not NUL-terminated [1]. > In an effort to

[PATCH] drm/amd/pm: Replace all non-returning strlcpy with strscpy

2023-05-22 Thread Azeem Shaikh
strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No