From a8a019d68a605dd2b699174dd7f55d6e8bbaeee6 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 21 May 2019 00:07:17 +0300 Subject: [PATCH] Prevent race condition in opcache_reset() --- ext/opcache/zend_accelerator_module.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 16fe80c9b4..4d4de77993 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -768,7 +768,10 @@ static ZEND_FUNCTION(opcache_reset) RETURN_FALSE; } + /* exclusive lock */ + zend_shared_alloc_lock(); zend_accel_schedule_restart(ACCEL_RESTART_USER); + zend_shared_alloc_unlock(); RETURN_TRUE; } -- 2.40.0