From: Kees Cook <keescook@chromium.org>
To: laniel_francis@privacyrequired.com
Cc: linux-hardening@vger.kernel.org, netdev@vger.kernel.org,
davem@davemloft.net, kuba@kernel.org
Subject: Re: [PATCH v4 2/3] Modify return value of nla_strlcpy to match that of strscpy.
Date: Fri, 30 Oct 2020 12:25:38 -0700 [thread overview]
Message-ID: <202010301217.7EF0009E83@keescook> (raw)
In-Reply-To: <20201030153647.4408-3-laniel_francis@privacyrequired.com>
On Fri, Oct 30, 2020 at 04:36:46PM +0100, laniel_francis@privacyrequired.com wrote:
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index 2a76a2f5ed88..f9b053b30a7b 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -1170,7 +1170,7 @@ static struct Qdisc *qdisc_create(struct net_device *dev,
> #ifdef CONFIG_MODULES
> if (ops == NULL && kind != NULL) {
> char name[IFNAMSIZ];
> - if (nla_strlcpy(name, kind, IFNAMSIZ) < IFNAMSIZ) {
> + if (nla_strlcpy(name, kind, IFNAMSIZ) > 0) {
> /* We dropped the RTNL semaphore in order to
> * perform the module load. So, even if we
> * succeeded in loading the module we have to
Oops, I think this should be >= 0 ?
--
Kees Cook
next prev parent reply other threads:[~2020-10-30 19:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 15:36 [PATCH v4 0/3] Fix inefficiences and rename nla_strlcpy laniel_francis
2020-10-30 15:36 ` [PATCH v4 1/3] Fix unefficient call to memset before memcpu in nla_strlcpy laniel_francis
2020-10-30 15:36 ` [PATCH v4 2/3] Modify return value of nla_strlcpy to match that of strscpy laniel_francis
2020-10-30 19:25 ` Kees Cook [this message]
2020-11-13 9:38 ` Francis Laniel
2020-10-30 15:36 ` [PATCH v4 3/3] treewide: rename nla_strlcpy to nla_strscpy laniel_francis
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=202010301217.7EF0009E83@keescook \
--to=keescook@chromium.org \
--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 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.