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

r6285 - in glibc-package/branches/glibc-branch-wheezy/debian: . patches patches/any



Author: aurel32
Date: 2014-10-08 20:49:56 +0000 (Wed, 08 Oct 2014)
New Revision: 6285

Added:
   glibc-package/branches/glibc-branch-wheezy/debian/patches/any/cvs-dlopen-tls-memleak.patch
Modified:
   glibc-package/branches/glibc-branch-wheezy/debian/changelog
   glibc-package/branches/glibc-branch-wheezy/debian/patches/series
Log:
patches/any/cvs-dlopen-tls-memleak.patch: new patch from upstream to
fix a memory leak with dlopen() and thread-local storage variables.
Closes: #763559.

Modified: glibc-package/branches/glibc-branch-wheezy/debian/changelog
===================================================================
--- glibc-package/branches/glibc-branch-wheezy/debian/changelog	2014-10-07 21:55:36 UTC (rev 6284)
+++ glibc-package/branches/glibc-branch-wheezy/debian/changelog	2014-10-08 20:49:56 UTC (rev 6285)
@@ -7,6 +7,9 @@
     fix stack overflow issues. Closes: #742925.
   * debian/patches/any/submitted-CVE-2014-0475.diff: update from upstream
     to fix a localplt regression introduced in version 2.13-38+deb7u3.
+  * patches/any/cvs-dlopen-tls-memleak.patch: new patch from upstream to
+    fix a memory leak with dlopen() and thread-local storage variables.
+    Closes: #763559.
 
  -- Aurelien Jarno <aurel32@debian.org>  Thu, 14 Aug 2014 15:00:43 +0200
 

Added: glibc-package/branches/glibc-branch-wheezy/debian/patches/any/cvs-dlopen-tls-memleak.patch
===================================================================
--- glibc-package/branches/glibc-branch-wheezy/debian/patches/any/cvs-dlopen-tls-memleak.patch	                        (rev 0)
+++ glibc-package/branches/glibc-branch-wheezy/debian/patches/any/cvs-dlopen-tls-memleak.patch	2014-10-08 20:49:56 UTC (rev 6285)
@@ -0,0 +1,142 @@
+2011-04-10  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #12650]
+	* sysdeps/i386/dl-tls.h: Define TLS_DTV_UNALLOCATED.
+	* sysdeps/ia64/dl-tls.h: Likewise.
+	* sysdeps/powerpc/dl-tls.h: Likewise.
+	* sysdeps/s390/dl-tls.h: Likewise.
+	* sysdeps/sh/dl-tls.h: Likewise.
+	* sysdeps/sparc/dl-tls.h: Likewise.
+	* sysdeps/x86_64/dl-tls.h: Likewise.
+	* elf/dl-tls.c: Don't define TLS_DTV_UNALLOCATED here.
+
+nptl/
+2011-04-10  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #12650]
+	* allocatestack.c (get_cached_stack): Deallocate DTV entries before
+	clearing memory.
+	Patch partly by Robert Rex <robert.rex@exasol.com>.
+
+ports/
+2011-04-11  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/arm/dl-tls.h (TLS_DTV_UNALLOCATED): Define.
+	* sysdeps/mips/dl-tls.h (TLS_DTV_UNALLOCATED): Define.
+
+
+--- a/elf/dl-tls.c
++++ b/elf/dl-tls.c
+@@ -33,9 +33,6 @@
+    to allow dynamic loading of modules defining IE-model TLS data.  */
+ #define TLS_STATIC_SURPLUS	64 + DL_NNS * 100
+ 
+-/* Value used for dtv entries for which the allocation is delayed.  */
+-#define TLS_DTV_UNALLOCATED	((void *) -1l)
+-
+ 
+ /* Out-of-memory handler.  */
+ #ifdef SHARED
+--- a/nptl/allocatestack.c
++++ b/nptl/allocatestack.c
+@@ -26,6 +26,7 @@
+ #include <sys/mman.h>
+ #include <sys/param.h>
+ #include <dl-sysdep.h>
++#include <dl-tls.h>
+ #include <tls.h>
+ #include <list.h>
+ #include <lowlevellock.h>
+@@ -242,6 +243,10 @@
+ 
+   /* Clear the DTV.  */
+   dtv_t *dtv = GET_DTV (TLS_TPADJ (result));
++  for (size_t cnt = 0; cnt < dtv[-1].counter; ++cnt)
++    if (! dtv[1 + cnt].pointer.is_static
++	&& dtv[1 + cnt].pointer.val != TLS_DTV_UNALLOCATED)
++      free (dtv[1 + cnt].pointer.val);
+   memset (dtv, '\0', (dtv[-1].counter + 1) * sizeof (dtv_t));
+ 
+   /* Re-initialize the TLS.  */
+--- a/sysdeps/i386/dl-tls.h
++++ b/sysdeps/i386/dl-tls.h
+@@ -58,3 +58,6 @@
+ 
+ # endif
+ #endif
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/sysdeps/ia64/dl-tls.h
++++ b/sysdeps/ia64/dl-tls.h
+@@ -28,3 +28,6 @@
+ #define DONT_USE_TLS_INDEX	1
+ 
+ extern void *__tls_get_addr (size_t m, size_t offset);
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/sysdeps/powerpc/dl-tls.h
++++ b/sysdeps/powerpc/dl-tls.h
+@@ -50,4 +50,7 @@
+ # define __TLS_GET_ADDR(__ti)	(__tls_get_addr (__ti) - TLS_DTV_OFFSET)
+ #endif
+ 
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
++
+ #endif /* dl-tls.h */
+--- a/sysdeps/s390/dl-tls.h
++++ b/sysdeps/s390/dl-tls.h
+@@ -75,3 +75,6 @@
+      + (unsigned long) __builtin_thread_pointer (); }) 
+ 
+ #endif
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/sysdeps/sh/dl-tls.h
++++ b/sysdeps/sh/dl-tls.h
+@@ -27,3 +27,6 @@
+ 
+ 
+ extern void *__tls_get_addr (tls_index *ti);
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/sysdeps/sparc/dl-tls.h
++++ b/sysdeps/sparc/dl-tls.h
+@@ -27,3 +27,6 @@
+ 
+ 
+ extern void *__tls_get_addr (tls_index *ti);
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/sysdeps/x86_64/dl-tls.h
++++ b/sysdeps/x86_64/dl-tls.h
+@@ -27,3 +27,6 @@
+ 
+ 
+ extern void *__tls_get_addr (tls_index *ti);
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/ports/sysdeps/arm/dl-tls.h
++++ b/ports/sysdeps/arm/dl-tls.h
+@@ -27,3 +27,6 @@
+ 
+ 
+ extern void *__tls_get_addr (tls_index *ti);
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)
+--- a/ports/sysdeps/mips/dl-tls.h
++++ b/ports/sysdeps/mips/dl-tls.h
+@@ -44,3 +44,6 @@
+ 
+ # define GET_ADDR_OFFSET	(ti->ti_offset + TLS_DTV_OFFSET)
+ # define __TLS_GET_ADDR(__ti)	(__tls_get_addr (__ti) - TLS_DTV_OFFSET)
++
++/* Value used for dtv entries for which the allocation is delayed.  */
++#define TLS_DTV_UNALLOCATED	((void *) -1l)

Modified: glibc-package/branches/glibc-branch-wheezy/debian/patches/series
===================================================================
--- glibc-package/branches/glibc-branch-wheezy/debian/patches/series	2014-10-07 21:55:36 UTC (rev 6284)
+++ glibc-package/branches/glibc-branch-wheezy/debian/patches/series	2014-10-08 20:49:56 UTC (rev 6285)
@@ -393,3 +393,4 @@
 any/cvs-CVE-2014-5119.diff
 any/cvs-resolv-reuse-fd.diff
 any/cvs-CVE-2013-4357.diff
+any/cvs-dlopen-tls-memleak.patch


Reply to: