summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2014-10-19 14:23:59 +0200
committerOndřej Surý <ondrej@sury.org>2014-10-19 14:23:59 +0200
commit8f8926fbe267fa6d86f147728ca0008b06dd7657 (patch)
tree0fbf485ee47b4990dff001a6541d9eb42d2f40cc
parent2926451061fde5fb29ac108d616c74ea8de6cab0 (diff)
downloadphp-8f8926fbe267fa6d86f147728ca0008b06dd7657.tar.gz
Apply patch from PHP#68104 to fix segfaults in Zend OpCache (Closes: #754432)
-rw-r--r--debian/patches/php68104.patch53
-rw-r--r--debian/patches/series1
2 files changed, 54 insertions, 0 deletions
diff --git a/debian/patches/php68104.patch b/debian/patches/php68104.patch
new file mode 100644
index 000000000..5157699ae
--- /dev/null
+++ b/debian/patches/php68104.patch
@@ -0,0 +1,53 @@
+From 1b742a2e9f73c3ae57fbe7939932e22b619ce65e Mon Sep 17 00:00:00 2001
+From: manuel <manuel@mausz.at>
+Date: Fri, 26 Sep 2014 18:11:10 +0200
+Subject: [PATCH] Opcache: Fix segfault while pre-evaluating a disabled
+ function
+
+---
+ Zend/zend_API.c | 13 +++++++++++--
+ ext/opcache/tests/bug68104.phpt | 13 +++++++++++++
+ 2 files changed, 24 insertions(+), 2 deletions(-)
+ create mode 100644 ext/opcache/tests/bug68104.phpt
+
+--- php5.orig/Zend/zend_API.c
++++ php5/Zend/zend_API.c
+@@ -2642,11 +2642,20 @@ static zend_function_entry disabled_func
+
+ ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC) /* {{{ */
+ {
+- if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) {
++ zend_internal_function *func;
++ int retval;
++
++ if (zend_hash_find(CG(function_table), function_name, function_name_length+1, (void *)&func) == FAILURE) {
+ return FAILURE;
+ }
++
++ zend_hash_del(CG(function_table), function_name, function_name_length+1);
++
++ EG(current_module) = func->module;
+ disabled_function[0].fname = function_name;
+- return zend_register_functions(NULL, disabled_function, CG(function_table), MODULE_PERSISTENT TSRMLS_CC);
++ retval = zend_register_functions(NULL, disabled_function, CG(function_table), MODULE_PERSISTENT TSRMLS_CC);
++ EG(current_module) = NULL;
++ return retval;
+ }
+ /* }}} */
+
+--- /dev/null
++++ php5/ext/opcache/tests/bug68104.phpt
+@@ -0,0 +1,13 @@
++--TEST--
++Bug #68104 (Segfault while pre-evaluating a disabled function)
++--INI--
++opcache.enable=1
++opcache.enable_cli=1
++disable_functions=dl
++--SKIPIF--
++<?php require_once('skipif.inc'); ?>
++--FILE--
++<?php
++var_dump(is_callable("dl"));
++--EXPECT--
++bool(true)
diff --git a/debian/patches/series b/debian/patches/series
index 3b94cb46a..afdb05734 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -45,3 +45,4 @@ php-5.6.0-oldpcre.patch
hack-phpdbg-to-explicitly-link-with-libedit.patch
php-fpm-getallheaders.patch
0001-Fix-ZEND_MM_ALIGNMENT-on-m64k.patch
+php68104.patch