[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZSRMKoL1ljRM01Hq@babbage>
Date: Mon, 9 Oct 2023 19:53:30 +0100
From: Ricardo Lopes <ricardoapl.dev@...il.com>
To: Kees Cook <keescook@...omium.org>
Cc: manishc@...vell.com, GR-Linux-NIC-Dev@...vell.com,
coiby.xu@...il.com, justinstitt@...gle.com,
linux-hardening@...r.kernel.org, gregkh@...uxfoundation.org,
netdev@...r.kernel.org, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] staging: qlge: Replace strncpy with strscpy
On Mon, Oct 09, 2023 at 09:44:37AM -0700, Kees Cook wrote:
> Thanks for working on this! Doing these replacements needs analysis of
> several issues that should be described in the commit log:
>
> - is the destination an %NUL-terminated string? (strncpy can produce
> non-%NUL-terminated strings and sometimes this is intentional.)
>
> - is the source %NUL-terminated? (Sometimes strncpy is used when memcpy,
> kmemdup_nul, or other things should be used.)
>
> - does the destination need to be %NUL padded? (strncpy does this
> padding, but it isn't always obvious if it's needed.) When padding is
> needed, strscpy_pad() should be used.
Thank you for the feedback Kees, I really appreciate it
Regards,
Ricardo Lopes
Powered by blists - more mailing lists