From: Song Liu <liu.song.a23@gmail.com>
To: Quentin Monnet <quentin.monnet@netronome.com>
Cc: Alban Crequy <alban.crequy@gmail.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>,
Networking <netdev@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
alban@kinvolk.io, iago@kinvolk.io
Subject: Re: [PATCH bpf v2] tools: bpftool: fix infinite loop in map create
Date: Fri, 12 Apr 2019 11:07:34 -0700 [thread overview]
Message-ID: <CAPhsuW4KENxuuafRFx9ak5rS4mf_i9yO2tN9WqGcB0nM01KiuA@mail.gmail.com> (raw)
In-Reply-To: <8fb1d2e0-f8c0-4e01-ddf8-158c9e80558c@netronome.com>
On Fri, Apr 12, 2019 at 6:21 AM Quentin Monnet
<quentin.monnet@netronome.com> wrote:
>
> 2019-04-12 14:40 UTC+0200 ~ Alban Crequy <alban.crequy@gmail.com>
> > From: Alban Crequy <alban@kinvolk.io>
> >
> > "bpftool map create" has an infinite loop on "while (argc)". The error
> > case is missing.
> >
> > Symptoms: when forgetting to type the keyword 'type' in front of 'hash':
> > $ sudo bpftool map create /sys/fs/bpf/dir/foobar hash key 8 value 8 entries 128
> > (infinite loop, taking all the CPU)
> > ^C
> >
> > After the patch:
> > $ sudo bpftool map create /sys/fs/bpf/dir/foobar hash key 8 value 8 entries 128
> > Error: unknown arg hash
> >
> > Fixes: 0b592b5a01be ("tools: bpftool: add map create command")
> > Signed-off-by: Alban Crequy <alban@kinvolk.io>
Acked-by: Song Liu <songliubraving@fb.com>
Thanks for the fix!
> >
> > ---
> >
> > Changes in v2:
> > - Explain the cause of the bug in commitmsg
> > - Add the "fixes" line in the commitmsg (Jakub's review)
> > - Rebase on the bpf tree
> >
> > v1 was initially based on bpf-next and submitted on
> > https://marc.info/?l=linux-kernel&m=155310327709613&w=2
> > ---
> > tools/bpf/bpftool/map.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
> > index 05b029b934a6..1ccc38718458 100644
> > --- a/tools/bpf/bpftool/map.c
> > +++ b/tools/bpf/bpftool/map.c
> > @@ -1151,6 +1151,9 @@ static int do_create(int argc, char **argv)
> > return -1;
> > }
> > NEXT_ARG();
> > + } else {
> > + p_err("unknown arg %s", *argv);
> > + return -1;
> > }
> > }
> >
> >
>
> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
>
> Thanks Alban!
next prev parent reply other threads:[~2019-04-12 18:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-12 12:40 Alban Crequy
2019-04-12 13:20 ` Quentin Monnet
2019-04-12 18:07 ` Song Liu [this message]
2019-04-12 23:45 ` Jakub Kicinski
2019-04-16 8:52 ` Daniel Borkmann
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=CAPhsuW4KENxuuafRFx9ak5rS4mf_i9yO2tN9WqGcB0nM01KiuA@mail.gmail.com \
--to=liu.song.a23@gmail.com \
--cc=alban.crequy@gmail.com \
--cc=alban@kinvolk.io \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=iago@kinvolk.io \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=quentin.monnet@netronome.com \
/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
all inboxes | Powered by JetHome®