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
Next Next commit
reset global pointers to prevent use-after-free
  • Loading branch information
realFlowControl committed Jul 24, 2025
commit a4f1c898dfeb5ae72d9b1aa25640bae715249e82
8 changes: 7 additions & 1 deletion 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) {
if (dasm_buf && dasm_end && dasm_ptr) {
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 @@ -5087,6 +5087,12 @@ 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 Apache reload
dasm_ptr = NULL;
dasm_buf = NULL;
dasm_end = NULL;
dasm_size = 0;
}

static void zend_jit_reset_counters(void)
Expand Down
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