Skip to content

Commit 7016ad5

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Reset global pointers to prevent use-after-free
2 parents 5fa27e2 + 3aaa8d3 commit 7016ad5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.2.30
44

5+
- Opcache:
6+
. Reset global pointers to prevent use-after-free in zend_jit_status().
7+
(Florian Engelhardt)
58

69
03 Jul 2025, PHP 8.2.29
710

ext/opcache/jit/zend_jit.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5085,6 +5085,14 @@ ZEND_EXT_API void zend_jit_shutdown(void)
50855085
#else
50865086
zend_jit_trace_free_caches(&jit_globals);
50875087
#endif
5088+
5089+
/* Reset global pointers to prevent use-after-free in `zend_jit_status()`
5090+
* after gracefully restarting Apache with mod_php, see:
5091+
* https://github.com/php/php-src/pull/19212 */
5092+
dasm_ptr = NULL;
5093+
dasm_buf = NULL;
5094+
dasm_end = NULL;
5095+
dasm_size = 0;
50885096
}
50895097

50905098
static void zend_jit_reset_counters(void)

0 commit comments

Comments
 (0)