U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Cc: u-boot@lists.denx.de, Simon Glass <sjg@chromium.org>,
	Sean Anderson <sean.anderson@seco.com>,
	Masahisa Kojima <masahisa.kojima@linaro.org>,
	u-boot-amlogic@groups.io, u-boot@ew.tq-group.com
Subject: Re: [PATCH 1/2] Revert "lib: string: Fix strlcpy return value", fix callers
Date: Wed, 2 Aug 2023 12:45:11 -0400	[thread overview]
Message-ID: <20230802164511.GD3630934@bill-the-cat> (raw)
In-Reply-To: <df6cf06e8b8e8c1619b3e93c7426d80d830aa008.camel@ew.tq-group.com>

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

On Wed, Aug 02, 2023 at 12:06:26PM +0200, Matthias Schiffer wrote:
> On Fri, 2023-07-14 at 13:24 +0200, Matthias Schiffer wrote:
> > Both the Linux kernel and libbsd agree that strlcpy() should always
> > return strlen(src) and not include the NUL termination. The incorrect
> > U-Boot implementation makes it impossible to check the return value for
> > truncation, and breaks code written with the usual implementation in
> > mind (for example, fdtdec_add_reserved_memory() was subtly broken).
> > 
> > I reviewed all callers of strlcpy() and strlcat() and fixed them
> > according to my understanding of the intended function.
> > 
> > This reverts commit d3358ecc54be0bc3b4dd11f7a63eab0a2842f772 and adds
> > related fixes.
> > 
> > Fixes: d3358ecc54be ("lib: string: Fix strlcpy return value")
> > Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> 
> Ping~
> 
> strlcpy and strlcat are now also in glibc and might be added to POSIX, so it would be great if we
> could get the U-Boot implementation to match the common behaviour.

I intend to pull this in to -next when I open it post -rc2, thanks.

-- 
Tom

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

  reply	other threads:[~2023-08-02 16:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14 11:24 [PATCH 1/2] Revert "lib: string: Fix strlcpy return value", fix callers Matthias Schiffer
2023-07-14 11:24 ` [PATCH 2/2] lib/charset: fix u16_strlcat() return value Matthias Schiffer
2023-08-09  1:39   ` Tom Rini
2023-08-02 10:06 ` [PATCH 1/2] Revert "lib: string: Fix strlcpy return value", fix callers Matthias Schiffer
2023-08-02 16:45   ` Tom Rini [this message]
2023-08-02 16:53 ` Simon Glass
2023-08-03 16:33 ` Sean Anderson
2023-08-07  7:45 ` Rasmus Villemoes
2023-08-09 17:18   ` Tom Rini
2023-08-09  1:39 ` Tom Rini

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=20230802164511.GD3630934@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=masahisa.kojima@linaro.org \
    --cc=matthias.schiffer@ew.tq-group.com \
    --cc=sean.anderson@seco.com \
    --cc=sjg@chromium.org \
    --cc=u-boot-amlogic@groups.io \
    --cc=u-boot@ew.tq-group.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox