Author: aurel32
Date: 2011-02-26 17:10:17 +0000 (Sat, 26 Feb 2011)
New Revision: 4542

Added:
   glibc-package/trunk/debian/patches/any/cvs-qsort-race.diff
Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/series
Log:
  * Add patches/any/cvs-qsort-race.diff from upstream to fix race in
    qsort_r().  Closes: #614892.



Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog        2011-02-26 17:05:56 UTC (rev 
4541)
+++ glibc-package/trunk/debian/changelog        2011-02-26 17:10:17 UTC (rev 
4542)
@@ -2,9 +2,11 @@
 
   [ Aurelien Jarno ]
   * Re-enable build failure in case of testsuite regressions.
-  * Add patches/any/cvs-fnmatch-alloca.patch from upstream to a memory
-    corruption in fnmatch() that can lead to code execution.  Closes:
-    #615120.
+  * Add patches/any/cvs-fnmatch-alloca.patch from upstream to fix a 
+    memory corruption in fnmatch() that can lead to code execution.  
+    Closes: #615120.
+  * Add patches/any/cvs-qsort-race.diff from upstream to fix race in
+    qsort_r().  Closes: #614892.
 
   [ Samuel Thibault ]
   * patches/any/submitted-sched_h.diff: Synchronize bits/sched.h with

Added: glibc-package/trunk/debian/patches/any/cvs-qsort-race.diff
===================================================================
--- glibc-package/trunk/debian/patches/any/cvs-qsort-race.diff                  
        (rev 0)
+++ glibc-package/trunk/debian/patches/any/cvs-qsort-race.diff  2011-02-26 
17:10:17 UTC (rev 4542)
@@ -0,0 +1,37 @@
+2010-12-09  Ulrich Drepper  <drep...@gmail.com>
+
+       [BZ #11655]
+       * stdlib/msort.c (qsort_r): Make sure both phys_pages and pagesize
+       are initialized.
+
+diff --git a/stdlib/msort.c b/stdlib/msort.c
+index 35cd4d0..fc58f0d 100644
+--- a/stdlib/msort.c
++++ b/stdlib/msort.c
+@@ -25,6 +25,7 @@
+ #include <unistd.h>
+ #include <memcopy.h>
+ #include <errno.h>
++#include <atomic.h>
+ 
+ struct msort_param
+ {
+@@ -182,7 +183,7 @@ qsort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, 
void *arg)
+       static long int phys_pages;
+       static int pagesize;
+ 
+-      if (phys_pages == 0)
++      if (pagesize == 0)
+       {
+         phys_pages = __sysconf (_SC_PHYS_PAGES);
+ 
+@@ -197,6 +198,9 @@ qsort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, 
void *arg)
+            a quarter of the physical memory.  */
+         phys_pages /= 4;
+ 
++        /* Make sure phys_pages is written to memory.  */
++        atomic_write_barrier ();
++
+         pagesize = __sysconf (_SC_PAGESIZE);
+       }
+ 

Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series   2011-02-26 17:05:56 UTC (rev 
4541)
+++ glibc-package/trunk/debian/patches/series   2011-02-26 17:10:17 UTC (rev 
4542)
@@ -271,3 +271,4 @@
 any/cvs-dont-expand-dst-twice.diff
 any/cvs-ignore-origin-privileged.diff
 any/cvs-fnmatch-alloca.patch
+any/cvs-qsort-race.diff


-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1ptneu-0004rh...@alioth.debian.org

Reply via email to