LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Wolfram Sang <wsa@kernel.org>
To: Len Baker <len.baker@gmx.com>
Cc: Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c: sun6i-pw2i: Prefer strscpy over strlcpy
Date: Tue, 17 Aug 2021 21:36:28 +0200	[thread overview]
Message-ID: <YRwPvKZm8i47xFXP@kunai> (raw)
In-Reply-To: <20210817165859.5429-1-len.baker@gmx.com>

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

On Tue, Aug 17, 2021 at 06:58:59PM +0200, Len Baker 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. The safe
> replacement is strscpy().
> 
> This is a previous step in the path to remove the strlcpy() function
> entirely from the kernel [1].
> 
> [1] https://github.com/KSPP/linux/issues/89
> 
> Signed-off-by: Len Baker <len.baker@gmx.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2021-08-17 19:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 16:58 Len Baker
2021-08-17 19:36 ` Wolfram Sang [this message]

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=YRwPvKZm8i47xFXP@kunai \
    --to=wsa@kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=len.baker@gmx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mripard@kernel.org \
    --cc=wens@csie.org \
    --subject='Re: [PATCH] i2c: sun6i-pw2i: Prefer strscpy over strlcpy' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).