You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UAF in lexer with encoding translation and heredocs #16630
I tried both NTS and ZTS debug builds. Neither the non-JIT nor JIT example reproduces for me.
I just get:
Warning: Undefined variable $array in /run/media/niels/MoreData/php-src-multitasking/x.php on line 7
Warning: foreach() argument must be of type array|object, null given in /run/media/niels/MoreData/php-src-multitasking/x.php on line 7
Can you share the exact commit you tried this on, the configure options used, and the run options used please?
That still doesn't reproduce anything for me.
Is the reproduction code complete? The flag it asserts on makes me think that you're missing something related to closures, or nested functions...
AddressSanitizer:DEADLYSIGNAL
=================================================================
==70762==ERROR: AddressSanitizer: SEGV on unknown address 0x7fc24a06e400 (pc 0x7fc24a06e400 bp 0x7ffc9f9c4f90 sp 0x7ffc9f9c4ec8 T0)
==70762==The signal is caused by a READ memory access.
==70762==Hint: PC is at a non-executable region. Maybe a wild jump?
#0 0x7fc24a06e400 (<unknown module>)
#1 0x56503f6e8f42 in zend_execute /php-src/Zend/zend_vm_execute.h:64217:2
#2 0x5650403ea701 in zend_execute_script /php-src/Zend/zend.c:1934:3
#3 0x56503ecf8238 in php_execute_script_ex /php-src/main/main.c:2574:13
#4 0x56503ecf92f8 in php_execute_script /php-src/main/main.c:2614:9
#5 0x5650403fde76 in do_cli /php-src/sapi/cli/php_cli.c:938:5
#6 0x5650403f8544 in main /php-src/sapi/cli/php_cli.c:1313:18
#7 0x7fc250155d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (<unknown module>)
==70762==ABORTING
changed the title [-]Assertion failure in Zend/zend_execute.c:4341 and Zend/Optimizer/zend_optimizer.c:1187[/-][+]UAF in lexer with encoding translation and heredocs[/+]on Nov 6, 2024
Activity
ndossche commentedon Oct 29, 2024
I tried both NTS and ZTS debug builds. Neither the non-JIT nor JIT example reproduces for me.
I just get:
Can you share the exact commit you tried this on, the configure options used, and the run options used please?
YuanchengJiang commentedon Oct 30, 2024
sorry forgot to append the config.
-d "zend.multibyte=On" -d "zend.script_encoding=ISO-8859-1" -d "internal_encoding=EUC-JP"ndossche commentedon Oct 30, 2024
That still doesn't reproduce anything for me.
Is the reproduction code complete? The flag it asserts on makes me think that you're missing something related to closures, or nested functions...
YuanchengJiang commentedon Nov 6, 2024
For the segv:
I just reproduced it in the latest commit. Compile:
Run:
./php-src/sapi/cli/php -d "zend.multibyte=On" -d "zend.script_encoding=ISO-8859-1" -d "internal_encoding=EUC-JP" /tmp/test.phpOutput:
6 remaining items
ndossche commentedon Nov 6, 2024
This reproduces now, thanks.
This is a lexer bug, unrelated to opcache or JIT.
[-]Assertion failure in Zend/zend_execute.c:4341 and Zend/Optimizer/zend_optimizer.c:1187[/-][+]UAF in lexer with encoding translation and heredocs[/+]Fix phpGH-16630: UAF in lexer with encoding translation and heredocs
Merge branch 'PHP-8.4'