Skip to content

Commit 6fda0a5

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Reset global pointers to prevent use-after-free
2 parents 5295fc0 + be9f1d3 commit 6fda0a5

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ PHP NEWS
3333
. Fixed bug GH-19098 (libxml<2.13 segmentation fault caused by
3434
php_libxml_node_free). (nielsdos)
3535

36+
- Opcache:
37+
. Reset global pointers to prevent use-after-free in zend_jit_status().
38+
(Florian Engelhardt)
39+
3640
- OpenSSL:
3741
. Fixed bug GH-18986 (OpenSSL backend: incorrect RAND_{load,write}_file()
3842
return value check). (nielsdos, botovq)

ext/opcache/jit/zend_jit.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3717,6 +3717,14 @@ void zend_jit_shutdown(void)
37173717
#else
37183718
zend_jit_trace_free_caches(&jit_globals);
37193719
#endif
3720+
3721+
/* Reset global pointers to prevent use-after-free in `zend_jit_status()`
3722+
* after gracefully restarting Apache with mod_php, see:
3723+
* https://github.com/php/php-src/pull/19212 */
3724+
dasm_ptr = NULL;
3725+
dasm_buf = NULL;
3726+
dasm_end = NULL;
3727+
dasm_size = 0;
37203728
}
37213729

37223730
static void zend_jit_reset_counters(void)

0 commit comments

Comments
 (0)