Author: aurel32
Date: 2011-06-04 12:00:50 +0000 (Sat, 04 Jun 2011)
New Revision: 4697

Added:
   glibc-package/trunk/debian/patches/any/cvs-unique_sym_table-corruptions.diff
Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/series
Log:
  * Add patches/any/cvs-unique_sym_table-corruptions.diff to fix 
    unique_sym_table corruptions when doing STB_GNU_UNIQUE or 
    ELF_RTYPE_CLASS_COPY lookups.



Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog        2011-06-04 11:53:37 UTC (rev 
4696)
+++ glibc-package/trunk/debian/changelog        2011-06-04 12:00:50 UTC (rev 
4697)
@@ -30,6 +30,9 @@
     some regexes.
   * Add patches/any/cvs-getaddrinfo-single-lookup.diff to fix fallbackup to
     single lookup dns requests.  Closes: #541167.
+  * Add patches/any/cvs-unique_sym_table-corruptions.diff to fix 
+    unique_sym_table corruptions when doing STB_GNU_UNIQUE or 
+    ELF_RTYPE_CLASS_COPY lookups.
 
   [ Steve Langasek ]
   * Tighten the dependency on dpkg to a multiarch aware version.

Added: 
glibc-package/trunk/debian/patches/any/cvs-unique_sym_table-corruptions.diff
===================================================================
--- 
glibc-package/trunk/debian/patches/any/cvs-unique_sym_table-corruptions.diff    
                            (rev 0)
+++ 
glibc-package/trunk/debian/patches/any/cvs-unique_sym_table-corruptions.diff    
    2011-06-04 12:00:50 UTC (rev 4697)
@@ -0,0 +1,81 @@
+2011-05-12  Ulrich Drepper  <[email protected]>
+
+       [BZ #12511]
+       * elf/dl-lookup.c (enter): Don't test for copy relocation here and
+       don't set DF_1_NODELETE here.
+       (do_lookup_x): When entering new entry test for copy relocation
+       and if necessary set DF_1_NODELETE flag.
+
+diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
+index 19b27d7..affb53f 100644
+--- a/elf/dl-lookup.c
++++ b/elf/dl-lookup.c
+@@ -312,39 +312,21 @@ do_lookup_x (const char *undef_name, uint_fast32_t 
new_hash,
+                definition we have to use it.  */
+             void enter (struct unique_sym *table, size_t size,
+                         unsigned int hash, const char *name,
+-                        const ElfW(Sym) *sym, struct link_map *map)
++                        const ElfW(Sym) *sym, const struct link_map *map)
+             {
+               size_t idx = hash % size;
+               size_t hash2 = 1 + hash % (size - 2);
+-              while (1)
++              while (table[idx].name != NULL)
+                 {
+-                  if (table[idx].name == NULL)
+-                    {
+-                      table[idx].hashval = hash;
+-                      table[idx].name = name;
+-                      if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
+-                        {
+-                          table[idx].sym = ref;
+-                          table[idx].map = undef_map;
+-                        }
+-                      else
+-                        {
+-                          table[idx].sym = sym;
+-                          table[idx].map = map;
+-
+-                          if (map->l_type == lt_loaded)
+-                            /* Make sure we don't unload this object by
+-                               setting the appropriate flag.  */
+-                            map->l_flags_1 |= DF_1_NODELETE;
+-                        }
+-
+-                      return;
+-                    }
+-
+                   idx += hash2;
+                   if (idx >= size)
+                     idx -= size;
+                 }
++
++              table[idx].hashval = hash;
++              table[idx].name = name;
++              table[idx].sym = sym;
++              table[idx].map = map;
+             }
+ 
+             struct unique_sym_table *tab
+@@ -450,8 +432,19 @@ do_lookup_x (const char *undef_name, uint_fast32_t 
new_hash,
+                 tab->free = free;
+               }
+ 
+-            enter (entries, size, new_hash, strtab + sym->st_name, sym,
+-                   (struct link_map *) map);
++            if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
++              enter (entries, size, new_hash, strtab + sym->st_name, ref,
++                     undef_map);
++            else
++              {
++                enter (entries, size, new_hash, strtab + sym->st_name, sym,
++                       map);
++
++                if (map->l_type == lt_loaded)
++                  /* Make sure we don't unload this object by
++                     setting the appropriate flag.  */
++                  ((struct link_map *) map)->l_flags_1 |= DF_1_NODELETE;
++              }
+             ++tab->n_elements;
+ 
+             __rtld_lock_unlock_recursive (tab->lock);

Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series   2011-06-04 11:53:37 UTC (rev 
4696)
+++ glibc-package/trunk/debian/patches/series   2011-06-04 12:00:50 UTC (rev 
4697)
@@ -262,3 +262,4 @@
 any/local-tst-writev.diff
 any/cvs-regex-oom.diff
 any/cvs-getaddrinfo-single-lookup.diff
+any/cvs-unique_sym_table-corruptions.diff


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Reply via email to