parser_bison: fix UaF when reporting table parse error
Florian Westphal
maintainerPATCH 1/1 parser_bison: fix UaF when reporting table parse error
It passed already-freed memory to erec function. Found with afl++ and asan.
Fixes 4955ae1a81b7 ("Add support for table's persist flag")
Signed-off-by Florian Westphal <[email protected]>
--- src/parser_bison.y | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
src/parser_bison.y +3 -1
@@ -1943,12 +1943,14 @@ table_flags : table_flag table_flag : STRING { $$ = parse_table_flag($1); - free_const($1); if ($$ == 0) { erec_queue(error(&@1, "unknown table option %s", $1), state->msgs); + free_const($1); YYERROR; } + + free_const($1); } ;
Signature · 1 line
2.45.2
Quoted 4 lines · Florian Westphal
It passed already-freed memory to erec function. Found with afl++ and asan.
Fixes 4955ae1a81b7 ("Add support for table's persist flag")Signed-off-by Florian Westphal <[email protected]>
Reviewed-by Pablo Neira Ayuso <[email protected]>
Quoted 28 lines
--- src/parser_bison.y | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)src/parser_bison.y +3
-1@@ -1943,12 +1943,14 @@ table_flags : table_flag table_flag : STRING { $$ = parse_table_flag($1); - free_const($1); if ($$ == 0) { erec_queue(error(&@1, "unknown table option %s", $1), state->msgs); + free_const($1); YYERROR; } + + free_const($1); } ;Signature · 1 line
2.45.2