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 1 commit
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
Prev Previous commit
clarify comment
  • Loading branch information
realFlowControl committed Jul 24, 2025
commit c939b91bf9e9f1c46ffde812d1c4196af4b9b1ab
6 changes: 4 additions & 2 deletions ext/opcache/jit/zend_jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ ZEND_EXT_API void zend_jit_status(zval *ret)
add_assoc_long(&stats, "kind", JIT_G(trigger));
add_assoc_long(&stats, "opt_level", JIT_G(opt_level));
add_assoc_long(&stats, "opt_flags", JIT_G(opt_flags));
if (dasm_buf && dasm_end && dasm_ptr) {
if (dasm_buf) {
add_assoc_long(&stats, "buffer_size", (char*)dasm_end - (char*)dasm_buf);
add_assoc_long(&stats, "buffer_free", (char*)dasm_end - (char*)*dasm_ptr);
} else {
Expand Down Expand Up @@ -5088,7 +5088,9 @@ ZEND_EXT_API void zend_jit_shutdown(void)
zend_jit_trace_free_caches(&jit_globals);
#endif

// Reset global pointers to prevent use-after-free in Apache reload
/* 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;
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy