summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfan.xin <fan.xin@jp.fujitsu.com>2015-12-14 13:37:53 +0900
committerArmin Kuster <akuster808@gmail.com>2016-09-18 12:19:15 -0700
commit7444253457e8e5581b3e48f173531f8119363fa4 (patch)
tree0d934f0eb467c322ba44142a254771dee79b947c
parent8d8671a31c07e5afdffd84de90fdb5a4149b818a (diff)
downloadmeta-openembedded-7444253457e8e5581b3e48f173531f8119363fa4.tar.gz
php: Upgrade 5.6.12 -> 5.6.16
Fix CVE-2015-7803, CVE-2015-7804 and other bugs http://php.net/ChangeLog-5.php Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> (cherry picked from commit ecaad588c79437be3209d987c49928ecbd907d8e) dropped several security patch included in this update. Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/php/php-5.6.12/CVE-2015-7803.patch85
-rw-r--r--meta-oe/recipes-devtools/php/php-5.6.12/CVE-2015-7804.patch64
-rw-r--r--meta-oe/recipes-devtools/php/php-5.6.12/CVE-2016-1903.patch55
-rw-r--r--meta-oe/recipes-devtools/php/php-5.6.16/change-AC_TRY_RUN-to-AC_TRY_LINK.patch (renamed from meta-oe/recipes-devtools/php/php-5.6.12/change-AC_TRY_RUN-to-AC_TRY_LINK.patch)0
-rw-r--r--meta-oe/recipes-devtools/php/php_5.6.12.bb9
-rw-r--r--meta-oe/recipes-devtools/php/php_5.6.16.bb5
6 files changed, 5 insertions, 213 deletions
diff --git a/meta-oe/recipes-devtools/php/php-5.6.12/CVE-2015-7803.patch b/meta-oe/recipes-devtools/php/php-5.6.12/CVE-2015-7803.patch
deleted file mode 100644
index 223b9958b..000000000
--- a/meta-oe/recipes-devtools/php/php-5.6.12/CVE-2015-7803.patch
+++ /dev/null
@@ -1,85 +0,0 @@
1From d698f0ae51f67c9cce870b09c59df3d6ba959244 Mon Sep 17 00:00:00 2001
2From: Stanislav Malyshev <stas@php.net>
3Date: Mon, 28 Sep 2015 15:51:59 -0700
4Subject: [PATCH] Fix bug #69720: Null pointer dereference in
5 phar_get_fp_offset()
6
7Upstream-Status: Backport
8
9https://git.php.net/?p=php-src.git;a=patch;h=d698f0ae51f67c9cce870b09c59df3d6ba959244
10
11excluded the binary part of the test
12
13CVE: CVE-2015-7803
14Signed-off-by: Armin Kuster <akuster@mvista.com>
15
16---
17 ext/phar/tests/bug69720.phar | Bin 0 -> 8192 bytes
18 ext/phar/tests/bug69720.phpt | 40 ++++++++++++++++++++++++++++++++++++++++
19 ext/phar/util.c | 6 +++++-
20 3 files changed, 45 insertions(+), 1 deletion(-)
21 create mode 100644 ext/phar/tests/bug69720.phar
22 create mode 100644 ext/phar/tests/bug69720.phpt
23
24Index: php-5.6.12/ext/phar/tests/bug69720.phpt
25===================================================================
26--- /dev/null
27+++ php-5.6.12/ext/phar/tests/bug69720.phpt
28@@ -0,0 +1,40 @@
29+--TEST--
30+Phar - bug #69720 - Null pointer dereference in phar_get_fp_offset()
31+--SKIPIF--
32+<?php if (!extension_loaded("phar")) die("skip"); ?>
33+--FILE--
34+<?php
35+try {
36+ // open an existing phar
37+ $p = new Phar(__DIR__."/bug69720.phar",0);
38+ // Phar extends SPL's DirectoryIterator class
39+ echo $p->getMetadata();
40+ foreach (new RecursiveIteratorIterator($p) as $file) {
41+ // $file is a PharFileInfo class, and inherits from SplFileInfo
42+ $temp="";
43+ $temp= $file->getFileName() . "\n";
44+ $temp.=file_get_contents($file->getPathName()) . "\n"; // display contents
45+ var_dump($file->getMetadata());
46+ }
47+}
48+ catch (Exception $e) {
49+ echo 'Could not open Phar: ', $e;
50+}
51+?>
52+--EXPECTF--
53+
54+MY_METADATA_NULL
55+
56+Warning: file_get_contents(phar:///%s): failed to open stream: phar error: "test.php" is not a file in phar "%s.phar" in %s.php on line %d
57+array(1) {
58+ ["whatever"]=>
59+ int(123)
60+}
61+object(DateTime)#2 (3) {
62+ ["date"]=>
63+ string(26) "2000-01-01 00:00:00.000000"
64+ ["timezone_type"]=>
65+ int(3)
66+ ["timezone"]=>
67+ string(3) "UTC"
68+}
69Index: php-5.6.12/ext/phar/util.c
70===================================================================
71--- php-5.6.12.orig/ext/phar/util.c
72+++ php-5.6.12/ext/phar/util.c
73@@ -494,7 +494,11 @@ really_get_entry:
74 (*ret)->is_tar = entry->is_tar;
75 (*ret)->fp = phar_get_efp(entry, 1 TSRMLS_CC);
76 if (entry->link) {
77- (*ret)->zero = phar_get_fp_offset(phar_get_link_source(entry TSRMLS_CC) TSRMLS_CC);
78+ phar_entry_info *link = phar_get_link_source(entry TSRMLS_CC);
79+ if(!link) {
80+ return FAILURE;
81+ }
82+ (*ret)->zero = phar_get_fp_offset(link TSRMLS_CC);
83 } else {
84 (*ret)->zero = phar_get_fp_offset(entry TSRMLS_CC);
85 }
diff --git a/meta-oe/recipes-devtools/php/php-5.6.12/CVE-2015-7804.patch b/meta-oe/recipes-devtools/php/php-5.6.12/CVE-2015-7804.patch
deleted file mode 100644
index a159ac24d..000000000
--- a/meta-oe/recipes-devtools/php/php-5.6.12/CVE-2015-7804.patch
+++ /dev/null
@@ -1,64 +0,0 @@
1From e78ac461dbefb7c4a3e9fde78d50fbc56b7b0183 Mon Sep 17 00:00:00 2001
2From: Stanislav Malyshev <stas@php.net>
3Date: Mon, 28 Sep 2015 17:12:35 -0700
4Subject: [PATCH] FIx bug #70433 - Uninitialized pointer in phar_make_dirstream
5 when zip entry filename is "/"
6
7Upstream-Status: Backport
8
9https://git.php.net/?p=php-src.git;a=patch;h=e78ac461dbefb7c4a3e9fde78d50fbc56b7b0183
10
11excluded the zip part of the original patch. Hand applied dirstream change
12
13CVE: CVE-2015-7804
14Signed-off-by: Armin Kuster <akuster@mvista.com>
15
16---
17 ext/phar/dirstream.c | 2 +-
18 ext/phar/tests/bug70433.phpt | 23 +++++++++++++++++++++++
19 ext/phar/tests/bug70433.zip | Bin 0 -> 264 bytes
20 3 files changed, 24 insertions(+), 1 deletion(-)
21 create mode 100644 ext/phar/tests/bug70433.phpt
22 create mode 100755 ext/phar/tests/bug70433.zip
23
24Index: php-5.6.12/ext/phar/dirstream.c
25===================================================================
26--- php-5.6.12.orig/ext/phar/dirstream.c
27+++ php-5.6.12/ext/phar/dirstream.c
28@@ -198,7 +198,7 @@ static php_stream *phar_make_dirstream(c
29 zend_hash_internal_pointer_reset(manifest);
30
31 while (FAILURE != zend_hash_has_more_elements(manifest)) {
32- if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(manifest, &str_key, &keylen, &unused, 0, NULL)) {
33+ if (HASH_KEY_IS_STRING != zend_hash_get_current_key_ex(manifest, &str_key, &keylen, &unused, 0, NULL)) {
34 break;
35 }
36
37Index: php-5.6.12/ext/phar/tests/bug70433.phpt
38===================================================================
39--- /dev/null
40+++ php-5.6.12/ext/phar/tests/bug70433.phpt
41@@ -0,0 +1,23 @@
42+--TEST--
43+Phar - bug #70433 - Uninitialized pointer in phar_make_dirstream when zip entry filename is "/"
44+--SKIPIF--
45+<?php if (!extension_loaded("phar")) die("skip"); ?>
46+--FILE--
47+<?php
48+$phar = new PharData(__DIR__."/bug70433.zip");
49+var_dump($phar);
50+$meta = $phar->getMetadata();
51+var_dump($meta);
52+?>
53+DONE
54+--EXPECTF--
55+object(PharData)#1 (3) {
56+ ["pathName":"SplFileInfo":private]=>
57+ string(0) ""
58+ ["glob":"DirectoryIterator":private]=>
59+ bool(false)
60+ ["subPathName":"RecursiveDirectoryIterator":private]=>
61+ string(0) ""
62+}
63+NULL
64+DONE
diff --git a/meta-oe/recipes-devtools/php/php-5.6.12/CVE-2016-1903.patch b/meta-oe/recipes-devtools/php/php-5.6.12/CVE-2016-1903.patch
deleted file mode 100644
index a7c35fe43..000000000
--- a/meta-oe/recipes-devtools/php/php-5.6.12/CVE-2016-1903.patch
+++ /dev/null
@@ -1,55 +0,0 @@
1From 4b8394dd78571826ac66a69dc240c623f31d78f8 Mon Sep 17 00:00:00 2001
2From: Stanislav Malyshev <stas@php.net>
3Date: Mon, 7 Dec 2015 23:30:49 -0800
4Subject: [PATCH] Fix bug #70976: fix boundary check on
5 gdImageRotateInterpolated
6
7Upstream-Status: Backport
8
9https://git.php.net/?p=php-src.git;a=commit;h=4b8394dd78571826ac66a69dc240c623f31d78f8
10
11CVE: CVE-2016-1903
12Signed-off-by: Armin Kuster <akuster@mvista.com>
13
14---
15 ext/gd/libgd/gd_interpolation.c | 2 +-
16 ext/gd/tests/bug70976.phpt | 13 +++++++++++++
17 2 files changed, 14 insertions(+), 1 deletion(-)
18 create mode 100644 ext/gd/tests/bug70976.phpt
19
20diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c
21index f70169d..0f874ac 100644
22--- a/ext/gd/libgd/gd_interpolation.c
23+++ b/ext/gd/libgd/gd_interpolation.c
24@@ -2162,7 +2162,7 @@ gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, in
25 {
26 const int angle_rounded = (int)floor(angle * 100);
27
28- if (bgcolor < 0) {
29+ if (bgcolor < 0 || bgcolor >= gdMaxColors) {
30 return NULL;
31 }
32
33diff --git a/ext/gd/tests/bug70976.phpt b/ext/gd/tests/bug70976.phpt
34new file mode 100644
35index 0000000..23af4ee
36--- /dev/null
37+++ b/ext/gd/tests/bug70976.phpt
38@@ -0,0 +1,13 @@
39+--TEST--
40+Bug #70976 (Memory Read via gdImageRotateInterpolated Array Index Out of Bounds)
41+--SKIPIF--
42+<?php
43+ if(!extension_loaded('gd')){ die('skip gd extension not available'); }
44+?>
45+--FILE--
46+<?php
47+$img = imagerotate(imagecreate(1,1),45,0x7ffffff9);
48+var_dump($img);
49+?>
50+--EXPECTF--
51+bool(false)
52\ No newline at end of file
53--
542.3.5
55
diff --git a/meta-oe/recipes-devtools/php/php-5.6.12/change-AC_TRY_RUN-to-AC_TRY_LINK.patch b/meta-oe/recipes-devtools/php/php-5.6.16/change-AC_TRY_RUN-to-AC_TRY_LINK.patch
index 39c334f39..39c334f39 100644
--- a/meta-oe/recipes-devtools/php/php-5.6.12/change-AC_TRY_RUN-to-AC_TRY_LINK.patch
+++ b/meta-oe/recipes-devtools/php/php-5.6.16/change-AC_TRY_RUN-to-AC_TRY_LINK.patch
diff --git a/meta-oe/recipes-devtools/php/php_5.6.12.bb b/meta-oe/recipes-devtools/php/php_5.6.12.bb
deleted file mode 100644
index bd9a5b601..000000000
--- a/meta-oe/recipes-devtools/php/php_5.6.12.bb
+++ /dev/null
@@ -1,9 +0,0 @@
1require php.inc
2
3SRC_URI += "file://change-AC_TRY_RUN-to-AC_TRY_LINK.patch \
4 file://CVE-2015-7803.patch \
5 file://CVE-2015-7804.patch \
6 file://CVE-2016-1903.patch \
7"
8SRC_URI[md5sum] = "4578dee9d979114610a444bee263ed9b"
9SRC_URI[sha256sum] = "6f27104272af7b2a996f85e4100fac627630fbdaf39d7bd263f16cf529c8853a"
diff --git a/meta-oe/recipes-devtools/php/php_5.6.16.bb b/meta-oe/recipes-devtools/php/php_5.6.16.bb
new file mode 100644
index 000000000..822c0907c
--- /dev/null
+++ b/meta-oe/recipes-devtools/php/php_5.6.16.bb
@@ -0,0 +1,5 @@
1require php.inc
2
3SRC_URI += "file://change-AC_TRY_RUN-to-AC_TRY_LINK.patch"
4SRC_URI[md5sum] = "765b164b89af1f03ae2fdf39a4e4e1df"
5SRC_URI[sha256sum] = "4fe6f40964c1bfaba05fc144ba20a2cdad33e11685f4f101ea5a48b98bbcd2ae"