From: Francis Laniel <laniel_francis@privacyrequired.com>
To: Jann Horn <jannh@google.com>
Cc: linux-hardening@vger.kernel.org
Subject: Re: [PATCH v1 2/3] Modify return value of nla_strlcpy to match that of strscpy.
Date: Sat, 17 Oct 2020 10:56:55 +0200 [thread overview]
Message-ID: <5345693.Gt269SmXlT@machine> (raw)
In-Reply-To: <CAG48ez2gpW-O9wQQ5u55jsr3PhQbPYPjyur=AfgP--5H==96uQ@mail.gmail.com>
Le samedi 17 octobre 2020, 02:41:33 CEST Jann Horn a écrit :
> On Fri, Oct 16, 2020 at 3:02 PM <laniel_francis@privacyrequired.com> wrote:
> > This patch solves part 2 of issue:
> > https://github.com/KSPP/linux/issues/110
> >
> > Signed-off-by: Francis Laniel <laniel_francis@privacyrequired.com>
> > ---
> >
> > include/net/netlink.h | 2 +-
> > include/net/pkt_cls.h | 3 ++-
> > lib/nlattr.c | 31 ++++++++++++++++++++-----------
> > net/sched/act_api.c | 2 +-
> > net/sched/sch_api.c | 2 +-
> > 5 files changed, 25 insertions(+), 15 deletions(-)
>
> [...]
>
> > diff --git a/lib/nlattr.c b/lib/nlattr.c
> > index ab96a5f4b9b8..83dd233bbe3e 100644
> > --- a/lib/nlattr.c
> > +++ b/lib/nlattr.c
> > @@ -713,29 +713,38 @@ EXPORT_SYMBOL(nla_find);
> >
> > * @dst: where to copy the string to
> > * @nla: attribute to copy the string from
> > * @dstsize: size of destination buffer
> >
> > + * @returns: -E2BIG if @dstsize is 0 or source buffer length greater than
> > + * @dstsize, otherwise it returns the number of copied characters (not
> > + * including the trailing %NUL).
> >
> > *
> > * Copies at most dstsize - 1 bytes into the destination buffer.
> >
> > - * The result is always a valid NUL-terminated string. Unlike
> > - * strlcpy the destination buffer is always padded out.
> > - *
> > - * Returns the length of the source buffer.
> > + * The result is always a valid NUL-terminated string.
> >
> > */
>
> What about tcf_proto_check_kind()?
Good catch!
I just searched for "if (nla_strlcpy" in the code to propagate change.
I will add it to the next version!
next prev parent reply other threads:[~2020-10-17 8:57 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-16 12:52 [RFC][PATCH v1] Fix and rename nla_strlcpy to nla_strcpy laniel_francis
2020-10-16 12:52 ` [PATCH v1 1/3] Fix unefficient call to memset before memcpu in nla_strlcpy laniel_francis
2020-10-16 23:19 ` Kees Cook
2020-10-17 8:50 ` Francis Laniel
2020-10-16 23:29 ` Jann Horn
2020-10-17 8:50 ` Francis Laniel
2020-10-16 12:52 ` [PATCH v1 2/3] Modify return value of nla_strlcpy to match that of strscpy laniel_francis
2020-10-16 23:23 ` Kees Cook
2020-10-17 8:53 ` Francis Laniel
2020-10-17 0:41 ` Jann Horn
2020-10-17 8:56 ` Francis Laniel [this message]
2020-10-16 12:52 ` [PATCH v1 3/3] Rename nla_strlcpy to nla_strcpy laniel_francis
2020-10-16 23:18 ` Kees Cook
2020-10-19 15:23 ` [RFC][PATCH v2 0/3] Fix inefficiences and rename nla_strlcpy laniel_francis
2020-10-19 15:23 ` [RFC][PATCH v2 1/3] Fix unefficient call to memset before memcpu in nla_strlcpy laniel_francis
2020-10-19 15:23 ` [RFC][PATCH v2 2/3] Modify return value of nla_strlcpy to match that of strscpy laniel_francis
2020-10-19 16:43 ` Jakub Kicinski
2020-10-19 23:01 ` Kees Cook
2020-10-19 23:34 ` Jakub Kicinski
2020-10-20 10:28 ` Francis Laniel
2020-10-20 17:23 ` Kees Cook
2020-10-20 17:19 ` Kees Cook
2020-10-20 13:05 ` Francis Laniel
2020-10-20 10:17 ` Francis Laniel
2020-10-19 15:23 ` [RFC][PATCH v2 3/3] Rename nla_strlcpy to nla_strcpy laniel_francis
2020-10-19 16:45 ` [RFC][PATCH v2 0/3] Fix inefficiences and rename nla_strlcpy Jakub Kicinski
2020-10-19 22:58 ` Kees Cook
2020-10-19 23:34 ` Jakub Kicinski
2020-10-20 10:18 ` Francis Laniel
2020-10-19 23:03 ` Kees Cook
2020-10-20 13:06 ` 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=5345693.Gt269SmXlT@machine \
--to=laniel_francis@privacyrequired.com \
--cc=jannh@google.com \
--cc=linux-hardening@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.