| Date: | Fri, 6 Oct 2017 02:51:52 -0500 |
| Subject: | heap-buffer-overflow (WRITE of size 1) in S_regatom (regcomp.c) |
| From: | Brian Carpenter <brian.carpenter [...] gmail.com> |
| To: | perl5-security-report [...] perl.org |
Triggered while fuzzing Perl v5.27.4-29-gdc41635.
od -tx1 ./test514
0000000 2f 30 30 5c 4e 7b 55 2b 30 7d df df df df df df
0000020 df 30 30 30 df df 30 2f 69
0000031
==28186==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60700000ac58 at pc 0x000000846c2d bp 0x7ffe716bc7f0 sp 0x7ffe716bc7e0
WRITE of size 1 at 0x60700000ac58 thread T0
#0 0x846c2c in S_regatom /root/perl/regcomp.c:13652
#1 0x8587f6 in S_regpiece /root/perl/regcomp.c:11708
#2 0x8587f6 in S_regbranch /root/perl/regcomp.c:11633
#3 0x88830a in S_reg /root/perl/regcomp.c:11371
#4 0x8c90dc in Perl_re_op_compile /root/perl/regcomp.c:7363
#5 0x5297d0 in Perl_pmruntime /root/perl/op.c:5888
#6 0x74d853 in Perl_yyparse /root/perl/perly.y:1210
#7 0x58b9b8 in S_parse_body /root/perl/perl.c:2450
#8 0x593622 in perl_parse /root/perl/perl.c:1753
#9 0x42eb7d in main /root/perl/perlmain.c:121
#10 0x7fba4cebe82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#11 0x42fe18 in _start (/root/perl/perl+0x42fe18)
0x60700000ac58 is located 0 bytes to the right of 72-byte region [0x60700000ac10,0x60700000ac58)
allocated by thread T0 here:
#0 0x7fba4dc62602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
#1 0x92dfd4 in Perl_safesysmalloc /root/perl/util.c:153
#2 0x8c6cbe in Perl_re_op_compile /root/perl/regcomp.c:7209
#3 0x5297d0 in Perl_pmruntime /root/perl/op.c:5888
#4 0x74d853 in Perl_yyparse /root/perl/perly.y:1210
#5 0x58b9b8 in S_parse_body /root/perl/perl.c:2450
#6 0x593622 in perl_parse /root/perl/perl.c:1753
#7 0x42eb7d in main /root/perl/perlmain.c:121
#8 0x7fba4cebe82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
SUMMARY: AddressSanitizer: heap-buffer-overflow /root/perl/regcomp.c:13652 S_regatom
==5420== Invalid write of size 1
==5420== at 0x52F178: Perl__to_fold_latin1 (in /usr/bin/perl)
==5420== by 0x532904: Perl__to_uni_fold_flags (in /usr/bin/perl)
==5420== by 0x4826E7: ??? (in /usr/bin/perl)
==5420== by 0x48479C: ??? (in /usr/bin/perl)
==5420== by 0x4798EA: ??? (in /usr/bin/perl)
==5420== by 0x48E942: Perl_re_op_compile (in /usr/bin/perl)
==5420== by 0x436377: Perl_pmruntime (in /usr/bin/perl)
==5420== by 0x46CB15: Perl_yyparse (in /usr/bin/perl)
==5420== by 0x442FB4: perl_parse (in /usr/bin/perl)
==5420== by 0x41CB28: main (in /usr/bin/perl)
==5420== Address 0x5b9dd88 is 0 bytes after a block of size 72 alloc'd
==5420== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5420== by 0x498241: Perl_safesysmalloc (in /usr/bin/perl)
==5420== by 0x48E5B4: Perl_re_op_compile (in /usr/bin/perl)
==5420== by 0x436377: Perl_pmruntime (in /usr/bin/perl)
==5420== by 0x46CB15: Perl_yyparse (in /usr/bin/perl)
==5420== by 0x442FB4: perl_parse (in /usr/bin/perl)
==5420== by 0x41CB28: main (in /usr/bin/perl)
==5420==
==5420== Invalid write of size 1
==5420== at 0x52F17B: Perl__to_fold_latin1 (in /usr/bin/perl)
==5420== by 0x532904: Perl__to_uni_fold_flags (in /usr/bin/perl)
==5420== by 0x4826E7: ??? (in /usr/bin/perl)
==5420== by 0x48479C: ??? (in /usr/bin/perl)
==5420== by 0x4798EA: ??? (in /usr/bin/perl)
==5420== by 0x48E942: Perl_re_op_compile (in /usr/bin/perl)
==5420== by 0x436377: Perl_pmruntime (in /usr/bin/perl)
==5420== by 0x46CB15: Perl_yyparse (in /usr/bin/perl)
==5420== by 0x442FB4: perl_parse (in /usr/bin/perl)
==5420== by 0x41CB28: main (in /usr/bin/perl)
==5420== Address 0x5b9dd89 is 1 bytes after a block of size 72 alloc'd
==5420== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5420== by 0x498241: Perl_safesysmalloc (in /usr/bin/perl)
==5420== by 0x48E5B4: Perl_re_op_compile (in /usr/bin/perl)
==5420== by 0x436377: Perl_pmruntime (in /usr/bin/perl)
==5420== by 0x46CB15: Perl_yyparse (in /usr/bin/perl)
==5420== by 0x442FB4: perl_parse (in /usr/bin/perl)
==5420== by 0x41CB28: main (in /usr/bin/perl)
==5420==
==5420== Invalid write of size 1
==5420== at 0x482311: ??? (in /usr/bin/perl)
==5420== by 0x48479C: ??? (in /usr/bin/perl)
==5420== by 0x4798EA: ??? (in /usr/bin/perl)
==5420== by 0x48E942: Perl_re_op_compile (in /usr/bin/perl)
==5420== by 0x436377: Perl_pmruntime (in /usr/bin/perl)
==5420== by 0x46CB15: Perl_yyparse (in /usr/bin/perl)
==5420== by 0x442FB4: perl_parse (in /usr/bin/perl)
==5420== by 0x41CB28: main (in /usr/bin/perl)
==5420== Address 0x5b9dd8c is 4 bytes after a block of size 72 alloc'd
==5420== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5420== by 0x498241: Perl_safesysmalloc (in /usr/bin/perl)
==5420== by 0x48E5B4: Perl_re_op_compile (in /usr/bin/perl)
==5420== by 0x436377: Perl_pmruntime (in /usr/bin/perl)
==5420== by 0x46CB15: Perl_yyparse (in /usr/bin/perl)
==5420== by 0x442FB4: perl_parse (in /usr/bin/perl)
==5420== by 0x41CB28: main (in /usr/bin/perl)
==5420==
panic: reg_node overrun trying to emit 0, 5b9dd90>=5b9dd88 at test514 line 1
Message body not shown because it is not plain text.