All of lore.kernel.org
 help / color / mirror / Atom feed
From: Armin Kuster <akuster808@gmail.com>
To: otavio@ossystems.com.br,
	openembedded-devel@lists.openembedded.org, akuster808@gmail.com
Subject: [PATCH 5/7] php: Security fix CVE-2015-7804
Date: Sun,  7 Feb 2016 13:11:57 -0800	[thread overview]
Message-ID: <0e1e5f42a8cac06bfcb10a1e4c37bbc35ba30891.1454879225.git.akuster@mvista.com> (raw)
In-Reply-To: <cover.1454879225.git.akuster@mvista.com>
In-Reply-To: <cover.1454879225.git.akuster@mvista.com>

From: Armin Kuster <akuster@mvista.com>

CVE-2015-7804 php: uninitialized pointer in phar_make_dirstream()

Signed-off-by: Armin Kuster <akuster@mvista.com>
---
 .../recipes-devtools/php/php/CVE-2015-7804.patch   | 62 ++++++++++++++++++++++
 meta-oe/recipes-devtools/php/php_5.5.21.bb         |  1 +
 2 files changed, 63 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/php/php/CVE-2015-7804.patch

diff --git a/meta-oe/recipes-devtools/php/php/CVE-2015-7804.patch b/meta-oe/recipes-devtools/php/php/CVE-2015-7804.patch
new file mode 100644
index 0000000..ad211a3
--- /dev/null
+++ b/meta-oe/recipes-devtools/php/php/CVE-2015-7804.patch
@@ -0,0 +1,62 @@
+From e78ac461dbefb7c4a3e9fde78d50fbc56b7b0183 Mon Sep 17 00:00:00 2001
+From: Stanislav Malyshev <stas@php.net>
+Date: Mon, 28 Sep 2015 17:12:35 -0700
+Subject: [PATCH] FIx bug #70433 - Uninitialized pointer in phar_make_dirstream
+ when zip entry filename is "/"
+
+Upstream-status: Backport
+
+https://git.php.net/?p=php-src.git;a=patch;h=e78ac461dbefb7c4a3e9fde78d50fbc56b7b0183
+
+CVE: CVE-2015-7804
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ ext/phar/dirstream.c         |   2 +-
+ ext/phar/tests/bug70433.phpt |  23 +++++++++++++++++++++++
+ ext/phar/tests/bug70433.zip  | Bin 0 -> 264 bytes
+ 3 files changed, 24 insertions(+), 1 deletion(-)
+ create mode 100644 ext/phar/tests/bug70433.phpt
+ create mode 100755 ext/phar/tests/bug70433.zip
+
+Index: php-5.5.21/ext/phar/dirstream.c
+===================================================================
+--- php-5.5.21.orig/ext/phar/dirstream.c
++++ php-5.5.21/ext/phar/dirstream.c
+@@ -207,7 +207,7 @@ static php_stream *phar_make_dirstream(c
+ 	zend_hash_internal_pointer_reset(manifest);
+ 
+ 	while (FAILURE != zend_hash_has_more_elements(manifest)) {
+-		if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(manifest, &key, &keylen, &unused, 0, NULL)) {
++		if (HASH_KEY_IS_STRING != zend_hash_get_current_key_ex(manifest, &key, &keylen, &unused, 0, NULL)) {
+ 			break;
+ 		}
+ 
+Index: php-5.5.21/ext/phar/tests/bug70433.phpt
+===================================================================
+--- /dev/null
++++ php-5.5.21/ext/phar/tests/bug70433.phpt
+@@ -0,0 +1,23 @@
++--TEST--
++Phar - bug #70433 - Uninitialized pointer in phar_make_dirstream when zip entry filename is "/"
++--SKIPIF--
++<?php if (!extension_loaded("phar")) die("skip"); ?>
++--FILE--
++<?php
++$phar = new PharData(__DIR__."/bug70433.zip");
++var_dump($phar);
++$meta = $phar->getMetadata();
++var_dump($meta);
++?>
++DONE
++--EXPECTF--
++object(PharData)#1 (3) {
++  ["pathName":"SplFileInfo":private]=>
++  string(0) ""
++  ["glob":"DirectoryIterator":private]=>
++  bool(false)
++  ["subPathName":"RecursiveDirectoryIterator":private]=>
++  string(0) ""
++}
++NULL
++DONE
diff --git a/meta-oe/recipes-devtools/php/php_5.5.21.bb b/meta-oe/recipes-devtools/php/php_5.5.21.bb
index 3582b45..ed286d6 100644
--- a/meta-oe/recipes-devtools/php/php_5.5.21.bb
+++ b/meta-oe/recipes-devtools/php/php_5.5.21.bb
@@ -15,6 +15,7 @@ SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \
            file://0001-php-don-t-use-broken-wrapper-for-mkdir.patch \
            file://0001-acinclude-use-pkgconfig-for-libxml2-config.patch \
            file://CVE-2015-7803.patch \
+           file://CVE-2015-7804.patch \
           "
 
 SRC_URI_append_class-target += " \
-- 
2.3.5



  parent reply	other threads:[~2016-02-07 21:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-07 21:11 [PATCH 0/7][fido] Pull request Armin Kuster
2016-02-07 21:11 ` [PATCH 1/7] squid: serveral missing security fixes Armin Kuster
2016-02-07 21:11 ` [PATCH 2/7] ntp: fix rpath QA issue Armin Kuster
2016-02-07 21:11 ` [PATCH 3/7] ntp: upgrade 4.2.8p3 -> 4.2.8p4 Armin Kuster
2016-02-07 21:11 ` [PATCH 4/7] php: Security fix CVE-2015-7803 Armin Kuster
2016-02-07 21:11 ` Armin Kuster [this message]
2016-02-07 21:11 ` [PATCH 6/7] php: Security fix CVE-2016-1903 Armin Kuster
2016-02-07 21:11 ` [PATCH 7/7] krb5: Fix warning Armin Kuster
2016-02-09 18:08   ` Martin Jansa
2016-02-09 20:27     ` akuster808
2016-02-09 21:41       ` Khem Raj
2016-02-09 23:33         ` akuster808

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0e1e5f42a8cac06bfcb10a1e4c37bbc35ba30891.1454879225.git.akuster@mvista.com \
    --to=akuster808@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=otavio@ossystems.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.