mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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>
This commit is contained in:
parent
1fbc2e0cfc
commit
b3bbba3570
1 changed files with 1 additions and 1 deletions
|
@ -175,7 +175,7 @@ extern void yyerror(const char *str);
|
||||||
yylval.number = strtol(yytext, NULL, 10);
|
yylval.number = strtol(yytext, NULL, 10);
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
([0][0-9]+) {
|
([0][0-7]+) {
|
||||||
yylval.number = strtol(yytext + 1, NULL, 8);
|
yylval.number = strtol(yytext + 1, NULL, 8);
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue