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: [PATCH v4 2/3] Modify return value of nla_strlcpy to match that of strscpy.
Date: Fri, 13 Nov 2020 10:38:33 +0100 [thread overview]
Message-ID: <3167137.UV11EXrnFd@machine> (raw)
In-Reply-To: <202010301217.7EF0009E83@keescook>
Le vendredi 30 octobre 2020, 20:25:38 CET Kees Cook a écrit :
> 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 ?
Good catch! I will modify this, rebase my patch on top of master, test it a
bit more than what I did for the v4 and push v5!
next prev parent reply other threads:[~2020-11-13 9:38 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
2020-11-13 9:38 ` Francis Laniel [this message]
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=3167137.UV11EXrnFd@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;
as well as URLs for NNTP newsgroup(s).