From: Francis Laniel <laniel_francis@privacyrequired.com>
To: Kees Cook <keescook@chromium.org>
Cc: linux-hardening@vger.kernel.org, netdev@vger.kernel.org,
davem@davemloft.net, kuba@kernel.org
Subject: Re: [RFC][PATCH v3 2/3] Modify return value of nla_strlcpy to match that of strscpy.
Date: Thu, 22 Oct 2020 11:40:36 +0200 [thread overview]
Message-ID: <9380410.HkhQdzfPPx@machine> (raw)
In-Reply-To: <202010211648.4CBF3805A9@keescook>
Le jeudi 22 octobre 2020, 01:48:37 CEST Kees Cook a écrit :
> On Tue, Oct 20, 2020 at 06:47:06PM +0200, laniel_francis@privacyrequired.com
wrote:
> > From: Francis Laniel <laniel_francis@privacyrequired.com>
> >
> > nla_strlcpy now returns -E2BIG if src was truncated when written to dst.
> > It also returns this error value if dstsize is 0 or higher than INT_MAX.
> >
> > For example, if src is "foo\0" and dst is 3 bytes long, the result will
> > be:
> > 1. "foG" after memcpy (G means garbage).
> > 2. "fo\0" after memset.
> > 3. -E2BIG is returned because src was not completely written into dst.
> >
> > The callers of nla_strlcpy were modified to take into account this
> > modification.
> >
> > Signed-off-by: Francis Laniel <laniel_francis@privacyrequired.com>
>
> This looks correct to me. Thanks for the respin!
Perfect! You are welcome!
>
> Reviewed-by: Kees Cook <keescook@chromium.org>
next prev parent reply other threads:[~2020-10-22 9:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-20 16:47 [RFC][PATCH v3 0/3] Fix inefficiences and rename nla_strlcpy laniel_francis
2020-10-20 16:47 ` [RFC][PATCH v3 1/3] Fix unefficient call to memset before memcpu in nla_strlcpy laniel_francis
2020-10-21 23:46 ` Kees Cook
2020-10-20 16:47 ` [RFC][PATCH v3 2/3] Modify return value of nla_strlcpy to match that of strscpy laniel_francis
2020-10-21 23:48 ` Kees Cook
2020-10-22 9:40 ` Francis Laniel [this message]
2020-10-20 16:47 ` [RFC][PATCH v3 3/3] Rename nla_strlcpy to nla_strscpy laniel_francis
2020-10-21 23:49 ` Kees Cook
2020-10-22 9:41 ` Francis Laniel
2020-10-22 20:04 ` Kees Cook
2020-10-22 23:05 ` Jakub Kicinski
2020-10-23 8:07 ` David Laight
2020-10-23 15:15 ` Francis Laniel
2020-10-23 15:29 ` Jakub Kicinski
2020-10-23 17:41 ` Kees Cook
2020-10-23 15:16 ` Francis Laniel
2020-10-24 10:41 ` Francis Laniel
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=9380410.HkhQdzfPPx@machine \
--to=laniel_francis@privacyrequired.com \
--cc=davem@davemloft.net \
--cc=keescook@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox