All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ricardo Lopes <ricardoapl.dev@gmail.com>
To: Kees Cook <keescook@chromium.org>
Cc: manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com,
	coiby.xu@gmail.com, justinstitt@google.com,
	linux-hardening@vger.kernel.org, gregkh@linuxfoundation.org,
	netdev@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: qlge: Replace strncpy with strscpy
Date: Mon, 9 Oct 2023 19:53:30 +0100	[thread overview]
Message-ID: <ZSRMKoL1ljRM01Hq@babbage> (raw)
In-Reply-To: <202310090921.622A22FF8@keescook>

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


  reply	other threads:[~2023-10-09 18:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 16:12 [PATCH v2] staging: qlge: Replace strncpy with strscpy Ricardo Lopes
2023-10-09 13:17 ` Simon Horman
2023-10-09 16:44 ` Kees Cook
2023-10-09 18:53   ` Ricardo Lopes [this message]
2023-10-09 17:22 ` Justin Stitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZSRMKoL1ljRM01Hq@babbage \
    --to=ricardoapl.dev@gmail.com \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=coiby.xu@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=justinstitt@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.