selinux/checkpolicy/fuzz
Christian Göttsche f07fc2a752 checkpolicy/fuzz: override YY_FATAL_ERROR
The default action of the lexer macro YY_FATAL_ERROR(msg) is to print
the message and call exit().  This might happen on an overlong token
(8192 bytes) that does not fit into the token buffer.
Fuzz targets must not call exit() though, since an exit is treated as an
abnormal behavior, see https://llvm.org/docs/LibFuzzer.html#fuzz-target.

Since YY_FATAL_ERROR is used in functions with different return value
types and is expected to not return, jump to a location in the fuzzer
right before yyparse() instead.

Reported-by: oss-fuzz (issue 67728)
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
2024-04-04 11:17:44 -04:00
..
checkpolicy-fuzzer.c checkpolicy/fuzz: override YY_FATAL_ERROR 2024-04-04 11:17:44 -04:00
checkpolicy-fuzzer.dict checkpolicy: add libfuzz based fuzzer 2024-03-04 09:54:47 -05:00
min_pol.conf checkpolicy: add libfuzz based fuzzer 2024-03-04 09:54:47 -05:00
min_pol.mls.conf checkpolicy: add libfuzz based fuzzer 2024-03-04 09:54:47 -05:00