Skip to content

Commit be9f1d3

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Reset global pointers to prevent use-after-free
2 parents 6b0a809 + 7016ad5 commit be9f1d3

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
@@ -30,6 +30,10 @@ PHP NEWS
3030
. Fixed bug GH-19098 (libxml<2.13 segmentation fault caused by
3131
php_libxml_node_free). (nielsdos)
3232

33+
- Opcache:
34+
. Reset global pointers to prevent use-after-free in zend_jit_status().
35+
(Florian Engelhardt)
36+
3337
- OpenSSL:
3438
. Fixed bug GH-18986 (OpenSSL backend: incorrect RAND_{load,write}_file()
3539
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
@@ -5101,6 +5101,14 @@ ZEND_EXT_API void zend_jit_shutdown(void)
51015101
#else
51025102
zend_jit_trace_free_caches(&jit_globals);
51035103
#endif
5104+
5105+
/* Reset global pointers to prevent use-after-free in `zend_jit_status()`
5106+
* after gracefully restarting Apache with mod_php, see:
5107+
* https://github.com/php/php-src/pull/19212 */
5108+
dasm_ptr = NULL;
5109+
dasm_buf = NULL;
5110+
dasm_end = NULL;
5111+
dasm_size = 0;
51045112
}
51055113

51065114
static void zend_jit_reset_counters(void)

0 commit comments

Comments
 (0)