-
-
Notifications
You must be signed in to change notification settings - Fork 17
Segmentation Faults and Aborts 2017-06-05 #293
Comments
Fantastic! I'll check |
5.27.x: Either correct panic: constant overflowed allocated space, 31 >= 24 at id:000000,sig:06,src:023772,op:havoc,rep:16 line 1. 5.26.0c, and perl5.2[67] just reports a syntax error.
SEGV in all 5.2[67] DEBUGGING variants, perl and cperl. security relevant.
cperl regression with 5.27. Aborts or asserts. Caused by inconsistent TOKENBUF_SIZE and
cperl regression. Should error with Identifier too long.
panic: constant overflowed allocated space, 173 >= 168 or isUTF8_CHAR assert. Ok I assume. |
The max identifier length depends on the max tokenbuf size, which went from 256 in perl5 to 1024 in cperl, mostly to speed up parsing with a larger parser buffer. Harmonize a few places which still kept a hardcoded 256. Fixes id:000099,sig:11,src:027197,op:havoc,rep:4 from #293 Use a larger IO buffer of 1024 for pp_backtick, when draining it for the sideeffect only. Get rid of unnecessary sv_gets COW logic. SvGROW already does add +1.
With cperl all pads are stored as utf8. Fix one forgotten call in ck_sort, caught by afl-fuzzing id:000113,sig:06,src:029639+026337,op:splice,rep:4 id:000142,sig:11,src:027004,op:havoc,rep:32 in #293
Some of them critical. Thanks to Ryan Whitworth.
The max identifier length depends on the max tokenbuf size, which went from 256 in perl5 to 1024 in cperl, mostly to speed up parsing with a larger parser buffer. Harmonize a few places which still kept a hardcoded 256. Fixes id:000099,sig:11,src:027197,op:havoc,rep:4 from #293 Use a larger IO buffer of 1024 for pp_backtick, when draining it for the sideeffect only. Get rid of unnecessary sv_gets COW logic. SvGROW already does add +1.
With cperl all pads are stored as utf8. Fix one forgotten call in ck_sort, caught by afl-fuzzing id:000113,sig:06,src:029639+026337,op:splice,rep:4 id:000142,sig:11,src:027004,op:havoc,rep:32 in #293
This is a critical regression since 5.26, but thanksfully only with DEBUGGING. Before or without DEBUGGING it failed with the somewhat unhelpful error message "Unmatched ( in regex", now with more than 5000 open parens do the same. Fixes id:000001,sig:11,src:017300+020757,op:splice,rep:64-minimized, Closes #293
Yes, I thought I fixed all of them. Which one is still segfaulting? |
1 -
with gdb backtrace of:
2 -
gdb backtrace:
|
Fixed the 2 utf8 errors which segv in the error handler in cc56c5e76fa82e4cbadd842d7a7ff6256bab6576 but the new 2017-06-19 dir has many more. Working on these now |
utf8n_to_uvchr_error() only warns on some Malformed UTF-8 characters, but scan_const needs to error here. Do it with yyerror() which accumulates all parser errors until it "has too many errors". Fixes 2 errors in #293, esp. id:000162,sig:06,src:026278+031045,op:splice,rep:32 and id:000001,sig:06,src:024259,op:arith8,pos:5,val:+27 which segfaulted in the error handler for "panic: constant overflowed allocated space"
utf8n_to_uvchr_error() only warns on some Malformed UTF-8 characters, but scan_const needs to error here. Do it with yyerror() which accumulates all parser errors until it "has too many errors". Fixes 2 errors in #293, esp. id:000162,sig:06,src:026278+031045,op:splice,rep:32 and id:000001,sig:06,src:024259,op:arith8,pos:5,val:+27 which segfaulted in the error handler for "panic: constant overflowed allocated space"
Hello, I was using American Fuzzy Lop (afl-fuzz) to fuzz input to the
perl
program on Linux. Is fixing the crashes from these input files something you're interested in? The input files can be found here: https://github.com/rwhitworth/cperl-fuzz/tree/master/2017-06-05.Additionally there is a README.md within that repo directory that contains the gdb backtrace output. The binary was compiled with
AFL_HARDEN=1
(an afl-clang-fast compiler variable) so there may be some extra information that would not normally be printed to the screen during program execution.The files can be executed as
./perl id_filename
to cause seg faults and aborts. These were generated from commit 45ac51bLet me know if I can provide any more information to help narrow down these issues. If you would rather each of these issues be reported as separate issues I can do that as well.
The text was updated successfully, but these errors were encountered: