Skip to content

SEGV ext/opcache/jit/zend_jit_vm_helpers.c #17257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
YuanchengJiang opened this issue Dec 24, 2024 · 0 comments
Closed

SEGV ext/opcache/jit/zend_jit_vm_helpers.c #17257

YuanchengJiang opened this issue Dec 24, 2024 · 0 comments

Comments

@YuanchengJiang
Copy link

Description

The following code:

<?php
$functions = get_defined_functions();
$callbacks = $functions['user'];
foreach ($callbacks as $callback) {
ob_start($callback);
ob_end_flush();
}
function get_const() {
}
function test() {
var_dump(call_user_func('get_const', $x));
}
test();
try {session_unset();} catch (Exception $e) { echo($e); }

Resulted in this output:

/home/phpfuzz/WorkSpace/flowfusion/php-src/ext/opcache/jit/zend_jit_vm_helpers.c:138:15: runtime error: applying zero offset to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/phpfuzz/WorkSpace/flowfusion/php-src/ext/opcache/jit/zend_jit_vm_helpers.c:138:15

To reproduce:

-d "opcache.jit_hot_func=1" -d "zend_extension=/home/phpfuzz/WorkSpace/flowfusion/php-src/modules/opcache.so" -d "opcache.enable_cli=1" -d "opcache.jit=1254"

PHP Version

nightly

Operating System

No response

nielsdos added a commit to nielsdos/php-src that referenced this issue Dec 24, 2024
EX(opline) / opline can be stale if the IP is not stored, like in this
case on a trace enter. We always need to make sure that the opline is up
to date to make sure we don't use stale data.
@nielsdos nielsdos linked a pull request Dec 24, 2024 that will close this issue
nielsdos added a commit that referenced this issue Dec 26, 2024
* PHP-8.4:
  Fix GH-17257: UBSAN warning in ext/opcache/jit/zend_jit_vm_helpers.c
  Fix GH-17223: Memory leak in libxml encoding handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants