com php-src: Fix VirtualProtect memory size: ext/opcache/zend _shared_alloc.c
| From: | Anatol Belski | Date: | Thu, 11 Apr 2019 13:46:46 +0000 |
| Subject: | com php-src: Fix VirtualProtect memory size: ext/opcache/zend _shared_alloc.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-105661@lists.php.net to get a copy of this message | ||
Commit: f4628436df9492cd00465ba1f29d3c71dded17cc
Author: Anatol Belski <ab@php.net> Thu, 11 Apr 2019 15:42:22 +0200
Parents: 771c64edcced24c6134bcfea3546e86a4e30e3c7
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f4628436df9492cd00465ba1f29d3c71dded17cc
Log:
Fix VirtualProtect memory size
As otherwise it would remove executable flag from JIT memory
Thanks Dmitry for the hint :)
Changed paths:
M ext/opcache/zend_shared_alloc.c
Diff:
diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c
index ade01af..1ab7f77 100644
--- a/ext/opcache/zend_shared_alloc.c
+++ b/ext/opcache/zend_shared_alloc.c
@@ -626,7 +626,7 @@ void zend_accel_shared_protect(int mode)
for (i = 0; i < ZSMMG(shared_segments_count); i++) {
DWORD oldProtect;
- if (!VirtualProtect(ZSMMG(shared_segments)[i]->p, ZSMMG(shared_segments)[i]->size, mode,
&oldProtect)) {
+ if (!VirtualProtect(ZSMMG(shared_segments)[i]->p, ZSMMG(shared_segments)[i]->end, mode,
&oldProtect)) {
zend_accel_error(ACCEL_LOG_ERROR, "Failed to protect memory");
}
}