diff options
| author | Armin Kuster <akuster@mvista.com> | 2016-02-01 08:28:38 -0800 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2016-02-10 15:08:19 +0100 |
| commit | 4fecce0035001e8d5a3176032732de739e61fac0 (patch) | |
| tree | 94bb91cc19f357a494cd3a06b8399aeb6d4b36e9 /meta-oe/recipes-devtools | |
| parent | e28e6e1241ba6326c2a2dddb607bc525ab82ce5c (diff) | |
| download | meta-openembedded-4fecce0035001e8d5a3176032732de739e61fac0.tar.gz | |
php: Security fix CVE-2015-7803
CVE-2015-7803 php: NULL pointer dereference in phar_get_fp_offset()
Signed-off-by: Armin Kuster <akuster@mvista.com>
Diffstat (limited to 'meta-oe/recipes-devtools')
| -rw-r--r-- | meta-oe/recipes-devtools/php/php-5.6.12/CVE-2015-7803.patch | 85 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/php/php_5.6.12.bb | 4 |
2 files changed, 88 insertions, 1 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 new file mode 100644 index 0000000000..223b9958b6 --- /dev/null +++ b/meta-oe/recipes-devtools/php/php-5.6.12/CVE-2015-7803.patch | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | From d698f0ae51f67c9cce870b09c59df3d6ba959244 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Stanislav Malyshev <stas@php.net> | ||
| 3 | Date: Mon, 28 Sep 2015 15:51:59 -0700 | ||
| 4 | Subject: [PATCH] Fix bug #69720: Null pointer dereference in | ||
| 5 | phar_get_fp_offset() | ||
| 6 | |||
| 7 | Upstream-Status: Backport | ||
| 8 | |||
| 9 | https://git.php.net/?p=php-src.git;a=patch;h=d698f0ae51f67c9cce870b09c59df3d6ba959244 | ||
| 10 | |||
| 11 | excluded the binary part of the test | ||
| 12 | |||
| 13 | CVE: CVE-2015-7803 | ||
| 14 | Signed-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 | |||
| 24 | Index: 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 | +} | ||
| 69 | Index: 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.bb b/meta-oe/recipes-devtools/php/php_5.6.12.bb index ba78c3225f..b25e812fc0 100644 --- a/meta-oe/recipes-devtools/php/php_5.6.12.bb +++ b/meta-oe/recipes-devtools/php/php_5.6.12.bb | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | require php.inc | 1 | require php.inc |
| 2 | 2 | ||
| 3 | SRC_URI += "file://change-AC_TRY_RUN-to-AC_TRY_LINK.patch" | 3 | SRC_URI += "file://change-AC_TRY_RUN-to-AC_TRY_LINK.patch \ |
| 4 | file://CVE-2015-7803.patch \ | ||
| 5 | " | ||
| 4 | SRC_URI[md5sum] = "4578dee9d979114610a444bee263ed9b" | 6 | SRC_URI[md5sum] = "4578dee9d979114610a444bee263ed9b" |
| 5 | SRC_URI[sha256sum] = "6f27104272af7b2a996f85e4100fac627630fbdaf39d7bd263f16cf529c8853a" | 7 | SRC_URI[sha256sum] = "6f27104272af7b2a996f85e4100fac627630fbdaf39d7bd263f16cf529c8853a" |
