[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202404031428.867B90D87D@keescook>
Date: Wed, 3 Apr 2024 14:28:36 -0700
From: Kees Cook <keescook@...omium.org>
To: Phillip Lougher <phillip@...ashfs.org.uk>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
justinstitt@...gle.com
Subject: Re: [PATCH] Squashfs: remove deprecated strncpy by not copying the
string
On Wed, Apr 03, 2024 at 07:33:52PM +0100, Phillip Lougher wrote:
> Squashfs copied the passed string (name) into a temporary buffer
> to ensure it was NUL-terminated. This however is completely
> unnecessary as the string is already NUL-terminated. So remove
> the deprecated strncpy() by completely removing the string copy.
>
> The background behind this unnecessary string copy is that it
> dates back to the days when Squashfs was an out of kernel patch.
> The code deliberately did not assume the string was NUL-terminated
> in case in future this changed (due to kernel changes). This
> would mean the out of tree patches would be broken but still
> compile OK.
>
> Signed-off-by: Phillip Lougher <phillip@...ashfs.org.uk>
Thanks!
Reviewed-by: Kees Cook <keescook@...omium.org>
--
Kees Cook
Powered by blists - more mailing lists