summaryrefslogtreecommitdiffstats
path: root/tools/bpf
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2018-06-02 23:06:38 +0200
committerAlexei Starovoitov <ast@kernel.org>2018-06-03 16:46:55 +0200
commitb3bbba3570a7ba064f12c33f484eb9757a2b359e (patch)
tree68e5b635828abb20800a5f268cbbf01ecc8d0639 /tools/bpf
parentbpf: make sure to clear unused fields in tunnel/xfrm state fetch (diff)
downloadlinux-b3bbba3570a7ba064f12c33f484eb9757a2b359e.tar.xz
linux-b3bbba3570a7ba064f12c33f484eb9757a2b359e.zip
bpf: fix cbpf parser bug for octal numbers
Range is 0-7, not 0-9, otherwise parser silently excludes it from the strtol() rather than throwing an error. Reported-by: Marc Boschma <marc@boschma.cx> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/bpf')
-rw-r--r--tools/bpf/bpf_exp.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/bpf/bpf_exp.l b/tools/bpf/bpf_exp.l
index bd83149e7be0..4da8d053d68f 100644
--- a/tools/bpf/bpf_exp.l
+++ b/tools/bpf/bpf_exp.l
@@ -175,7 +175,7 @@ extern void yyerror(const char *str);
yylval.number = strtol(yytext, NULL, 10);
return number;
}
-([0][0-9]+) {
+([0][0-7]+) {
yylval.number = strtol(yytext + 1, NULL, 8);
return number;
}