[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#926630: marked as done (unblock: libpng1.6/1.6.36-6)



Your message dated Tue, 04 Jun 2019 17:43:00 +0000
with message-id <617a1c05-6a13-c231-a252-e9c074da68b2@thykier.net>
and subject line Re: Bug#926630: unblock: libpng1.6/1.6.36-6
has caused the Debian Bug report #926630,
regarding unblock: libpng1.6/1.6.36-6
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
926630: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926630
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
User: release.debian.org@packages.debian.org
Usertags: unblock
Severity: normal

Please unblock package libpng1.6

Finally, the arm issue we are facing since a lot of time (upstream had a look, to understand if the failing test
was a real bug or a testsuite one, and now it seems to be a real missing free in the code).

Previously, to let the package migrate, I uncommented part of the upstream fix, because it was making the test pass on arm*.

Now, with this updated and fixed approach, I have been able to:
1) uncomment the 70d122aac42933ab8a708c538f973c3307853212 (this fix was needed but was making things worse, now with the followup
commits it works again)
2) add  82ae623ec9bc3cb5c68aad22596a766e86d593b7 and a627bd26a375f5c41d54f90a47c838157d1bec97, the two proper fixes for this issue
3) comment 272 proposed patch, this is now superseded by the above.

I also tweaked the patch description for the CVE fix, so we have a link to the upstream commit that merged it.
I also took the possibility to update the maintainers list to fix bug 925014

debdiff attached

thanks for caring,

unblock libpng1.6/1.6.36-6

diff -Nru libpng1.6-1.6.36/debian/changelog libpng1.6-1.6.36/debian/changelog
--- libpng1.6-1.6.36/debian/changelog	2019-02-05 12:54:50.000000000 +0100
+++ libpng1.6-1.6.36/debian/changelog	2019-04-08 10:55:25.000000000 +0200
@@ -1,3 +1,21 @@
+libpng1.6 (1.6.36-6) unstable; urgency=medium
+
+  * Upload to unstable
+
+ -- Gianfranco Costamagna <locutusofborg@debian.org>  Mon, 08 Apr 2019 10:55:25 +0200
+
+libpng1.6 (1.6.36-5exp1) experimental; urgency=medium
+
+  * Drop Anibal from uploaders list,
+    thank you for your nice work! (Closes: #925014)
+  * Update copyright years.
+  * Drop patch 272.patch, superseeded by upstream commits:
+    70d122aac42933ab8a708c538f973c3307853212.patch (uncommented)
+    82ae623ec9bc3cb5c68aad22596a766e86d593b7.patch
+    a627bd26a375f5c41d54f90a47c838157d1bec97.patch
+
+ -- Gianfranco Costamagna <locutusofborg@debian.org>  Wed, 20 Mar 2019 11:58:35 +0100
+
 libpng1.6 (1.6.36-5) unstable; urgency=medium
 
   * Tweak old 272 patch to add the only relevant part of commit
@@ -11,7 +29,7 @@
 
   * debian/patches/70d122aac42933ab8a708c538f973c3307853212.patch,
     debian/patches/8439534daa1d3a5705ba92e653eda9251246dd61.patch:
-    - new fixes for arm64 and general test failures (and leaks) 
+    - new fixes for arm64 and general test failures (and leaks)
   * debian/patches/CVE-2019-7317.patch:
     - fix for CVE 2019-7317 (Closes: #921355)
       Thanks Salvatore Bonaccorso for your report!
diff -Nru libpng1.6-1.6.36/debian/control libpng1.6-1.6.36/debian/control
--- libpng1.6-1.6.36/debian/control	2019-01-15 09:59:23.000000000 +0100
+++ libpng1.6-1.6.36/debian/control	2019-04-08 10:55:25.000000000 +0200
@@ -1,7 +1,7 @@
 Source: libpng1.6
 Section: libs
 Priority: optional
-Maintainer: Anibal Monsalve Salazar <anibal@debian.org>
+Maintainer: Maintainers of libpng1.6 packages <libpng1.6@packages.debian.org>
 Uploaders: Nobuhiro Iwamatsu <iwamatsu@debian.org>,
            Gianfranco Costamagna <locutusofborg@debian.org>,
            Tobias Frost <tobi@debian.org>
diff -Nru libpng1.6-1.6.36/debian/copyright libpng1.6-1.6.36/debian/copyright
--- libpng1.6-1.6.36/debian/copyright	2019-01-15 09:59:23.000000000 +0100
+++ libpng1.6-1.6.36/debian/copyright	2019-04-08 09:58:28.000000000 +0200
@@ -3,8 +3,9 @@
 Source: http://www.libpng.org/pub/png/
 
 Files: *
-Copyright: 1998-2018 Glenn Randers-Pehrson
-           2018 Cosmin Truta
+Copyright: 1995-2019 The PNG Reference Library Authors.
+           1998-2018 Glenn Randers-Pehrson
+           2018-2019 Cosmin Truta
 License: libpng
 
 Files: arm/arm_init.c
diff -Nru libpng1.6-1.6.36/debian/patches/70d122aac42933ab8a708c538f973c3307853212.patch libpng1.6-1.6.36/debian/patches/70d122aac42933ab8a708c538f973c3307853212.patch
--- libpng1.6-1.6.36/debian/patches/70d122aac42933ab8a708c538f973c3307853212.patch	2019-02-05 12:54:50.000000000 +0100
+++ libpng1.6-1.6.36/debian/patches/70d122aac42933ab8a708c538f973c3307853212.patch	2019-04-08 10:08:21.000000000 +0200
@@ -149,23 +149,23 @@
   * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
   * Copyright (c) 1996-1997 Andreas Dilger
   * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
-#@@ -1079,6 +1079,12 @@
-#    png_ptr->chunk_list = NULL;
-# #endif
-# 
-#+#if defined(PNG_READ_EXPAND_SUPPORTED) && \
-#+    defined(PNG_ARM_NEON_IMPLEMENTATION)
-#+   png_free(png_ptr, png_ptr->riffled_palette);
-#+   png_ptr->riffled_palette = NULL;
-#+#endif
-#+
-#    /* NOTE: the 'setjmp' buffer may still be allocated and the memory and error
-#     * callbacks are still set at this point.  They are required to complete the
-#     * destruction of the png_struct itself.
-Index: libpng1.6/pngrtran.c
-===================================================================
---- libpng1.6.orig/pngrtran.c
-+++ libpng1.6/pngrtran.c
+@@ -1075,6 +1075,12 @@
+    png_ptr->chunk_list = NULL;
+ #endif
+ 
++#if defined(PNG_READ_EXPAND_SUPPORTED) && \
++    defined(PNG_ARM_NEON_IMPLEMENTATION)
++   png_free(png_ptr, png_ptr->riffled_palette);
++   png_ptr->riffled_palette = NULL;
++#endif
++
+    /* NOTE: the 'setjmp' buffer may still be allocated and the memory and error
+     * callbacks are still set at this point.  They are required to complete the
+     * destruction of the png_struct itself.
+diff --git a/pngrtran.c b/pngrtran.c
+index ccc58ce6f..329434091 100644
+--- a/pngrtran.c
++++ b/pngrtran.c
 @@ -1,7 +1,7 @@
  
  /* pngrtran.c - transforms the data in a row for PNG readers
diff -Nru libpng1.6-1.6.36/debian/patches/82ae623ec9bc3cb5c68aad22596a766e86d593b7.patch libpng1.6-1.6.36/debian/patches/82ae623ec9bc3cb5c68aad22596a766e86d593b7.patch
--- libpng1.6-1.6.36/debian/patches/82ae623ec9bc3cb5c68aad22596a766e86d593b7.patch	1970-01-01 01:00:00.000000000 +0100
+++ libpng1.6-1.6.36/debian/patches/82ae623ec9bc3cb5c68aad22596a766e86d593b7.patch	2019-04-08 10:03:34.000000000 +0200
@@ -0,0 +1,128 @@
+From 82ae623ec9bc3cb5c68aad22596a766e86d593b7 Mon Sep 17 00:00:00 2001
+From: Cosmin Truta <ctruta@gmail.com>
+Date: Sun, 31 Mar 2019 09:44:45 -0400
+Subject: [PATCH] arm: Rename all functions to the pattern png_*_neon; add
+ debug traces
+
+---
+ arm/palette_neon_intrinsics.c | 12 +++++++++---
+ pngpriv.h                     |  6 +++---
+ pngrtran.c                    |  6 +++---
+ 3 files changed, 15 insertions(+), 9 deletions(-)
+
+diff --git a/arm/palette_neon_intrinsics.c b/arm/palette_neon_intrinsics.c
+index 465ed3697..b4d1fd2ab 100644
+--- a/arm/palette_neon_intrinsics.c
++++ b/arm/palette_neon_intrinsics.c
+@@ -22,7 +22,7 @@
+ 
+ /* Build an RGBA8 palette from the separate RGB and alpha palettes. */
+ void
+-png_riffle_palette_rgba8(png_structrp png_ptr)
++png_riffle_palette_neon(png_structrp png_ptr)
+ {
+    png_const_colorp palette = png_ptr->palette;
+    png_bytep riffled_palette = png_ptr->riffled_palette;
+@@ -30,6 +30,8 @@ png_riffle_palette_rgba8(png_structrp png_ptr)
+    int num_trans = png_ptr->num_trans;
+    int i;
+ 
++   png_debug(1, "in png_riffle_palette_neon");
++
+    /* Initially black, opaque. */
+    uint8x16x4_t w = {{
+       vdupq_n_u8(0x00),
+@@ -57,7 +59,7 @@ png_riffle_palette_rgba8(png_structrp png_ptr)
+ 
+ /* Expands a palettized row into RGBA8. */
+ int
+-png_do_expand_palette_neon_rgba8(png_structrp png_ptr, png_row_infop row_info,
++png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info,
+     png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
+ {
+    png_uint_32 row_width = row_info->width;
+@@ -66,6 +68,8 @@ png_do_expand_palette_neon_rgba8(png_structrp png_ptr, png_row_infop row_info,
+    const png_int_32 pixels_per_chunk = 4;
+    int i;
+ 
++   png_debug(1, "in png_do_expand_palette_rgba8_neon");
++
+    if (row_width < pixels_per_chunk)
+       return 0;
+ 
+@@ -99,7 +103,7 @@ png_do_expand_palette_neon_rgba8(png_structrp png_ptr, png_row_infop row_info,
+ 
+ /* Expands a palettized row into RGB8. */
+ int
+-png_do_expand_palette_neon_rgb8(png_structrp png_ptr, png_row_infop row_info,
++png_do_expand_palette_rgb8_neon(png_structrp png_ptr, png_row_infop row_info,
+     png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
+ {
+    png_uint_32 row_width = row_info->width;
+@@ -107,6 +111,8 @@ png_do_expand_palette_neon_rgb8(png_structrp png_ptr, png_row_infop row_info,
+    const png_uint_32 pixels_per_chunk = 8;
+    int i;
+ 
++   png_debug(1, "in png_do_expand_palette_rgb8_neon");
++
+    if (row_width <= pixels_per_chunk)
+       return 0;
+ 
+diff --git a/pngpriv.h b/pngpriv.h
+index 24d245dbf..583c26f9b 100644
+--- a/pngpriv.h
++++ b/pngpriv.h
+@@ -2119,11 +2119,11 @@ PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
+ 
+ #if PNG_ARM_NEON_IMPLEMENTATION == 1
+ PNG_INTERNAL_FUNCTION(void,
+-                      png_riffle_palette_rgba8,
++                      png_riffle_palette_neon,
+                       (png_structrp),
+                       PNG_EMPTY);
+ PNG_INTERNAL_FUNCTION(int,
+-                      png_do_expand_palette_neon_rgba8,
++                      png_do_expand_palette_rgba8_neon,
+                       (png_structrp,
+                        png_row_infop,
+                        png_const_bytep,
+@@ -2131,7 +2131,7 @@ PNG_INTERNAL_FUNCTION(int,
+                        const png_bytepp),
+                       PNG_EMPTY);
+ PNG_INTERNAL_FUNCTION(int,
+-                      png_do_expand_palette_neon_rgb8,
++                      png_do_expand_palette_rgb8_neon,
+                       (png_structrp,
+                        png_row_infop,
+                        png_const_bytep,
+diff --git a/pngrtran.c b/pngrtran.c
+index 329434091..d2bb82eeb 100644
+--- a/pngrtran.c
++++ b/pngrtran.c
+@@ -1169,7 +1169,7 @@ png_init_palette_transformations(png_structrp png_ptr)
+       if ((png_ptr->num_trans > 0) && (png_ptr->bit_depth == 8))
+       {
+          png_ptr->riffled_palette = (png_bytep)png_malloc(png_ptr, 256 * 4);
+-         png_riffle_palette_rgba8(png_ptr);
++         png_riffle_palette_neon(png_ptr);
+       }
+    }
+ #endif /* PNG_ARM_NEON_INTRINSICS_AVAILABLE */
+@@ -4334,7 +4334,7 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
+                    * but sometimes row_info->bit_depth has been changed to 8.
+                    * In these cases, the palette hasn't been riffled.
+                    */
+-                  i = png_do_expand_palette_neon_rgba8(png_ptr, row_info, row,
++                  i = png_do_expand_palette_rgba8_neon(png_ptr, row_info, row,
+                       &sp, &dp);
+                }
+ #else
+@@ -4365,7 +4365,7 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
+                dp = row + (size_t)(row_width * 3) - 1;
+                i = 0;
+ #ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
+-               i = png_do_expand_palette_neon_rgb8(png_ptr, row_info, row,
++               i = png_do_expand_palette_rgb8_neon(png_ptr, row_info, row,
+                    &sp, &dp);
+ #else
+                PNG_UNUSED(png_ptr)
diff -Nru libpng1.6-1.6.36/debian/patches/8439534daa1d3a5705ba92e653eda9251246dd61.patch libpng1.6-1.6.36/debian/patches/8439534daa1d3a5705ba92e653eda9251246dd61.patch
--- libpng1.6-1.6.36/debian/patches/8439534daa1d3a5705ba92e653eda9251246dd61.patch	2019-02-05 12:54:50.000000000 +0100
+++ libpng1.6-1.6.36/debian/patches/8439534daa1d3a5705ba92e653eda9251246dd61.patch	2019-04-08 10:00:34.000000000 +0200
@@ -12,10 +12,10 @@
  pngtest.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)
 
-Index: libpng1.6/pngtest.c
-===================================================================
---- libpng1.6.orig/pngtest.c
-+++ libpng1.6/pngtest.c
+diff --git a/pngtest.c b/pngtest.c
+index e196fdaf5..f305d08dc 100644
+--- a/pngtest.c
++++ b/pngtest.c
 @@ -1,7 +1,7 @@
  
  /* pngtest.c - a simple test program to test libpng
@@ -25,7 +25,7 @@
   * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
   * Copyright (c) 1996-1997 Andreas Dilger
   * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
-@@ -961,6 +961,8 @@
+@@ -957,6 +957,8 @@ test_one_file(const char *inname, const char *outname)
     if (setjmp(png_jmpbuf(write_ptr)))
     {
        fprintf(STDERR, "%s -> %s: libpng write error\n", inname, outname);
@@ -34,7 +34,7 @@
        if (verbose != 0)
          fprintf(STDERR, "   destroying read structs\n");
        png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr);
-@@ -1456,7 +1458,7 @@
+@@ -1436,7 +1438,7 @@ test_one_file(const char *inname, const char *outname)
     row_buf = (png_bytep)png_malloc(read_ptr,
         png_get_rowbytes(read_ptr, read_info_ptr));
  
@@ -43,7 +43,7 @@
  #endif /* SINGLE_ROWBUF_ALLOC */
     pngtest_debug("Writing row data");
  
-@@ -1614,7 +1616,7 @@
+@@ -1490,7 +1492,7 @@ test_one_file(const char *inname, const char *outname)
           row_buf = (png_bytep)png_malloc(read_ptr,
               png_get_rowbytes(read_ptr, read_info_ptr));
  
diff -Nru libpng1.6-1.6.36/debian/patches/a627bd26a375f5c41d54f90a47c838157d1bec97.patch libpng1.6-1.6.36/debian/patches/a627bd26a375f5c41d54f90a47c838157d1bec97.patch
--- libpng1.6-1.6.36/debian/patches/a627bd26a375f5c41d54f90a47c838157d1bec97.patch	1970-01-01 01:00:00.000000000 +0100
+++ libpng1.6-1.6.36/debian/patches/a627bd26a375f5c41d54f90a47c838157d1bec97.patch	2019-04-08 10:03:27.000000000 +0200
@@ -0,0 +1,74 @@
+From a627bd26a375f5c41d54f90a47c838157d1bec97 Mon Sep 17 00:00:00 2001
+From: Cosmin Truta <ctruta@gmail.com>
+Date: Sun, 7 Apr 2019 19:50:12 -0400
+Subject: [PATCH] arm: Partially revert "Fix a memory leak in the riffled
+ palette [...]"
+
+The memory leak remains fixed, but the associated refactoring is
+being reverted. Moving the initialization of the riffled palette
+from png_do_read_transformations to png_init_palette_transformations
+has caused a regression in some of the test programs.
+
+Although png_init_palette_transformations is the proper place to
+perform this initialization, and the test programs are technically
+incorrect to fail, we are still undoing that refactoring for the
+time being.
+---
+ pngrtran.c | 30 ++++++++++++++----------------
+ 1 file changed, 14 insertions(+), 16 deletions(-)
+
+diff --git a/pngrtran.c b/pngrtran.c
+index d2bb82eeb..9a8fad9f4 100644
+--- a/pngrtran.c
++++ b/pngrtran.c
+@@ -1161,20 +1161,7 @@ png_init_palette_transformations(png_structrp png_ptr)
+          png_ptr->transformations &= ~(PNG_COMPOSE | PNG_BACKGROUND_EXPAND);
+    }
+ 
+-#ifdef PNG_READ_EXPAND_SUPPORTED
+-#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
+-   /* Initialize the accelerated palette expansion, if applicable. */
+-   if ((png_ptr->transformations & PNG_EXPAND) != 0)
+-   {
+-      if ((png_ptr->num_trans > 0) && (png_ptr->bit_depth == 8))
+-      {
+-         png_ptr->riffled_palette = (png_bytep)png_malloc(png_ptr, 256 * 4);
+-         png_riffle_palette_neon(png_ptr);
+-      }
+-   }
+-#endif /* PNG_ARM_NEON_INTRINSICS_AVAILABLE */
+-
+-#ifdef PNG_READ_BACKGROUND_SUPPORTED
++#if defined(PNG_READ_EXPAND_SUPPORTED) && defined(PNG_READ_BACKGROUND_SUPPORTED)
+    /* png_set_background handling - deals with the complexity of whether the
+     * background color is in the file format or the screen format in the case
+     * where an 'expand' will happen.
+@@ -1212,8 +1199,7 @@ png_init_palette_transformations(png_structrp png_ptr)
+ #endif /* READ_INVERT_ALPHA */
+       }
+    } /* background expand and (therefore) no alpha association. */
+-#endif /* READ_BACKGROUND */
+-#endif /* READ_EXPAND */
++#endif /* READ_EXPAND && READ_BACKGROUND */
+ }
+ 
+ static void /* PRIVATE */
+@@ -4785,6 +4771,18 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
+    {
+       if (row_info->color_type == PNG_COLOR_TYPE_PALETTE)
+       {
++#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
++         if ((png_ptr->num_trans > 0) && (png_ptr->bit_depth == 8))
++         {
++            if (png_ptr->riffled_palette == NULL)
++            {
++               /* Initialize the accelerated palette expansion. */
++               png_ptr->riffled_palette =
++                   (png_bytep)png_malloc(png_ptr, 256 * 4);
++               png_riffle_palette_neon(png_ptr);
++            }
++         }
++#endif
+          png_do_expand_palette(png_ptr, row_info, png_ptr->row_buf + 1,
+              png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
+       }
diff -Nru libpng1.6-1.6.36/debian/patches/CVE-2019-7317.patch libpng1.6-1.6.36/debian/patches/CVE-2019-7317.patch
--- libpng1.6-1.6.36/debian/patches/CVE-2019-7317.patch	2019-02-05 11:46:10.000000000 +0100
+++ libpng1.6-1.6.36/debian/patches/CVE-2019-7317.patch	2019-04-08 10:02:30.000000000 +0200
@@ -1,7 +1,5 @@
-## Description: add some description
-## Origin/Author: add some origin or author
-## Bug: bug URL
 Origin: https://github.com/glennrp/libpng/issues/275
+        https://github.com/pnggroup/libpng/commit/9c0d5c77bf5bf2d7c1e11f388de40a70e0191550
 Author: Cosmin Truta
 Description: Fix for CVE-2019-7317
 diff --git a/png.c b/png.c
diff -Nru libpng1.6-1.6.36/debian/patches/series libpng1.6-1.6.36/debian/patches/series
--- libpng1.6-1.6.36/debian/patches/series	2019-02-05 12:54:50.000000000 +0100
+++ libpng1.6-1.6.36/debian/patches/series	2019-04-08 10:07:40.000000000 +0200
@@ -1,6 +1,8 @@
 libpng-config.patch
-272.patch
+#272.patch
 libpng-1.6.36-apng.patch
-#70d122aac42933ab8a708c538f973c3307853212.patch
+70d122aac42933ab8a708c538f973c3307853212.patch
 8439534daa1d3a5705ba92e653eda9251246dd61.patch
 CVE-2019-7317.patch
+82ae623ec9bc3cb5c68aad22596a766e86d593b7.patch
+a627bd26a375f5c41d54f90a47c838157d1bec97.patch

--- End Message ---
--- Begin Message ---
Cyril Brulebois:
> Hi,
> 
> Paul Gevers <elbrus@debian.org> (2019-05-11):
>>> debdiff attached
>>>
>>> thanks for caring,
>>>
>>> unblock libpng1.6/1.6.36-6
>>
>> I am fine with this, but it needs a review by d-i (CC-ed kibi).
> 
> Apologies for the delay.
> 
> Based on runtime tests: no objections.
> 
> 
> Cheers,
> 

Unblocked, thanks.
~Niels

--- End Message ---

Reply to: