mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Refresh zend_mm shadow key on fork
The shadow key is refreshed when resetting the memory manager between two requests. But in forking SAPIs the first request of a child process inherits the shadow key of the parent. As a result, a leak of the shadow key during the first request of one process gives away the shadow key used during the first request of other processes. This makes the key refresh mechanism less useful. Here I ensure that we refresh the shadow key after a fork. We can not reset the manager as there may be active allocations. Instead, we have to recompute shadow pointers with the new key. Closes GH-16765
This commit is contained in:
parent
8e38f6d1c6
commit
c561f7da85
12 changed files with 85 additions and 13 deletions
|
@ -2530,6 +2530,7 @@ static void php_cli_server_startup_workers(void) {
|
|||
#if defined(HAVE_PRCTL) || defined(HAVE_PROCCTL)
|
||||
php_cli_server_worker_install_pdeathsig();
|
||||
#endif
|
||||
php_child_init();
|
||||
return;
|
||||
} else {
|
||||
php_cli_server_workers[php_cli_server_worker] = pid;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue