netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: David Laight <David.Laight@ACULAB.COM>,
	Francis Laniel <laniel_francis@privacyrequired.com>,
	"linux-hardening@vger.kernel.org"
	<linux-hardening@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [RFC][PATCH v3 3/3] Rename nla_strlcpy to nla_strscpy.
Date: Fri, 23 Oct 2020 10:41:53 -0700	[thread overview]
Message-ID: <202010231041.9FAB4A2714@keescook> (raw)
In-Reply-To: <20201023082920.6addf3cb@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>

On Fri, Oct 23, 2020 at 08:29:20AM -0700, Jakub Kicinski wrote:
> On Fri, 23 Oct 2020 08:07:44 +0000 David Laight wrote:
> > FWIW I suspect  the 'return -ERR on overflow' is going to bite us.
> > Code that does p += strsxxx(p, ..., lim - p, ...) assuming (or not
> > caring) about overflow goes badly wrong.
> 
> I don't really care either way, but in netlink there's usually an
> attribute per value, nothing combines strings like p += strx..().
> Looking at the conversion in patch 2 the callers just want to 
> check for overflow.

Right -- this is a very narrow use-case (NLA). I think this series is
fine as-is.

-- 
Kees Cook

  reply	other threads:[~2020-10-23 17:41 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
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 [this message]
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=202010231041.9FAB4A2714@keescook \
    --to=keescook@chromium.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=laniel_francis@privacyrequired.com \
    --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;
as well as URLs for NNTP newsgroup(s).