unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 1/2] gnu: libpng: Fix a null pointer dereference [fixes security issue].
@ 2016-12-29 18:04 Leo Famulari
  2016-12-29 18:04 ` [PATCH 2/2] gnu: libpng-1.2: " Leo Famulari
  2016-12-29 18:26 ` [PATCH 1/2] gnu: libpng: " Marius Bakke
  0 siblings, 2 replies; 4+ messages in thread
From: Leo Famulari @ 2016-12-29 18:04 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/patches/libpng-fix-null-ptr-dereference.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/image.scm (libpng)[replacement]: New field.
(libpng/fixed): New variable.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/image.scm                             |  9 ++++++
 .../patches/libpng-fix-null-ptr-dereference.patch  | 36 ++++++++++++++++++++++
 3 files changed, 46 insertions(+)
 create mode 100644 gnu/packages/patches/libpng-fix-null-ptr-dereference.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 106adb235..38c1b0b94 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -675,6 +675,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libmad-armv7-thumb-pt2.patch		\
   %D%/packages/patches/libmad-frame-length.patch		\
   %D%/packages/patches/libmad-mips-newgcc.patch			\
+  %D%/packages/patches/libpng-fix-null-ptr-dereference.patch	\
   %D%/packages/patches/libssh-0.6.5-CVE-2016-0739.patch		\
   %D%/packages/patches/libtar-CVE-2013-4420.patch \
   %D%/packages/patches/libtheora-config-guess.patch		\
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 1c500b334..69eeaed58 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -64,6 +64,7 @@
 (define-public libpng
   (package
    (name "libpng")
+   (replacement libpng/fixed)
    (version "1.6.25")
    (source (origin
             (method url-fetch)
@@ -88,6 +89,14 @@ library.  It supports almost all PNG features and is extensible.")
    (license license:zlib)
    (home-page "http://www.libpng.org/pub/png/libpng.html")))
 
+(define libpng/fixed
+  (package
+    (inherit libpng)
+    (source
+      (origin
+        (inherit (package-source libpng))
+        (patches (search-patches "libpng-fix-null-ptr-dereference.patch"))))))
+
 (define-public libpng-1.2
   (package
     (inherit libpng)
diff --git a/gnu/packages/patches/libpng-fix-null-ptr-dereference.patch b/gnu/packages/patches/libpng-fix-null-ptr-dereference.patch
new file mode 100644
index 000000000..192459162
--- /dev/null
+++ b/gnu/packages/patches/libpng-fix-null-ptr-dereference.patch
@@ -0,0 +1,36 @@
+Fix a null pointer dereference in png_set_text_2():
+
+http://seclists.org/oss-sec/2016/q4/777
+
+Patch adapted from upstream source repository:
+
+https://sourceforge.net/p/libpng/code/ci/812768d7a9c973452222d454634496b25ed415eb/
+
+From 812768d7a9c973452222d454634496b25ed415eb Mon Sep 17 00:00:00 2001
+From: Glenn Randers-Pehrson <glennrp at users.sourceforge.net>
+Date: Thu, 29 Dec 2016 07:51:33 -0600
+Subject: [PATCH] [libpng16] Fixed a potential null pointer dereference in
+ png_set_text_2()
+
+(bug report and patch by Patrick Keshishian).
+---
+ ANNOUNCE | 2 ++
+ CHANGES  | 2 ++
+ png.c    | 1 +
+ 3 files changed, 5 insertions(+)
+
+diff --git a/png.c b/png.c
+index 8afc28fc2..2e05de159 100644
+--- a/png.c
++++ b/png.c
+@@ -477,6 +477,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
+          png_free(png_ptr, info_ptr->text);
+          info_ptr->text = NULL;
+          info_ptr->num_text = 0;
++         info_ptr->max_text = 0;
+       }
+    }
+ #endif
+-- 
+2.11.0
+
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] gnu: libpng-1.2: Fix a null pointer dereference [fixes security issue].
  2016-12-29 18:04 [PATCH 1/2] gnu: libpng: Fix a null pointer dereference [fixes security issue] Leo Famulari
@ 2016-12-29 18:04 ` Leo Famulari
  2016-12-29 18:26 ` [PATCH 1/2] gnu: libpng: " Marius Bakke
  1 sibling, 0 replies; 4+ messages in thread
From: Leo Famulari @ 2016-12-29 18:04 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/patches/libpng-1.2-fix-null-ptr-dereference.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/image.scm (libpng-1.2)[replacement]: New field.
(libpng-1.2/fixed): New variable.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/image.scm                             |  9 ++++++
 .../libpng-1.2-fix-null-ptr-dereference.patch      | 36 ++++++++++++++++++++++
 3 files changed, 46 insertions(+)
 create mode 100644 gnu/packages/patches/libpng-1.2-fix-null-ptr-dereference.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 38c1b0b94..fee497b0e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -676,6 +676,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libmad-frame-length.patch		\
   %D%/packages/patches/libmad-mips-newgcc.patch			\
   %D%/packages/patches/libpng-fix-null-ptr-dereference.patch	\
+  %D%/packages/patches/libpng-1.2-fix-null-ptr-dereference.patch	\
   %D%/packages/patches/libssh-0.6.5-CVE-2016-0739.patch		\
   %D%/packages/patches/libtar-CVE-2013-4420.patch \
   %D%/packages/patches/libtheora-config-guess.patch		\
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 69eeaed58..a576ae71a 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -100,6 +100,7 @@ library.  It supports almost all PNG features and is extensible.")
 (define-public libpng-1.2
   (package
     (inherit libpng)
+    (replacement libpng-1.2/fixed)
     (version "1.2.56")
     (source
      (origin
@@ -113,6 +114,14 @@ library.  It supports almost all PNG features and is extensible.")
        (sha256
         (base32 "1ghd03p353x0vi4dk83n1nlldg11w7vqdk3f99rkgfb82ic59ki4"))))))
 
+(define libpng-1.2/fixed
+  (package
+    (inherit libpng-1.2)
+    (source
+      (origin
+        (inherit (package-source libpng-1.2))
+        (patches (search-patches "libpng-1.2-fix-null-ptr-dereference.patch"))))))
+
 (define-public libjpeg
   (package
    (name "libjpeg")
diff --git a/gnu/packages/patches/libpng-1.2-fix-null-ptr-dereference.patch b/gnu/packages/patches/libpng-1.2-fix-null-ptr-dereference.patch
new file mode 100644
index 000000000..e6220eed8
--- /dev/null
+++ b/gnu/packages/patches/libpng-1.2-fix-null-ptr-dereference.patch
@@ -0,0 +1,36 @@
+Fix a null pointer dereference in png_set_text_2():
+
+http://seclists.org/oss-sec/2016/q4/777
+
+Patch adapted from upstream source repository:
+
+https://sourceforge.net/p/libpng/code/ci/794a15fad6add4d636369d0b46f603a02995b2e2/
+
+From 794a15fad6add4d636369d0b46f603a02995b2e2 Mon Sep 17 00:00:00 2001
+From: Glenn Randers-Pehrson <glennrp at users.sourceforge.net>
+Date: Thu, 29 Dec 2016 07:34:51 -0600
+Subject: [PATCH] [libpng12] Fixed a potential null pointer dereference in
+ png_set_text_2()
+
+(bug report and patch by Patrick Keshishian).
+---
+ ANNOUNCE | 2 ++
+ CHANGES  | 4 +++-
+ png.c    | 1 +
+ 3 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/png.c b/png.c
+index 08d7e86b7..a4934d1d5 100644
+--- a/png.c
++++ b/png.c
+@@ -393,6 +393,7 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
+          png_free(png_ptr, info_ptr->text);
+          info_ptr->text = NULL;
+          info_ptr->num_text=0;
++         info_ptr->max_text=0;
+       }
+    }
+ #endif
+-- 
+2.11.0
+
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] gnu: libpng: Fix a null pointer dereference [fixes security issue].
  2016-12-29 18:04 [PATCH 1/2] gnu: libpng: Fix a null pointer dereference [fixes security issue] Leo Famulari
  2016-12-29 18:04 ` [PATCH 2/2] gnu: libpng-1.2: " Leo Famulari
@ 2016-12-29 18:26 ` Marius Bakke
  2016-12-29 18:42   ` Leo Famulari
  1 sibling, 1 reply; 4+ messages in thread
From: Marius Bakke @ 2016-12-29 18:26 UTC (permalink / raw)
  To: Leo Famulari, guix-devel

[-- Attachment #1: Type: text/plain, Size: 289 bytes --]

Leo Famulari <leo@famulari.name> writes:

> * gnu/packages/patches/libpng-fix-null-ptr-dereference.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
> * gnu/packages/image.scm (libpng)[replacement]: New field.
> (libpng/fixed): New variable.

That was quick! Both patches LGTM.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] gnu: libpng: Fix a null pointer dereference [fixes security issue].
  2016-12-29 18:26 ` [PATCH 1/2] gnu: libpng: " Marius Bakke
@ 2016-12-29 18:42   ` Leo Famulari
  0 siblings, 0 replies; 4+ messages in thread
From: Leo Famulari @ 2016-12-29 18:42 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

On Thu, Dec 29, 2016 at 07:26:16PM +0100, Marius Bakke wrote:
> Leo Famulari <leo@famulari.name> writes:
> 
> > * gnu/packages/patches/libpng-fix-null-ptr-dereference.patch: New file.
> > * gnu/local.mk (dist_patch_DATA): Add it.
> > * gnu/packages/image.scm (libpng)[replacement]: New field.
> > (libpng/fixed): New variable.
> 
> That was quick! Both patches LGTM.

I realized that since libpng-1.2 only has one user, it's not necessary
to graft the update. So I simply updated it to 1.2.57.

Thanks for the review!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-12-29 18:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-29 18:04 [PATCH 1/2] gnu: libpng: Fix a null pointer dereference [fixes security issue] Leo Famulari
2016-12-29 18:04 ` [PATCH 2/2] gnu: libpng-1.2: " Leo Famulari
2016-12-29 18:26 ` [PATCH 1/2] gnu: libpng: " Marius Bakke
2016-12-29 18:42   ` Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).