com php-src: unprotect memory before writing into it: ext/opcache/ZendAccelerator.c ext/opcache/ZendAccelerator.h
ext/opcache/zend_accelerator_module.c
| From: | Antony Dovgal | Date: | Thu, 12 Dec 2013 08:47:43 +0000 |
| Subject: | com php-src: unprotect memory before writing into it: ext/opcache/ZendAccelerator.c ext/opcache/ZendAccelerator.h ext/opcache/zend_accelerator_module.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76633@lists.php.net to get a copy of this message | ||
Commit: 497bf545717c28865afef8746909e497f1a27b6d
Author: Antony Dovgal <tony2001@php.net> Thu, 5 Dec 2013 18:19:47 +0400
Parents: f394979d26582da0f37325d1463b8768a6422fe4
Branches: badoo-5.5_mysqlnd
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=497bf545717c28865afef8746909e497f1a27b6d
Log:
unprotect memory before writing into it
Changed paths:
M ext/opcache/ZendAccelerator.c
M ext/opcache/ZendAccelerator.h
M ext/opcache/zend_accelerator_module.c
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index c0edf7e..b6b6ec1 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -2722,6 +2722,17 @@ void accel_shutdown(TSRMLS_D)
}
+void zend_accel_schedule_restart_lock(zend_accel_restart_reason reason TSRMLS_DC)
+{
+ SHM_UNPROTECT();
+ zend_shared_alloc_lock(TSRMLS_C);
+
+ zend_accel_schedule_restart(reason TSRMLS_CC);
+
+ zend_shared_alloc_lock(TSRMLS_C);
+ SHM_PROTECT();
+}
+
void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC)
{
if (ZCSG(restart_pending)) {
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index cbc50d2..1bb1a4f 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -329,6 +329,7 @@ extern char *zps_api_failure_reason;
void accel_shutdown(TSRMLS_D);
void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC);
+void zend_accel_schedule_restart_lock(zend_accel_restart_reason reason TSRMLS_DC);
void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason TSRMLS_DC);
int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force TSRMLS_DC);
int accelerator_shm_read_lock(TSRMLS_D);
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index c3df1a6..b4fbb2f 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -690,7 +690,7 @@ static ZEND_FUNCTION(opcache_reset)
RETURN_FALSE;
}
- zend_accel_schedule_restart(ACCEL_RESTART_USER TSRMLS_CC);
+ zend_accel_schedule_restart_lock(ACCEL_RESTART_USER TSRMLS_CC);
RETURN_TRUE;
}