Skip to content

reset global pointers to prevent use-after-free in zend_jit_status() #19212

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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ext/opcache/jit/zend_jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -5087,6 +5087,14 @@ ZEND_EXT_API void zend_jit_shutdown(void)
#else
zend_jit_trace_free_caches(&jit_globals);
#endif

/* Reset global pointers to prevent use-after-free in `zend_jit_status()`
* after gracefully restarting Apache with mod_php, see:
* https://github.com/php/php-src/pull/19212 */
dasm_ptr = NULL;
dasm_buf = NULL;
dasm_end = NULL;
dasm_size = 0;
}

static void zend_jit_reset_counters(void)
Expand Down
Loading