Skip to contentSkip to conversation

gd : CVE-2016-6906

PATCH New Catalin Enache 1 participant 1 message May 22, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gd : CVE-2016-6906

The read_image_tga function in gd_tga.c in the GD Graphics Library (aka libgd) before 2.2.4 allows remote attackers to cause a denial of service (out-of-bounds read) via a crafted TGA file, related to the decompression buffer.

Reference:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-6906

Upstream patches:
https://github.com/libgd/libgd/commit/fb0e0cce0b9f25389ab56604c3547351617e1415
https://github.com/libgd/libgd/commit/58b6dde319c301b0eae27d12e2a659e067d80558

---
 .../gd/gd/.gitignore-the-new-test-case.patch       |  24 ++
 .../recipes-support/gd/gd/CVE-2016-6906-1.patch    | 167 ++++++++++
 .../recipes-support/gd/gd/CVE-2016-6906-2.patch    | 135 ++++++++
 .../gd/gd/Fix-290-TGA-RLE-decoding-is-broken.patch | 359 +++++++++++++++++++++
 meta-oe/recipes-support/gd/gd_2.2.3.bb             |  19 +-
 5 files changed, 703 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/gd/gd/.gitignore-the-new-test-case.patch
 create mode 100644 meta-oe/recipes-support/gd/gd/CVE-2016-6906-1.patch
 create mode 100644 meta-oe/recipes-support/gd/gd/CVE-2016-6906-2.patch
 create mode 100644 meta-oe/recipes-support/gd/gd/Fix-290-TGA-RLE-decoding-is-broken.patch
meta-oe/recipes-support/gd/gd/.gitignore-the-new-test-case.patch new file +24 -0
new file mode 100644
index 0000000..eab4975
@@ -0,0 +1,24 @@
+From 8520274759cb8f95e483b02a445aff225e13467b Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <[email protected]>
+Date: Tue, 16 Aug 2016 16:00:27 +0200
+Subject: [PATCH] .gitignore the new test case
+
+Upstream-Status: Backport
+
+Signed-off-by: Catalin Enache <[email protected]>
+---
+ tests/tga/.gitignore | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/tga/.gitignore b/tests/tga/.gitignore
+index e88e124..7a659b1 100644
+--- a/tests/tga/.gitignore
++++ b/tests/tga/.gitignore
+@@ -4,3 +4,4 @@
+ /bug00248
+ /bug00248a
+ /tga_null
++/tga_read
+-- 
+2.10.2
+
meta-oe/recipes-support/gd/gd/CVE-2016-6906-1.patch new file +167 -0

167 lines not on this page · raw message

meta-oe/recipes-support/gd/gd/CVE-2016-6906-2.patch new file +135 -0

135 lines not on this page · raw message

meta-oe/recipes-support/gd/gd/Fix-290-TGA-RLE-decoding-is-broken.patch new file +359 -0

359 lines not on this page · raw message

meta-oe/recipes-support/gd/gd_2.2.3.bb +18 -1
index 4e21d53..5621706 100644
@@ -16,7 +16,11 @@ SRC_URI = "git://github.com/libgd/libgd.git;branch=GD-2.2 \
            file://fix-gcc-unused-functions.patch \
            file://CVE-2016-10166.patch \
            file://CVE-2016-10167.patch \
-           file://CVE-2016-10168.patch"
+           file://CVE-2016-10168.patch \
+           file://.gitignore-the-new-test-case.patch \
+           file://Fix-290-TGA-RLE-decoding-is-broken.patch;apply=no \
+           file://CVE-2016-6906-1.patch;apply=no \
+           file://CVE-2016-6906-2.patch;apply=no"
 
 SRCREV = "46ceef5970bf3a847ff61d1bdde7501d66c11d0c"
 
@@ -35,6 +39,19 @@ EXTRA_OECONF += " --disable-rpath \
 
 EXTRA_OEMAKE = 'LDFLAGS="${LDFLAGS}"'
 
+do_git_apply () {
+       cd ${S}
+       if [ ! -f tests/tga/tga_read_rgb.png ]; then
+               git apply ${S}/../Fix-290-TGA-RLE-decoding-is-broken.patch
+               git apply ${S}/../CVE-2016-6906-1.patch
+               git apply ${S}/../CVE-2016-6906-2.patch
+       fi
+}
+
+do_patch_append() {
+    bb.build.exec_func('do_git_apply', d)
+}
+
 do_install_append() {
     # cleanup buildpaths from gdlib.pc
     sed -i -e 's#${STAGING_DIR_HOST}##g' ${D}${libdir}/pkgconfig/gdlib.pc
Signature · 1 line
2.10.2